Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenb-dev committed Jan 14, 2025
2 parents fe693db + 0fc5296 commit dea5354
Show file tree
Hide file tree
Showing 10 changed files with 147 additions and 120 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ concurrency:

jobs:

check_title:
pr-title:
if: github.event_name == 'pull_request'
name: Check the title of the pull request
runs-on: ubuntu-latest
steps:
- name: Check commit name
uses: ansys/actions/commit-style@v6
- name: Check the title of the pull request
uses: ansys/actions/check-pr-title@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
use-upper-case: true
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
name: Test dotnet (linux)
runs-on: [ Linux, self-hosted, toolkits ]
env:
ANSYSEM_ROOT242: '/ansys_inc/AnsysEM/v242/Linux64'
ANSYSEM_ROOT242: '/opt/AnsysEM/v242/Linux64'
ANS_NODEPCHECK: '1'
steps:
- name: "Install Git and clone project"
Expand All @@ -153,7 +153,7 @@ jobs:
- name: "Install os packages"
run: |
sudo apt update
sudo apt install libgl1-mesa-glx xvfb
sudo apt install libgl1-mesa-glx xvfb -y
- name: Create Python venv
run: |
Expand All @@ -174,8 +174,9 @@ jobs:
with:
max_attempts: 3
retry_on: error
timeout_minutes: 20
timeout_minutes: 40
command: |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
. .venv/bin/activate
xvfb-run pytest -m "legacy" -n auto --dist loadfile -v --cov
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ tests = [
doc = [
"ansys-sphinx-theme>=0.10.0,<1.1",
"imageio>=2.30.0,<2.37",
"ipython>=8.13.0,<8.31",
"ipython>=8.13.0,<8.32",
"jupyterlab>=4.0.0,<4.4",
"jupytext>=1.16.0,<1.17",
"matplotlib>=3.5.0,<3.10",
Expand Down
15 changes: 7 additions & 8 deletions src/pyedb/configuration/cfg_pin_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,16 @@ def __init__(self, pedb, **kwargs):
def create(self):
"""Apply pin group on layout."""
if self.pins:
self._pedb.siwave.create_pin_group(self.reference_designator, list(self.pins), self.name)
pins = self.pins if isinstance(self.pins, list) else [self.pins]
self._pedb.siwave.create_pin_group(self.reference_designator, pins, self.name)
elif self.net:
if self.reference_designator in self._pedb.components.instances:
comp = self._pedb.components.instances[self.reference_designator]
else:
raise Exception(f"Component not found for creating pin group {self.name}.")
pins = [p for p, obj in comp.pins.items() if obj.net_name in self.net]
nets = self.net if isinstance(self.net, list) else [self.net]
comp = self._pedb.components.instances[self.reference_designator]
pins = [p for p, obj in comp.pins.items() if obj.net_name in nets]
if not self._pedb.siwave.create_pin_group(self.reference_designator, pins, self.name):
self._pedb.logger.error(f"Failed to create pin group {self.name}")
raise RuntimeError(f"Failed to create pin group {self.name}")
else:
self._pedb.logger.error(f"No net and pins defined for defining pin group {self.name}")
raise RuntimeError(f"No net and pins defined for defining pin group {self.name}")

def export_properties(self):
if self.pins:
Expand Down
17 changes: 9 additions & 8 deletions src/pyedb/dotnet/edb_core/cell/terminal/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ def hfss_type(self, value):
@property
def layer(self):
"""Get layer of the terminal."""
point_data = self._pedb.point_data(0, 0)
layer = list(self._pedb.stackup.layers.values())[0]._edb_layer
if self._edb_object.GetParameters(point_data, layer):
try:
_, _, layer = self._edb_object.GetParameters()
return self._pedb.stackup.all_layers[layer.GetName()]
else:
self._pedb.logger.warning(f"No pad parameters found for terminal {self.name}")
except:
self._pedb.logger.error("Cannot determine terminal layer")

@layer.setter
def layer(self, value):
Expand All @@ -121,9 +120,11 @@ def layer(self, value):
@property
def location(self):
"""Location of the terminal."""
layer = list(self._pedb.stackup.layers.values())[0]._edb_layer
_, point_data, _ = self._edb_object.GetParameters(None, layer)
return [point_data.X.ToDouble(), point_data.Y.ToDouble()]
try:
_, point_data, _ = self._edb_object.GetParameters()
return [point_data.X.ToDouble(), point_data.Y.ToDouble()]
except:
self._pedb.logger.error("Cannot determine terminal location")

@location.setter
def location(self, value):
Expand Down
66 changes: 21 additions & 45 deletions src/pyedb/dotnet/edb_core/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,9 @@ def __getitem__(self, name):

def __init__(self, p_edb):
self._pedb = p_edb
self._cmp = {}
self._res = {}
self._cap = {}
self._ind = {}
self._ios = {}
self._ics = {}
self._others = {}
self.refresh_components()
self._pins = {}
self._comps_by_part = {}
self._init_parts()
self._padstack = EdbPadstacks(self._pedb)

@property
Expand All @@ -132,16 +125,6 @@ def _logger(self):
def _edb(self):
return self._pedb.edb_api

def _init_parts(self):
a = self.instances
a = self.resistors
a = self.ICs
a = self.Others
a = self.inductors
a = self.IOs
a = self.components_by_partname
return True

def _get_edb_value(self, value):
return self._pedb.edb_value(value)

Expand Down Expand Up @@ -205,8 +188,6 @@ def instances(self):
>>> edbapp.components.instances
"""
if not self._cmp:
self.refresh_components()
return self._cmp

@property
Expand Down Expand Up @@ -310,10 +291,29 @@ def export_definition(self, file_path):

def refresh_components(self):
"""Refresh the component dictionary."""
# self._logger.info("Refreshing the Components dictionary.")
self._cmp = {}
self._res = {}
self._ind = {}
self._cap = {}
self._ics = {}
self._ios = {}
self._others = {}
for i in self._pedb.layout.groups:
self._cmp[i.name] = i
if i.type == "Resistor":
self._res[i.name] = i
elif i.type == "Capacitor":
self._cap[i.name] = i
elif i.type == "Inductor":
self._ind[i.name] = i
elif i.type == "IC":
self._ics[i.name] = i
elif i.type == "IO":
self._ios[i.name] = i
elif i.type == "Other":
self._others[i.name] = i
else:
self._logger.warning(f"Unknown component type {i.name} found while refreshing components, will ignore")
return True

@property
Expand All @@ -332,10 +332,6 @@ def resistors(self):
>>> edbapp = Edb("myaedbfolder")
>>> edbapp.components.resistors
"""
self._res = {}
for el, val in self.instances.items():
if val.type == "Resistor":
self._res[el] = val
return self._res

@property
Expand All @@ -354,10 +350,6 @@ def capacitors(self):
>>> edbapp = Edb("myaedbfolder")
>>> edbapp.components.capacitors
"""
self._cap = {}
for el, val in self.instances.items():
if val.type == "Capacitor":
self._cap[el] = val
return self._cap

@property
Expand All @@ -377,10 +369,6 @@ def inductors(self):
>>> edbapp.components.inductors
"""
self._ind = {}
for el, val in self.instances.items():
if val.type == "Inductor":
self._ind[el] = val
return self._ind

@property
Expand All @@ -400,10 +388,6 @@ def ICs(self):
>>> edbapp.components.ICs
"""
self._ics = {}
for el, val in self.instances.items():
if val.type == "IC":
self._ics[el] = val
return self._ics

@property
Expand All @@ -423,10 +407,6 @@ def IOs(self):
>>> edbapp.components.IOs
"""
self._ios = {}
for el, val in self.instances.items():
if val.type == "IO":
self._ios[el] = val
return self._ios

@property
Expand All @@ -446,10 +426,6 @@ def Others(self):
>>> edbapp.components.others
"""
self._others = {}
for el, val in self.instances.items():
if val.type == "Other":
self._others[el] = val
return self._others

@property
Expand Down
Loading

0 comments on commit dea5354

Please sign in to comment.