Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update and sort imports #285

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions doc/source/examples/antenna_toolkit_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

# ## Perform required imports

import sys
SMoraisAnsys marked this conversation as resolved.
Show resolved Hide resolved
import tempfile

import pyaedt
from pyaedt.generic.farfield_visualization import FfdSolutionData
from ansys.aedt.core import generate_unique_project_name
from ansys.aedt.core.generic.farfield_visualization import FfdSolutionData

from ansys.aedt.toolkits.antenna.backend.api import ToolkitBackend
from ansys.aedt.toolkits.antenna.backend.models import properties
Expand All @@ -29,7 +30,7 @@
# ## Create temporary directory

temp_dir = tempfile.TemporaryDirectory(suffix="_ansys")
project_name = pyaedt.generate_unique_project_name(root_name=temp_dir.name, project_name="antenna_toolkit")
project_name = generate_unique_project_name(root_name=temp_dir.name, project_name="antenna_toolkit")

# ## Set default properties

Expand Down Expand Up @@ -202,7 +203,7 @@

# Plot exported files

from pyaedt.generic.plot import ModelPlotter
from ansys.aedt.core.generic.plot import ModelPlotter

model = ModelPlotter()
for file in files:
Expand Down
6 changes: 3 additions & 3 deletions doc/source/examples/create_antenna_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import tempfile

import pyaedt
import ansys.aedt.core

from ansys.aedt.toolkits.antenna.backend.antenna_models.bowtie import BowTieRounded

Expand All @@ -29,7 +29,7 @@
# ## Create temporary directory

temp_dir = tempfile.TemporaryDirectory(suffix="_ansys")
project_name = pyaedt.generate_unique_project_name(root_name=temp_dir.name, project_name="bowtie_example")
project_name = ansys.aedt.core.generate_unique_project_name(root_name=temp_dir.name, project_name="bowtie_example")

# ## Create antenna object only for synthesis
#
Expand Down Expand Up @@ -63,7 +63,7 @@
#
# Create an empty HFSS design.

app = pyaedt.Hfss(project=project_name, version=aedt_version, non_graphical=non_graphical)
app = ansys.aedt.core.Hfss(project=project_name, version=aedt_version, non_graphical=non_graphical)

# ## Create antenna in HFSS
#
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ and toolkit level.
.. code:: python

# Import required modules
from pyaedt import Hfss
from ansys.aedt.core import Hfss
from ansys.aedt.toolkits.antenna.backend.antenna_models.bowtie import BowTie

# Open AEDT and create an HFSS design
Expand Down
2 changes: 1 addition & 1 deletion doc/source/toolkit/models/bowtie.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You must use these methods from PyAEDT as shown in this example:

.. code:: python

from pyaedt import Hfss
from ansys.aedt.core import Hfss

from ansys.aedt.toolkits.antenna.backend.antenna_models.bowtie import BowTieNormal

Expand Down
2 changes: 1 addition & 1 deletion doc/source/toolkit/models/conical_spiral.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You must use these methods from PyAEDT as shown in this example:

.. code:: python

from pyaedt import Hfss
from ansys.aedt.core import Hfss

from ansys.aedt.toolkits.antenna.backend.antenna_models.conical_spiral import (
Archimedean,
Expand Down
2 changes: 1 addition & 1 deletion doc/source/toolkit/models/helix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You must use these methods from PyAEDT as shown in this example:

.. code:: python

from pyaedt import Hfss
from ansys.aedt.core import Hfss

from ansys.aedt.toolkits.antenna.backend.antenna_models.helix import AxialMode

Expand Down
2 changes: 1 addition & 1 deletion doc/source/toolkit/models/horn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You must use these methods from PyAEDT as shown in this example:

.. code:: python

import pyaedt.Hfss
import ansys.aedt.core.Hfss

from ansys.aedt.toolkits.antenna.backend.antenna_models.horn import Conical

Expand Down
2 changes: 1 addition & 1 deletion doc/source/toolkit/models/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This code shows how to synthesize and create a model of an antenna in HFSS:
.. code:: python

# Import HFSS
from pyaedt import Hfss
from ansys.aedt.core import Hfss

# Import backend
from ansys.aedt.toolkits.antenna.backend.models.horn import Conical
Expand Down
2 changes: 1 addition & 1 deletion doc/source/toolkit/models/patch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You must use these methods from PyAEDT as shown in this example:

.. code:: python

from pyaedt import Hfss
from ansys.aedt.core import Hfss

from ansys.aedt.toolkits.antenna.backend.antenna_models.patch import (
RectangularPatchEdge,
Expand Down
16 changes: 8 additions & 8 deletions src/ansys/aedt/toolkits/antenna/backend/antenna_models/bowtie.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
from collections import OrderedDict
import math

import pyaedt.generic.constants as constants
from pyaedt.generic.general_methods import pyaedt_function_handler
import ansys.aedt.core.generic.constants as constants
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler

from ansys.aedt.toolkits.antenna.backend.antenna_models.common import TransmissionLine
from ansys.aedt.toolkits.antenna.backend.antenna_models.patch import CommonPatch
Expand Down Expand Up @@ -67,8 +67,8 @@ class BowTieNormal(CommonPatch):
Examples
--------
>>> from ansys.aedt.toolkits.antenna.backend.antenna_models.bowtie import BowTieNormal
>>> import pyaedt
>>> app = pyaedt.Hfss()
>>> import ansys.aedt.core
>>> app = ansys.aedt.core.Hfss()
>>> oantenna1 = BowTieNormal(app)
>>> oantenna1.frequency = 12.0
>>> oantenna1.model_hfss()
Expand Down Expand Up @@ -295,8 +295,8 @@ class BowTieRounded(CommonPatch):
Examples
--------
>>> from ansys.aedt.toolkits.antenna.backend.antenna_models.bowtie import BowTieRounded
>>> import pyaedt
>>> app = pyaedt.Hfss()
>>> import ansys.aedt.core
>>> app = ansys.aedt.core.Hfss()
>>> oantenna1 = BowTieRounded(app)
>>> oantenna1.frequency = 12.0
>>> oantenna1.model_hfss()
Expand Down Expand Up @@ -536,8 +536,8 @@ class BowTieSlot(CommonPatch):
Examples
--------
>>> from ansys.aedt.toolkits.antenna.backend.antenna_models.bowtie import BowTieSlot
>>> import pyaedt
>>> app = pyaedt.Hfss()
>>> import ansys.aedt.core
>>> app = ansys.aedt.core.Hfss()
>>> oantenna1 = BowTieSlot(app)
>>> oantenna1.frequency = 12.0
>>> oantenna1.model_hfss()
Expand Down
30 changes: 15 additions & 15 deletions src/ansys/aedt/toolkits/antenna/backend/antenna_models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import math
import os

import pyaedt.generic.constants as constants
from pyaedt.generic.general_methods import generate_unique_name
from pyaedt.generic.general_methods import pyaedt_function_handler
import ansys.aedt.core.generic.constants as constants
from ansys.aedt.core.generic.general_methods import generate_unique_name
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler

from ansys.aedt.toolkits.antenna.backend.antenna_models.parameters import InputParameters
from ansys.aedt.toolkits.antenna.backend.antenna_models.parameters import Property
Expand Down Expand Up @@ -225,15 +225,15 @@ def create_lattice_pair(self, lattice_height=None, bottom_extend=False):

Returns
-------
:class:`pyaedt.modeler.object3d.Object3d`
:class:`ansys.aedt.core.modeler.object3d.Object3d`
3D object.

Examples
--------
>>> from pyaedt import Hfss
>>> from ansys.aedt.toolkits.antenna.horn import ConicalHorn
>>> from ansys.aedt.core import Hfss
>>> from ansys.aedt.toolkits.antenna.backend.antenna_models.horn import Conical
>>> hfss = Hfss()
>>> horn = hfss.add_from_toolkit(ConicalHorn, draw=True)
>>> horn = hfss.add_from_toolkit(Conical, draw=True)
>>> horn = horn.create_lattice_pair(lattice_height="20mm")
"""
if not lattice_height:
Expand Down Expand Up @@ -299,7 +299,7 @@ def create_3dcomponent(self, component_file=None, component_name=None, replace=F
Parameters
----------
component_file : str, optional
Full path to the A3DCOMP file. The default is the ``pyaedt`` folder.
Full path to the A3DCOMP file. The default is the ``ansys.aedt.core`` folder.
component_name : str, optional
Name of the component. The default is the antenna name.
replace : bool, optional
Expand All @@ -309,14 +309,14 @@ def create_3dcomponent(self, component_file=None, component_name=None, replace=F
-------
str
Path of the 3D component file or
:class:`pyaedt.modeler.components_3d.UserDefinedComponent`.
:class:`ansys.aedt.core.modeler.components_3d.UserDefinedComponent`.

Examples
--------
>>> from pyaedt import Hfss
>>> from ansys.aedt.toolkits.antenna.horn import ConicalHorn
>>> from ansys.aedt.core import Hfss
>>> from ansys.aedt.toolkits.antenna.backend.antenna_models.horn import Conical
>>> hfss = Hfss()
>>> horn = hfss.add_from_toolkit(ConicalHorn, draw=True)
>>> horn = hfss.add_from_toolkit(Conical, draw=True)
>>> horn = horn.create_3dcomponent()
"""
if not component_file:
Expand Down Expand Up @@ -378,10 +378,10 @@ def duplicate_along_line(self, vector, num_clones=2):

Examples
--------
>>> from pyaedt import Hfss
>>> from ansys.aedt.toolkits.antenna.horn import ConicalHorn
>>> from ansys.aedt.core import Hfss
>>> from ansys.aedt.toolkits.antenna.backend.antenna_models.horn import Conical
>>> hfss = Hfss()
>>> horn = hfss.add_from_toolkit(ConicalHorn, draw=True)
>>> horn = hfss.add_from_toolkit(Conical, draw=True)
>>> new_horn = horn.duplicate_along_line([10, 0, 0], 2)
"""
new_objects = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
from collections import OrderedDict
import math

import ansys.aedt.core.generic.constants as constants
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler
from ansys.aedt.toolkits.common.backend.logger_handler import logger
import pyaedt.generic.constants as constants
from pyaedt.generic.general_methods import pyaedt_function_handler

from ansys.aedt.toolkits.antenna.backend.antenna_models.common import CommonAntenna

Expand Down Expand Up @@ -157,7 +157,7 @@ class Archimedean(CommonConicalSpiral):

Examples
--------
>>> from pyaedt import Hfss
>>> from ansys.aedt.core import Hfss
>>> from ansys.aedt.toolkits.antenna.backend.antenna_models.conical_spiral import Archimedean
>>> hfss = Hfss()
>>> antenna = Archimedean(hfss, start_frequency=20.0,
Expand Down Expand Up @@ -366,7 +366,7 @@ class Log(CommonConicalSpiral):

Examples
--------
>>> from pyaedt import Hfss
>>> from ansys.aedt.core import Hfss
>>> from ansys.aedt.toolkits.antenna.backend.antenna_models.conical_spiral import Log
>>> hfss = Hfss()
>>> antenna = Log(hfss, start_frequency=20.0,
Expand Down Expand Up @@ -563,7 +563,7 @@ class Sinuous(CommonConicalSpiral):

Examples
--------
>>> from pyaedt import Hfss
>>> from ansys.aedt.core import Hfss
>>> from ansys.aedt.toolkits.antenna.backend.antenna_models.conical_spiral import Sinuous
>>> hfss = Hfss()
>>> antenna = Archimedean(hfss, start_frequency=20.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
from collections import OrderedDict
import math

import ansys.aedt.core.generic.constants as constants
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler
from ansys.aedt.toolkits.common.backend.logger_handler import logger
import pyaedt.generic.constants as constants
from pyaedt.generic.general_methods import pyaedt_function_handler

from ansys.aedt.toolkits.antenna.backend.antenna_models.common import CommonAntenna

Expand Down Expand Up @@ -164,8 +164,8 @@ class AxialMode(CommonHelix):
Examples
--------
>>> from ansys.aedt.toolkits.antenna.backend.antenna_models.helix import AxialMode
>>> import pyaedt
>>> app = pyaedt.Hfss()
>>> import ansys.aedt.core
>>> app = ansys.aedt.core.Hfss()
>>> oantenna1 = AxialMode(app)
>>> oantenna1.frequency = 12.0
>>> oantenna1.model_hfss()
Expand Down
Loading
Loading