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

REFACTOR: Analysis init refactoring #5825

Closed
wants to merge 6 commits into from
Closed
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
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def custom_show_warning(message, category, filename, lineno, file=None, line=Non
#

pyaedt_path = os.path.dirname(__file__)
__version__ = "0.15.dev0"
__version__ = "0.16.dev0"
version = __version__

# isort: off
Expand Down
23 changes: 13 additions & 10 deletions src/ansys/aedt/core/application/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,16 @@
ic_mode,
remove_lock,
)
self._excitation_objects = {}
self._excitation_objects = None

Check warning on line 156 in src/ansys/aedt/core/application/analysis.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis.py#L156

Added line #L156 was not covered by tests
self._setup = None
if setup_name:
self.active_setup = setup_name
self._materials = None
self._available_variations = None
self._setups = []
self._parametrics = []
self._optimizations = []
self._native_components = []
self._setups = None
self._parametrics = None
self._optimizations = None
self._native_components = None

Check warning on line 165 in src/ansys/aedt/core/application/analysis.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis.py#L162-L165

Added lines #L162 - L165 were not covered by tests
self.SOLUTIONS = SOLUTIONS()
self.SETUPS = SETUPS()
self.AXIS = AXIS()
Expand All @@ -185,7 +185,7 @@
-------
dict[str, :class:`ansys.aedt.core.modules.Boundaries.NativeComponentObject`]
"""
if not self._native_components:
if self._native_components is None:

Check warning on line 188 in src/ansys/aedt/core/application/analysis.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis.py#L188

Added line #L188 was not covered by tests
self._native_components = self._get_native_data()
return {nc.name: nc for nc in self._native_components}

Expand Down Expand Up @@ -244,7 +244,7 @@
Setups in the project.

"""
if not self._setups:
if self._setups is None:

Check warning on line 247 in src/ansys/aedt/core/application/analysis.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis.py#L247

Added line #L247 was not covered by tests
if self.design_type not in ["Maxwell Circuit", "Circuit Netlist"]:
self._setups = [self.get_setup(setup_name) for setup_name in self.setup_names]
return self._setups
Expand All @@ -259,7 +259,7 @@
Parametric setups in the project.

"""
if not self._parametrics:
if self._parametrics is None:

Check warning on line 262 in src/ansys/aedt/core/application/analysis.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis.py#L262

Added line #L262 was not covered by tests
self._parametrics = ParametricSetups(self)
return self._parametrics

Expand All @@ -273,7 +273,7 @@
Parametric setups in the project.

"""
if not self._optimizations:
if self._optimizations is None:

Check warning on line 276 in src/ansys/aedt/core/application/analysis.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis.py#L276

Added line #L276 was not covered by tests
self._optimizations = OptimizationSetups(self)
return self._optimizations

Expand Down Expand Up @@ -318,7 +318,7 @@
----------
>>> oModule.GetAllSolutionSetups()
"""
if self._setup:
if self._setup is not None:

Check warning on line 321 in src/ansys/aedt/core/application/analysis.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis.py#L321

Added line #L321 was not covered by tests
return self._setup
elif self.existing_analysis_setups:
return self.existing_analysis_setups[0]
Expand Down Expand Up @@ -529,6 +529,9 @@
----------
>>> oModule.GetExcitations
"""
if self._excitation_objects is None:
self._excitation_objects = {}

Check warning on line 533 in src/ansys/aedt/core/application/analysis.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis.py#L532-L533

Added lines #L532 - L533 were not covered by tests

exc_names = self.excitations[::]

for el in self.boundaries:
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/analysis_3d_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
"""
if setup_type is None:
setup_type = self.design_solutions.default_setup
for setup in self._setups:
for setup in self.setups:

Check warning on line 354 in src/ansys/aedt/core/application/analysis_3d_layout.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/application/analysis_3d_layout.py#L354

Added line #L354 was not covered by tests
if name == setup.name:
return setup
setup = Setup3DLayout(self, setup_type, name, is_new_setup=False)
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/modules/solve_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3946,7 +3946,7 @@ class SetupQ3D(Setup, object):

Parameters
----------
app : :class:`ansys.aedt.core.application.analysis_3d.FieldAnalysis3D`
app : :class:`ansys.aedt.core.application.analysis.Analysis`
Inherited app object.
solution_type : int, str
Type of the setup.
Expand Down
2 changes: 1 addition & 1 deletion tests/system/general/test_01_3dlayout_edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def test_03_get_pins(self, aedtapp):
assert pins["L10-1"].object_units == "mm"
assert pins["L10-1"].componentname == "L10"
assert pins["L10-1"].is_pin
assert pins["L10-1"].angle == "90deg" or pins["L10-1"].angle == "-270deg"
assert pins["L10-1"].angle == "0deg"
assert pins["L10-1"].location[0] != 0
assert pins["L10-1"].start_layer == "1_Top"
assert pins["L10-1"].stop_layer == "1_Top"
Expand Down
Loading