Skip to content

Commit

Permalink
FIX: version check (#515)
Browse files Browse the repository at this point in the history
* FIX: bug in uniitest

* MISC: Auto fixes from pre-commit.com hooks

For more information, see https://pre-commit.ci

* FIX: bug in uniitest

* FIX: bug in uniitest

---------

Co-authored-by: ring630 <@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
hui-zhou-a and pre-commit-ci[bot] authored May 27, 2024
1 parent 832a538 commit 06d4464
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
6 changes: 2 additions & 4 deletions src/pyedb/dotnet/edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3702,12 +3702,10 @@ def create_hfsspi_setup(self, name=None):
self.logger.error("Setup name already used in the layout")
return False
version = self.edbversion.split(".")
if int(version[0]) == 2024 and int(version[-1]) >= 2 or int(version[0]) > 2024:
setup = HFSSPISimulationSetup(self).create(name)
return setup
else:
if float(self.edbversion) < 2024.2:
self.logger.error("HFSSPI simulation only supported with Ansys release 2024R2 and higher")
return False
return HFSSPISimulationSetup(self).create(name)

@pyedb_function_handler()
def create_siwave_syz_setup(self, name=None):
Expand Down
11 changes: 5 additions & 6 deletions src/pyedb/dotnet/edb_core/edb_data/hfss_simulation_setup_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,19 +977,18 @@ def via_mesh_plating(self):
-------
bool
"""
if self._parent._pedb.version[0] >= 10:
return self._via_settings.ViaMeshPlating
else:
if float(self._parent._pedb.edbversion) < 2024.1:
self._parent._pedb.logger.error("Property only supported on Ansys release 2024R1 and later")
return False
return self._via_settings.ViaMeshPlating

@via_mesh_plating.setter
def via_mesh_plating(self, value):
if self._parent._pedb.version[0] >= 10:
if float(self._parent._pedb.edbversion) < 2024.1:
self._parent._pedb.logger.error("Property only supported on Ansys release 2024R1 and later")
else:
self._via_settings.ViaMeshPlating = value
self._parent._update_setup()
else:
self._parent._pedb.logger.error("Property only supported on Ansys release 2024R1 and later")

@property
def via_material(self):
Expand Down
3 changes: 2 additions & 1 deletion src/pyedb/dotnet/edb_core/utilities/simulation_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class BaseSimulationSetup(object):
EDB object.
"""

@pyedb_function_handler
def __init__(self, pedb, edb_setup=None):
self._pedb = pedb
self._edb_object = edb_setup
Expand All @@ -59,7 +60,7 @@ def __init__(self, pedb, edb_setup=None):
}

version = self._pedb.edbversion.split(".")
if int(version[0]) == 2024 and int(version[1]) == 2 or int(version[0]) > 2024:
if float(self._pedb.edbversion) >= 2024.2:
self._setup_type_mapping.update(
{
"kRaptorX": self._pedb.simsetupdata.RaptorX.RaptorXSimulationSettings,
Expand Down
4 changes: 2 additions & 2 deletions tests/legacy/system/test_edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,15 +912,15 @@ def test_hfss_simulation_setup(self):

via_settings = setup1.via_settings
via_settings.via_density = 1
if edbapp.version[0] >= 10:
if float(edbapp.edbversion) >= 2024.1:
via_settings.via_mesh_plating = True
via_settings.via_material = "pec"
via_settings.via_num_sides = 8
via_settings.via_style = "kNum25DViaStyle"

via_settings = edbapp.setups["setup1"].via_settings
assert via_settings.via_density == 1
if edbapp.version[0] >= 10:
if float(edbapp.edbversion) >= 2024.1:
assert via_settings.via_mesh_plating
assert via_settings.via_material == "pec"
assert via_settings.via_num_sides == 8
Expand Down

0 comments on commit 06d4464

Please sign in to comment.