Skip to content
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
1 change: 1 addition & 0 deletions doc/changelog.d/6716.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add dir as property
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/aedt_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def filter(self, record):
return True


class AedtLogger(object):
class AedtLogger:
"""
Specifies the logger to use for each AEDT logger.

Expand Down
3 changes: 2 additions & 1 deletion src/ansys/aedt/core/application/aedt_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
import warnings

from ansys.aedt.core.application.aedt_units import AedtUnits
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.constants import SolutionsHfss
from ansys.aedt.core.generic.general_methods import is_linux
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler
from ansys.aedt.core.generic.general_methods import settings
from ansys.aedt.core.internal.desktop_sessions import _desktop_sessions


class AedtObjects(object):
class AedtObjects(PyAedtBase):
def __init__(self, desktop=None, project=None, design=None, is_inherithed=False):
self._odesign = design
self._oproject = project
Expand Down
3 changes: 2 additions & 1 deletion src/ansys/aedt/core/application/aedt_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.constants import AEDT_UNITS


class AedtUnits:
class AedtUnits(PyAedtBase):
"""Class containing all default AEDT units. All properties are read-only except length units."""

def __init__(self, aedt_object=None):
Expand Down
5 changes: 3 additions & 2 deletions src/ansys/aedt/core/application/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
from ansys.aedt.core.application.design import Design
from ansys.aedt.core.application.job_manager import update_hpc_option
from ansys.aedt.core.application.variables import Variable
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.constants import SOLUTIONS
from ansys.aedt.core.generic.constants import Axis
from ansys.aedt.core.generic.constants import Gravity
Expand Down Expand Up @@ -79,7 +80,7 @@
from ansys.aedt.core.modules.solve_sweeps import SetupProps


class Analysis(Design, object):
class Analysis(Design, PyAedtBase):
"""Contains all common analysis functions.

This class is inherited in the caller application and is accessible through it ( eg. ``hfss.method_name``).
Expand Down Expand Up @@ -2571,7 +2572,7 @@ def number_with_units(self, value, units=None): # pragma: no cover
return self.value_with_units(value, units)


class AvailableVariations(object):
class AvailableVariations(PyAedtBase):
def __init__(self, app):
"""Contains available variations.

Expand Down
3 changes: 2 additions & 1 deletion src/ansys/aedt/core/application/analysis_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import warnings

from ansys.aedt.core.application.analysis import Analysis
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.configurations import Configurations
from ansys.aedt.core.generic.constants import unit_converter
from ansys.aedt.core.generic.file_utils import check_if_path_exists
Expand All @@ -43,7 +44,7 @@
from ansys.aedt.core.internal.checks import min_aedt_version


class FieldAnalysis3D(Analysis, object):
class FieldAnalysis3D(Analysis, PyAedtBase):
"""Manages 3D field analysis setup in HFSS, Maxwell 3D, and Q3D.

This class is automatically initialized by an application call from one of
Expand Down
3 changes: 2 additions & 1 deletion src/ansys/aedt/core/application/analysis_3d_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@
import warnings

from ansys.aedt.core.application.analysis import Analysis
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.configurations import Configurations3DLayout
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler
from ansys.aedt.core.generic.settings import settings
from ansys.aedt.core.modules.setup_templates import SetupKeys
from ansys.aedt.core.modules.solve_setup import Setup3DLayout


class FieldAnalysis3DLayout(Analysis):
class FieldAnalysis3DLayout(Analysis, PyAedtBase):
"""Manages 3D field analysis setup in HFSS 3D Layout.

This class is automatically initialized by an application call from this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
# SOFTWARE.

from ansys.aedt.core.application.analysis import Analysis
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.settings import settings


class AnalysisCircuitNetlist(Analysis, object):
class AnalysisCircuitNetlist(Analysis, PyAedtBase):
"""Provides the Circuit Netlist (CircuitNetlist) interface.

Circuit Netlist Editor has no setup, solution, analysis or postprocessor
Expand Down
3 changes: 2 additions & 1 deletion src/ansys/aedt/core/application/analysis_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler


class ScatteringMethods(object):
class ScatteringMethods(PyAedtBase):
"""Class containing all methods related to scattering matrix management that are common to Hfss, Circuit and
Hfss3dLayout classes.
"""
Expand Down
5 changes: 3 additions & 2 deletions src/ansys/aedt/core/application/analysis_icepak.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@

from ansys.aedt.core.application.analysis_3d import FieldAnalysis3D
from ansys.aedt.core.application.design import DesignSettingsManipulation
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.configurations import ConfigurationsIcepak
from ansys.aedt.core.generic.settings import settings
from ansys.aedt.core.modules.boundary.icepak_boundary import BoundaryDictionary


class FieldAnalysisIcepak(FieldAnalysis3D, object):
class FieldAnalysisIcepak(FieldAnalysis3D, PyAedtBase):
"""Manages Icepak field analysis setup.
This class is automatically initialized by an application call from one Icepak.
Expand Down Expand Up @@ -177,7 +178,7 @@ def monitor(self):
return self._monitor


class IcepakDesignSettingsManipulation(DesignSettingsManipulation):
class IcepakDesignSettingsManipulation(DesignSettingsManipulation, PyAedtBase):
"""Manages Icepak design settings.
This class provides methods to modify specific design settings like ambient temperature,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
# SOFTWARE.

from ansys.aedt.core.application.analysis import Analysis
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.settings import settings


class AnalysisMaxwellCircuit(Analysis):
class AnalysisMaxwellCircuit(Analysis, PyAedtBase):
"""Provides the Maxwell Circuit (MaxwellCircuit) interface.
Maxwell Circuit Editor has no setup, solution, analysis or postprocessor
Expand Down
3 changes: 2 additions & 1 deletion src/ansys/aedt/core/application/analysis_nexxim.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import warnings

from ansys.aedt.core.application.analysis import Analysis
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.configurations import ConfigurationsNexxim
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler
from ansys.aedt.core.generic.settings import settings
Expand All @@ -40,7 +41,7 @@
from ansys.aedt.core.modules.solve_setup import SetupCircuit


class FieldAnalysisCircuit(Analysis):
class FieldAnalysisCircuit(Analysis, PyAedtBase):
"""FieldCircuitAnalysis class.

This class is for circuit analysis setup in Nexxim.
Expand Down
3 changes: 2 additions & 1 deletion src/ansys/aedt/core/application/analysis_r_m_xprt.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
# SOFTWARE.

from ansys.aedt.core.application.analysis import Analysis
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler
from ansys.aedt.core.generic.settings import settings


class FieldAnalysisRMxprt(Analysis):
class FieldAnalysisRMxprt(Analysis, PyAedtBase):
"""Manages RMXprt field analysis setup. (To be implemented.)

This class is automatically initialized by an application call (like HFSS,
Expand Down
3 changes: 2 additions & 1 deletion src/ansys/aedt/core/application/analysis_twin_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
import warnings

from ansys.aedt.core.application.analysis import Analysis
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler
from ansys.aedt.core.generic.settings import settings
from ansys.aedt.core.modules.setup_templates import SetupKeys
from ansys.aedt.core.modules.solve_setup import SetupCircuit


class AnalysisTwinBuilder(Analysis):
class AnalysisTwinBuilder(Analysis, PyAedtBase):
"""Provides the Twin Builder Analysis Setup (TwinBuilder).

It is automatically initialized by Application call (Twin Builder).
Expand Down
7 changes: 4 additions & 3 deletions src/ansys/aedt/core/application/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
from ansys.aedt.core.application.design_solutions import solutions_defaults
from ansys.aedt.core.application.variables import DataSet
from ansys.aedt.core.application.variables import VariableManager
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.desktop import Desktop
from ansys.aedt.core.desktop import exception_to_desktop
from ansys.aedt.core.generic.constants import AEDT_UNITS
Expand Down Expand Up @@ -108,7 +109,7 @@ def load_aedt_thread(project_path) -> None:
inner_project_settings.time_stamp = Path(project_path).stat().st_mtime


class Design(AedtObjects):
class Design(AedtObjects, PyAedtBase):
"""Contains all functions and objects connected to the active project and design.

This class is inherited in the caller application and is accessible through it for
Expand Down Expand Up @@ -4323,7 +4324,7 @@ def __init_desktop_from_design(cls, *args, **kwargs):
return Desktop(*args, **kwargs)


class DesignSettings:
class DesignSettings(PyAedtBase):
"""Get design settings for the current AEDT app.

References
Expand Down Expand Up @@ -4384,7 +4385,7 @@ def available_properties(self) -> List[str]:
return [prop for prop in self.design_settings.GetPropNames() if not prop.endswith("/Choices")]


class DesignSettingsManipulation:
class DesignSettingsManipulation(PyAedtBase):
@abstractmethod
def execute(self, k: str, v: Any) -> Any:
pass
11 changes: 6 additions & 5 deletions src/ansys/aedt/core/application/design_solutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import copy

from ansys.aedt.core.aedt_logger import pyaedt_logger as logger
from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler

solutions_defaults = {
Expand Down Expand Up @@ -664,7 +665,7 @@
}


class DesignSolution(object):
class DesignSolution(PyAedtBase):
def __init__(self, odesign, design_type, aedt_version):
self._odesign = odesign
self._aedt_version = aedt_version
Expand Down Expand Up @@ -758,7 +759,7 @@ def intrinsics(self):
return []


class HFSSDesignSolution(DesignSolution, object):
class HFSSDesignSolution(DesignSolution, PyAedtBase):
def __init__(self, odesign, design_type, aedt_version):
DesignSolution.__init__(self, odesign, design_type, aedt_version)
self._composite = False
Expand Down Expand Up @@ -908,7 +909,7 @@ def set_auto_open(self, enable=True, opening_type="Radiation"):
return True


class Maxwell2DDesignSolution(DesignSolution, object):
class Maxwell2DDesignSolution(DesignSolution, PyAedtBase):
def __init__(self, odesign, design_type, aedt_version):
DesignSolution.__init__(self, odesign, design_type, aedt_version)
self._geometry_mode = "XY"
Expand Down Expand Up @@ -968,7 +969,7 @@ def solution_type(self, value):
logger.error("Failed to set solution type.")


class IcepakDesignSolution(DesignSolution, object):
class IcepakDesignSolution(DesignSolution, PyAedtBase):
def __init__(self, odesign, design_type, aedt_version):
DesignSolution.__init__(self, odesign, design_type, aedt_version)
self._problem_type = "TemperatureAndFlow"
Expand Down Expand Up @@ -1047,7 +1048,7 @@ def solution_type(self, solution_type):
logger.error("Failed to set solution type.")


class RmXprtDesignSolution(DesignSolution, object):
class RmXprtDesignSolution(DesignSolution, PyAedtBase):
def __init__(self, odesign, design_type, aedt_version):
DesignSolution.__init__(self, odesign, design_type, aedt_version)

Expand Down
9 changes: 5 additions & 4 deletions src/ansys/aedt/core/application/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import types
import warnings

from ansys.aedt.core.base import PyAedtBase
from ansys.aedt.core.generic.constants import AEDT_UNITS
from ansys.aedt.core.generic.constants import SI_UNITS
from ansys.aedt.core.generic.constants import _resolve_unit_system
Expand All @@ -57,7 +58,7 @@
from ansys.aedt.core.internal.errors import GrpcApiError


class CSVDataset:
class CSVDataset(PyAedtBase):
"""Reads in a CSV file and extracts data, which can be augmented with constant values.

Parameters
Expand Down Expand Up @@ -304,7 +305,7 @@ def generate_validation_errors(property_names, expected_settings, actual_setting
return validation_errors


class VariableManager(object):
class VariableManager(PyAedtBase):
"""Manages design properties and project variables.

Design properties are the local variables in a design. Project
Expand Down Expand Up @@ -1334,7 +1335,7 @@ def _get_var_list_from_aedt(self, desktop_object):
return var_list


class Variable(object):
class Variable(PyAedtBase):
"""Stores design properties and project variables and provides operations to perform on them.

Parameters
Expand Down Expand Up @@ -2099,7 +2100,7 @@ def __rtruediv__(self, other):
# return self.__rtruediv__(other)


class DataSet(object):
class DataSet(PyAedtBase):
"""Manages datasets.

Parameters
Expand Down
Loading