pyedb 0.18.0__py3-none-any.whl → 0.20.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyedb might be problematic. Click here for more details.

Files changed (54) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_data.py +8 -11
  3. pyedb/configuration/cfg_nets.py +14 -0
  4. pyedb/configuration/cfg_pin_groups.py +57 -20
  5. pyedb/configuration/cfg_ports_sources.py +248 -60
  6. pyedb/configuration/configuration.py +51 -17
  7. pyedb/dotnet/edb.py +156 -236
  8. pyedb/dotnet/edb_core/cell/connectable.py +64 -0
  9. pyedb/dotnet/edb_core/cell/hierarchy/component.py +12 -10
  10. pyedb/dotnet/edb_core/cell/hierarchy/hierarchy_obj.py +1 -1
  11. pyedb/dotnet/edb_core/cell/layout.py +271 -76
  12. pyedb/dotnet/edb_core/cell/layout_obj.py +4 -49
  13. pyedb/dotnet/edb_core/cell/primitive.py +14 -2
  14. pyedb/dotnet/edb_core/cell/terminal/padstack_instance_terminal.py +10 -0
  15. pyedb/dotnet/edb_core/cell/terminal/pingroup_terminal.py +5 -0
  16. pyedb/dotnet/edb_core/cell/terminal/point_terminal.py +1 -12
  17. pyedb/dotnet/edb_core/cell/terminal/terminal.py +36 -20
  18. pyedb/dotnet/edb_core/cell/voltage_regulator.py +2 -16
  19. pyedb/dotnet/edb_core/components.py +88 -31
  20. pyedb/dotnet/edb_core/dotnet/database.py +5 -10
  21. pyedb/dotnet/edb_core/dotnet/primitive.py +20 -7
  22. pyedb/dotnet/edb_core/edb_data/control_file.py +2 -12
  23. pyedb/dotnet/edb_core/edb_data/padstacks_data.py +28 -37
  24. pyedb/dotnet/edb_core/edb_data/ports.py +0 -18
  25. pyedb/dotnet/edb_core/edb_data/primitives_data.py +1 -1
  26. pyedb/dotnet/edb_core/general.py +6 -9
  27. pyedb/dotnet/edb_core/hfss.py +4 -8
  28. pyedb/dotnet/edb_core/layout_obj_instance.py +30 -0
  29. pyedb/dotnet/edb_core/materials.py +4 -11
  30. pyedb/dotnet/edb_core/{layout.py → modeler.py} +153 -7
  31. pyedb/dotnet/edb_core/net_class.py +7 -8
  32. pyedb/dotnet/edb_core/nets.py +3 -9
  33. pyedb/dotnet/edb_core/padstack.py +23 -10
  34. pyedb/dotnet/edb_core/sim_setup_data/data/sim_setup_info.py +42 -3
  35. pyedb/dotnet/edb_core/sim_setup_data/data/simulation_settings.py +92 -158
  36. pyedb/dotnet/edb_core/sim_setup_data/data/siw_dc_ir_settings.py +22 -22
  37. pyedb/dotnet/edb_core/sim_setup_data/data/sweep_data.py +5 -2
  38. pyedb/dotnet/edb_core/sim_setup_data/io/siwave.py +76 -76
  39. pyedb/dotnet/edb_core/siwave.py +5 -6
  40. pyedb/dotnet/edb_core/stackup.py +18 -23
  41. pyedb/dotnet/edb_core/utilities/hfss_simulation_setup.py +23 -94
  42. pyedb/dotnet/edb_core/utilities/simulation_setup.py +40 -41
  43. pyedb/dotnet/edb_core/utilities/siwave_simulation_setup.py +26 -17
  44. pyedb/generic/filesystem.py +2 -8
  45. pyedb/generic/general_methods.py +4 -10
  46. pyedb/generic/plot.py +26 -29
  47. pyedb/generic/process.py +2 -6
  48. pyedb/misc/downloads.py +3 -40
  49. pyedb/siwave.py +2 -5
  50. {pyedb-0.18.0.dist-info → pyedb-0.20.0.dist-info}/METADATA +8 -8
  51. {pyedb-0.18.0.dist-info → pyedb-0.20.0.dist-info}/RECORD +53 -52
  52. pyedb/dotnet/edb_core/dotnet/layout.py +0 -260
  53. {pyedb-0.18.0.dist-info → pyedb-0.20.0.dist-info}/LICENSE +0 -0
  54. {pyedb-0.18.0.dist-info → pyedb-0.20.0.dist-info}/WHEEL +0 -0
@@ -30,15 +30,12 @@ from __future__ import absolute_import # noreorder
30
30
  import logging
31
31
 
32
32
  from pyedb.dotnet.clr_module import Dictionary, List, Tuple
33
- from pyedb.generic.general_methods import is_ironpython
34
-
35
- if not is_ironpython: # pragma: no cover
36
- try:
37
- from enum import Enum
38
- except ImportError:
39
- Enum = None
40
- else: # pragma: no cover
41
- Enum = object
33
+
34
+ try:
35
+ from enum import Enum
36
+ except ImportError:
37
+ Enum = None
38
+
42
39
 
43
40
  logger = logging.getLogger(__name__)
44
41
 
@@ -36,7 +36,7 @@ from pyedb.dotnet.edb_core.general import (
36
36
  convert_pytuple_to_nettuple,
37
37
  )
38
38
  from pyedb.generic.constants import RadiationBoxType, SweepType
39
- from pyedb.generic.general_methods import generate_unique_name, is_ironpython
39
+ from pyedb.generic.general_methods import generate_unique_name
40
40
  from pyedb.modeler.geometry_operators import GeometryOperators
41
41
 
42
42
 
@@ -1258,13 +1258,9 @@ class EdbHfss(object):
1258
1258
  adapt.AdaptiveFrequency = simulation_setup.mesh_freq
1259
1259
  adapt.MaxPasses = int(simulation_setup.max_num_passes)
1260
1260
  adapt.MaxDelta = str(simulation_setup.max_mag_delta_s)
1261
- if is_ironpython:
1262
- simsetup_info.SimulationSettings.AdaptiveSettings.AdaptiveFrequencyDataList.Clear()
1263
- simsetup_info.SimulationSettings.AdaptiveSettings.AdaptiveFrequencyDataList.Add(adapt)
1264
- else:
1265
- simsetup_info.SimulationSettings.AdaptiveSettings.AdaptiveFrequencyDataList = (
1266
- convert_py_list_to_net_list([adapt])
1267
- )
1261
+ simsetup_info.SimulationSettings.AdaptiveSettings.AdaptiveFrequencyDataList = convert_py_list_to_net_list(
1262
+ [adapt]
1263
+ )
1268
1264
  elif simulation_setup.ac_settings.adaptive_type == 2:
1269
1265
  low_freq_adapt_data = self._pedb.simsetupdata.AdaptiveFrequencyData()
1270
1266
  low_freq_adapt_data.MaxDelta = str(simulation_setup.max_mag_delta_s)
@@ -0,0 +1,30 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ from pyedb.dotnet.edb_core.utilities.obj_base import ObjBase
24
+
25
+
26
+ class LayoutObjInstance(ObjBase):
27
+ """Manages EDB functionalities for the layout object instance."""
28
+
29
+ def __init__(self, pedb, edb_object):
30
+ super().__init__(pedb, edb_object)
@@ -32,10 +32,8 @@ import warnings
32
32
  from pydantic import BaseModel, confloat
33
33
 
34
34
  from pyedb import Edb
35
- from pyedb.dotnet.clr_module import _clr
36
35
  from pyedb.dotnet.edb_core.general import convert_py_list_to_net_list
37
36
  from pyedb.exceptions import MaterialModelException
38
- from pyedb.generic.general_methods import is_ironpython
39
37
 
40
38
  logger = logging.getLogger(__name__)
41
39
 
@@ -426,16 +424,11 @@ class Material(object):
426
424
 
427
425
  def __property_value(self, material_property_id):
428
426
  """Get property value from a material property id."""
429
- if is_ironpython: # pragma: no cover
430
- property_box = _clr.StrongBox[float]()
431
- self.__material_def.GetProperty(material_property_id, property_box)
432
- return float(property_box)
427
+ _, property_box = self.__material_def.GetProperty(material_property_id)
428
+ if isinstance(property_box, float):
429
+ return property_box
433
430
  else:
434
- _, property_box = self.__material_def.GetProperty(material_property_id)
435
- if isinstance(property_box, float):
436
- return property_box
437
- else:
438
- return property_box.ToDouble()
431
+ return property_box.ToDouble()
439
432
 
440
433
  # def __reset_property(self, name):
441
434
  # """Reset a property using the default value of the EDB API.
@@ -26,6 +26,7 @@ This module contains these classes: `EdbLayout` and `Shape`.
26
26
  import math
27
27
  import warnings
28
28
 
29
+ from pyedb.dotnet.edb_core.cell.primitive import Bondwire
29
30
  from pyedb.dotnet.edb_core.dotnet.primitive import (
30
31
  CircleDotNet,
31
32
  PathDotNet,
@@ -37,7 +38,7 @@ from pyedb.dotnet.edb_core.edb_data.utilities import EDBStatistics
37
38
  from pyedb.dotnet.edb_core.general import convert_py_list_to_net_list
38
39
 
39
40
 
40
- class EdbLayout(object):
41
+ class Modeler(object):
41
42
  """Manages EDB methods for primitives management accessible from `Edb.modeler` property.
42
43
 
43
44
  Examples
@@ -47,8 +48,31 @@ class EdbLayout(object):
47
48
  >>> edb_layout = edbapp.modeler
48
49
  """
49
50
 
51
+ def __getitem__(self, name):
52
+ """Get a layout instance from the Edb project.
53
+
54
+ Parameters
55
+ ----------
56
+ name : str, int
57
+
58
+ Returns
59
+ -------
60
+ :class:`pyedb.dotnet.edb_core.cell.hierarchy.component.EDBComponent`
61
+
62
+ """
63
+ for i in self.primitives:
64
+ if (
65
+ (isinstance(name, str) and i.aedt_name == name)
66
+ or (isinstance(name, str) and i.aedt_name == name.replace("__", "_"))
67
+ or (isinstance(name, int) and i.id == name)
68
+ ):
69
+ return i
70
+ self._pedb.logger.error("Primitive not found.")
71
+ return
72
+
50
73
  def __init__(self, p_edb):
51
74
  self._pedb = p_edb
75
+ self._primitives = []
52
76
 
53
77
  @property
54
78
  def _edb(self):
@@ -124,11 +148,13 @@ class EdbLayout(object):
124
148
  list of :class:`pyedb.dotnet.edb_core.edb_data.primitives_data.EDBPrimitives`
125
149
  List of primitives.
126
150
  """
127
- _prims = []
151
+ if len(self._primitives) == len(self._layout.primitives):
152
+ return self._primitives
153
+ self._primitives = []
128
154
  if self._active_layout:
129
155
  for lay_obj in self._layout.primitives:
130
- _prims.append(cast(lay_obj, self._pedb))
131
- return _prims
156
+ self._primitives.append(cast(lay_obj, self._pedb))
157
+ return self._primitives
132
158
 
133
159
  @property
134
160
  def polygons_by_layer(self):
@@ -643,7 +669,7 @@ class EdbLayout(object):
643
669
  new_points = self._edb.Geometry.PointData(pdata_0, pdata_1)
644
670
  polygonData.SetPoint(idx, new_points)
645
671
 
646
- elif isinstance(main_shape, EdbLayout.Shape):
672
+ elif isinstance(main_shape, Modeler.Shape):
647
673
  polygonData = self.shape_to_polygon_data(main_shape)
648
674
  else:
649
675
  polygonData = main_shape
@@ -654,7 +680,7 @@ class EdbLayout(object):
654
680
  if isinstance(void, list):
655
681
  void = self.Shape("polygon", points=void)
656
682
  voidPolygonData = self.shape_to_polygon_data(void)
657
- elif isinstance(void, EdbLayout.Shape):
683
+ elif isinstance(void, Modeler.Shape):
658
684
  voidPolygonData = self.shape_to_polygon_data(void)
659
685
  else:
660
686
  voidPolygonData = void
@@ -932,7 +958,7 @@ class EdbLayout(object):
932
958
 
933
959
  Parameters
934
960
  ----------
935
- shape : :class:`pyedb.dotnet.edb_core.layout.EdbLayout.Shape`
961
+ shape : :class:`pyedb.dotnet.edb_core.modeler.Modeler.Shape`
936
962
  Type of the shape to convert. Options are ``"rectangle"`` and ``"polygon"``.
937
963
  """
938
964
  if shape.type == "polygon":
@@ -1328,3 +1354,123 @@ class EdbLayout(object):
1328
1354
  stat_model.occupying_surface[layer] = surface
1329
1355
  stat_model.occupying_ratio[layer] = surface / outline_surface
1330
1356
  return stat_model
1357
+
1358
+ def create_bondwire(
1359
+ self,
1360
+ definition_name,
1361
+ placement_layer,
1362
+ width,
1363
+ material,
1364
+ start_layer_name,
1365
+ start_x,
1366
+ start_y,
1367
+ end_layer_name,
1368
+ end_x,
1369
+ end_y,
1370
+ net,
1371
+ bondwire_type="jedec4",
1372
+ ):
1373
+ """Create a bondwire object.
1374
+
1375
+ Parameters
1376
+ ----------
1377
+ bondwire_type : :class:`BondwireType`
1378
+ Type of bondwire: kAPDBondWire or kJDECBondWire types.
1379
+ definition_name : str
1380
+ Bondwire definition name.
1381
+ placement_layer : str
1382
+ Layer name this bondwire will be on.
1383
+ width : :class:`Value <ansys.edb.utility.Value>`
1384
+ Bondwire width.
1385
+ material : str
1386
+ Bondwire material name.
1387
+ start_layer_name : str
1388
+ Name of start layer.
1389
+ start_x : :class:`Value <ansys.edb.utility.Value>`
1390
+ X value of start point.
1391
+ start_y : :class:`Value <ansys.edb.utility.Value>`
1392
+ Y value of start point.
1393
+ end_layer_name : str
1394
+ Name of end layer.
1395
+ end_x : :class:`Value <ansys.edb.utility.Value>`
1396
+ X value of end point.
1397
+ end_y : :class:`Value <ansys.edb.utility.Value>`
1398
+ Y value of end point.
1399
+ net : str or :class:`Net <ansys.edb.net.Net>` or None
1400
+ Net of the Bondwire.
1401
+
1402
+ Returns
1403
+ -------
1404
+ :class:`pyedb.dotnet.edb_core.dotnet.primitive.BondwireDotNet`
1405
+ Bondwire object created.
1406
+ """
1407
+
1408
+ return Bondwire(
1409
+ pedb=self._pedb,
1410
+ bondwire_type=bondwire_type,
1411
+ definition_name=definition_name,
1412
+ placement_layer=placement_layer,
1413
+ width=self._pedb.edb_value(width),
1414
+ material=material,
1415
+ start_layer_name=start_layer_name,
1416
+ start_x=self._pedb.edb_value(start_x),
1417
+ start_y=self._pedb.edb_value(start_y),
1418
+ end_layer_name=end_layer_name,
1419
+ end_x=self._pedb.edb_value(end_x),
1420
+ end_y=self._pedb.edb_value(end_y),
1421
+ net=self._pedb.nets[net]._edb_object,
1422
+ )
1423
+
1424
+ def create_pin_group(
1425
+ self,
1426
+ name: str,
1427
+ pins_by_id: list[int] = None,
1428
+ pins_by_aedt_name: list[str] = None,
1429
+ pins_by_name: list[str] = None,
1430
+ ):
1431
+ """Create a PinGroup.
1432
+
1433
+ Parameters
1434
+ name : str,
1435
+ Name of the PinGroup.
1436
+ pins_by_id : list[int] or None
1437
+ List of pins by ID.
1438
+ pins_by_aedt_name : list[str] or None
1439
+ List of pins by AEDT name.
1440
+ pins_by_name : list[str] or None
1441
+ List of pins by name.
1442
+ """
1443
+ pins = {}
1444
+ if pins_by_id:
1445
+ for p in pins_by_id:
1446
+ edb_pin = self._pedb.layout.find_object_by_id(p)
1447
+ if edb_pin and not p in pins:
1448
+ pins[p] = edb_pin._edb_object
1449
+ if not pins_by_aedt_name:
1450
+ pins_by_aedt_name = []
1451
+ if not pins_by_name:
1452
+ pins_by_name = []
1453
+ if pins_by_aedt_name or pins_by_name:
1454
+ p_inst = self._pedb.layout.padstack_instances
1455
+ _pins = {
1456
+ pin.id: pin._edb_object
1457
+ for pin in p_inst
1458
+ if pin.aedt_name in pins_by_aedt_name or pin.name in pins_by_name
1459
+ }
1460
+ if not pins:
1461
+ pins = _pins
1462
+ else:
1463
+ for id, pin in _pins.items():
1464
+ if not id in pins:
1465
+ pins[id] = pin
1466
+ if not pins:
1467
+ self._logger.error("No pin found.")
1468
+ return False
1469
+ pins = list(pins.values())
1470
+ obj = self._edb.cell.hierarchy.pin_group.Create(
1471
+ self._pedb.active_layout, name, convert_py_list_to_net_list(pins)
1472
+ )
1473
+ if obj.IsNull():
1474
+ self._logger.debug("Pin group creation returned Null obj.")
1475
+ return False
1476
+ return self._pedb.siwave.pin_groups[name]
@@ -41,7 +41,6 @@ class EdbCommon:
41
41
 
42
42
  Returns
43
43
  -------
44
- :class:` :class:`pyedb.dotnet.edb_core.dotnet.layout.LayoutDotNet`
45
44
  """
46
45
  return self._pedb.layout
47
46
 
@@ -90,10 +89,10 @@ class EdbNetClasses(EdbCommon, object):
90
89
  dict[str, :class:`pyedb.dotnet.edb_core.edb_data.nets_data.EDBDifferentialPairData`]
91
90
  Dictionary of extended nets.
92
91
  """
93
- net_classes = {}
94
- for net_class in self._layout.net_classes:
95
- net_classes[net_class.GetName()] = EDBNetClassData(self._pedb, net_class)
96
- return net_classes
92
+ temp = {}
93
+ for i in self._layout.net_classes:
94
+ temp[i.name] = i
95
+ return temp
97
96
 
98
97
  def create(self, name, net):
99
98
  # type: (str, str|list)->EDBNetClassData
@@ -147,8 +146,8 @@ class EdbExtendedNets(EdbCommon, object):
147
146
  Dictionary of extended nets.
148
147
  """
149
148
  nets = {}
150
- for extended_net in self._layout.extended_nets:
151
- nets[extended_net.GetName()] = EDBExtendedNetData(self._pedb, extended_net)
149
+ for extended_net in self._pedb.layout.extended_nets:
150
+ nets[extended_net.name] = extended_net
152
151
  return nets
153
152
 
154
153
  def create(self, name, net):
@@ -273,7 +272,7 @@ class EdbDifferentialPairs(EdbCommon, object):
273
272
  """
274
273
  diff_pairs = {}
275
274
  for diff_pair in self._layout.differential_pairs:
276
- diff_pairs[diff_pair.GetName()] = EDBDifferentialPairData(self._pedb, diff_pair)
275
+ diff_pairs[diff_pair.name] = diff_pair
277
276
  return diff_pairs
278
277
 
279
278
  def create(self, name, net_p, net_n):
@@ -29,7 +29,7 @@ import warnings
29
29
 
30
30
  from pyedb.dotnet.edb_core.edb_data.nets_data import EDBNetsData
31
31
  from pyedb.generic.constants import CSS4_COLORS
32
- from pyedb.generic.general_methods import generate_unique_name, is_ironpython
32
+ from pyedb.generic.general_methods import generate_unique_name
33
33
  from pyedb.modeler.geometry_operators import GeometryOperators
34
34
 
35
35
 
@@ -55,10 +55,7 @@ class EdbNets(object):
55
55
  :class:` :class:`pyedb.dotnet.edb_core.edb_data.nets_data.EDBNetsData`
56
56
 
57
57
  """
58
- if name in self.nets:
59
- return self.nets[name]
60
- self._pedb.logger.error("Component or definition not found.")
61
- return
58
+ return self._pedb.layout.find_net_by_name(name)
62
59
 
63
60
  def __contains__(self, name):
64
61
  """Determine if a net is named ``name`` or not.
@@ -119,7 +116,7 @@ class EdbNets(object):
119
116
  dict[str, :class:`pyedb.dotnet.edb_core.edb_data.nets_data.EDBNetsData`]
120
117
  Dictionary of nets.
121
118
  """
122
- return self._pedb.modeler.nets
119
+ return {i.name: i for i in self._pedb.layout.nets}
123
120
 
124
121
  @property
125
122
  def netlist(self):
@@ -841,9 +838,6 @@ class EdbNets(object):
841
838
  show : bool, optional
842
839
  Whether to show the plot or not. Default is `True`.
843
840
  """
844
- if is_ironpython:
845
- self._logger.warning("Plot functionalities are enabled only in CPython.")
846
- return False
847
841
  from pyedb.generic.plot import plot_matplotlib
848
842
 
849
843
  object_lists = self.get_plot_data(
@@ -61,8 +61,8 @@ class EdbPadstacks(object):
61
61
  :class:`pyedb.dotnet.edb_core.cell.hierarchy.component.EDBComponent`
62
62
 
63
63
  """
64
- if name in self.instances:
65
- return self.instances[name]
64
+ if isinstance(name, int) and name in self.instances:
65
+ return self._pedb.layout.find_object_by_id(name)
66
66
  elif name in self.definitions:
67
67
  return self.definitions[name]
68
68
  else:
@@ -74,6 +74,8 @@ class EdbPadstacks(object):
74
74
 
75
75
  def __init__(self, p_edb):
76
76
  self._pedb = p_edb
77
+ self._instances = {}
78
+ self._definitions = {}
77
79
 
78
80
  @property
79
81
  def _edb(self):
@@ -183,12 +185,14 @@ class EdbPadstacks(object):
183
185
  List of definitions via padstack definitions.
184
186
 
185
187
  """
186
- _padstacks = {}
188
+ if len(self._definitions) == len(self._pedb.padstack_defs):
189
+ return self._definitions
190
+ self._definitions = {}
187
191
  for padstackdef in self._pedb.padstack_defs:
188
192
  PadStackData = padstackdef.GetData()
189
193
  if len(PadStackData.GetLayerNames()) >= 1:
190
- _padstacks[padstackdef.GetName()] = EDBPadstack(padstackdef, self)
191
- return _padstacks
194
+ self._definitions[padstackdef.GetName()] = EDBPadstack(padstackdef, self)
195
+ return self._definitions
192
196
 
193
197
  @property
194
198
  def padstacks(self):
@@ -217,11 +221,11 @@ class EdbPadstacks(object):
217
221
 
218
222
  """
219
223
 
220
- padstack_instances = {}
221
224
  edb_padstack_inst_list = self._pedb.layout.padstack_instances
222
- for edb_padstack_instance in edb_padstack_inst_list:
223
- padstack_instances[edb_padstack_instance.GetId()] = EDBPadstackInstance(edb_padstack_instance, self._pedb)
224
- return padstack_instances
225
+ if len(self._instances) == len(edb_padstack_inst_list):
226
+ return self._instances
227
+ self._instances = {i.id: i for i in edb_padstack_inst_list}
228
+ return self._instances
225
229
 
226
230
  @property
227
231
  def instances_by_name(self):
@@ -241,6 +245,15 @@ class EdbPadstacks(object):
241
245
  )
242
246
  return padstack_instances
243
247
 
248
+ def find_instance_by_id(self, value: int):
249
+ """Find a padstack instance by database id.
250
+
251
+ Parameters
252
+ ----------
253
+ value : int
254
+ """
255
+ return self._pedb.modeler.find_object_by_id(value)
256
+
244
257
  @property
245
258
  def pins(self):
246
259
  """Dictionary of all pins instances (belonging to component).
@@ -1441,7 +1454,7 @@ class EdbPadstacks(object):
1441
1454
  instances = [inst for inst in instances if inst.component.refdes in refdes]
1442
1455
  if component_pin:
1443
1456
  component_pin = component_pin if isinstance(component_pin, list) else [component_pin]
1444
- instances = [inst for inst in instances if inst.pin_number in component_pin]
1457
+ instances = [inst for inst in instances if inst.component_pin in component_pin]
1445
1458
  return instances
1446
1459
 
1447
1460
  def get_padstack_instance_by_net_name(self, net_name):
@@ -20,6 +20,9 @@
20
20
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  # SOFTWARE.
22
22
 
23
+ from pyedb.dotnet.edb_core.sim_setup_data.data.simulation_settings import ( # HFSSSimulationSettings
24
+ HFSSPISimulationSettings,
25
+ )
23
26
  from pyedb.dotnet.edb_core.sim_setup_data.data.sweep_data import SweepData
24
27
 
25
28
 
@@ -58,17 +61,53 @@ class SimSetupInfo:
58
61
  else:
59
62
  self._edb_object = edb_object
60
63
 
64
+ @property
65
+ def name(self):
66
+ return self._edb_object.Name
67
+
68
+ @name.setter
69
+ def name(self, name):
70
+ self._edb_object.Name = name
71
+
61
72
  @property
62
73
  def position(self):
63
74
  return self._edb_object.Position
64
75
 
65
76
  @property
66
77
  def sim_setup_type(self):
67
- return self._edb_object.SimSetupType
78
+ """
79
+ "kHFSS": self._pedb.simsetupdata.HFSSSimulationSettings,
80
+ "kPEM": None,
81
+ "kSIwave": self._pedb.simsetupdata.SIwave.SIWSimulationSettings,
82
+ "kLNA": None,
83
+ "kTransient": None,
84
+ "kQEye": None,
85
+ "kVEye": None,
86
+ "kAMI": None,
87
+ "kAnalysisOption": None,
88
+ "kSIwaveDCIR": self._pedb.simsetupdata.SIwave.SIWDCIRSimulationSettings,
89
+ "kSIwaveEMI": None,
90
+ "kHFSSPI": self._pedb.simsetupdata.HFSSPISimulationSettings,
91
+ "kDDRwizard": None,
92
+ "kQ3D": None,
93
+ "kNumSetupTypes": None,
94
+ """
95
+
96
+ return self._edb_object.SimSetupType.ToString()
68
97
 
69
98
  @property
70
99
  def simulation_settings(self):
71
- return self._edb_object.SimulationSettings
100
+ if self.sim_setup_type == "kHFSS":
101
+ return self._edb_object.SimulationSettings
102
+ # todo refactor HFSS
103
+ # return HFSSSimulationSettings(self._pedb, self.sim_setup, self._edb_object.SimulationSettings)
104
+ elif self.sim_setup_type == "kHFSSPI":
105
+ return HFSSPISimulationSettings(self._pedb, self.sim_setup, self._edb_object.SimulationSettings)
106
+ elif self.sim_setup_type == "kSIwave": # todo refactor
107
+ return self._edb_object.SimulationSettings
108
+
109
+ elif self.sim_setup_type == "kSIwaveDCIR": # todo refactor
110
+ return self._edb_object.SimulationSettings
72
111
 
73
112
  @property
74
113
  def sweep_data_list(self):
@@ -77,5 +116,5 @@ class SimSetupInfo:
77
116
  ]
78
117
 
79
118
  def add_sweep_data(self, sweep_data):
80
- sweep_data.sim_setup = self.sim_setup
119
+ sweep_data._sim_setup = self.sim_setup
81
120
  self._edb_object.SweepDataList.Add(sweep_data._edb_object)