pyedb 0.54.0__py3-none-any.whl → 0.56.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 (105) hide show
  1. pyedb/__init__.py +1 -8
  2. pyedb/configuration/cfg_boundaries.py +69 -151
  3. pyedb/configuration/cfg_components.py +201 -460
  4. pyedb/configuration/cfg_data.py +4 -2
  5. pyedb/configuration/cfg_general.py +13 -36
  6. pyedb/configuration/cfg_modeler.py +2 -1
  7. pyedb/configuration/cfg_nets.py +21 -35
  8. pyedb/configuration/cfg_operations.py +22 -151
  9. pyedb/configuration/cfg_package_definition.py +56 -112
  10. pyedb/configuration/cfg_padstacks.py +292 -688
  11. pyedb/configuration/cfg_pin_groups.py +32 -79
  12. pyedb/configuration/cfg_ports_sources.py +19 -6
  13. pyedb/configuration/cfg_s_parameter_models.py +67 -172
  14. pyedb/configuration/cfg_setup.py +102 -295
  15. pyedb/configuration/configuration.py +64 -5
  16. pyedb/dotnet/database/Variables.py +26 -19
  17. pyedb/dotnet/database/cell/connectable.py +38 -9
  18. pyedb/dotnet/database/cell/hierarchy/component.py +28 -28
  19. pyedb/dotnet/database/cell/hierarchy/model.py +1 -1
  20. pyedb/dotnet/database/cell/layout.py +63 -2
  21. pyedb/dotnet/database/cell/layout_obj.py +2 -2
  22. pyedb/dotnet/database/cell/primitive/path.py +6 -8
  23. pyedb/dotnet/database/cell/primitive/primitive.py +3 -24
  24. pyedb/dotnet/database/cell/terminal/edge_terminal.py +2 -2
  25. pyedb/dotnet/database/cell/terminal/padstack_instance_terminal.py +1 -1
  26. pyedb/dotnet/database/cell/terminal/pingroup_terminal.py +1 -1
  27. pyedb/dotnet/database/cell/terminal/point_terminal.py +1 -1
  28. pyedb/dotnet/database/cell/terminal/terminal.py +24 -24
  29. pyedb/dotnet/database/cell/voltage_regulator.py +0 -21
  30. pyedb/dotnet/database/components.py +137 -124
  31. pyedb/dotnet/database/definition/component_def.py +4 -4
  32. pyedb/dotnet/database/definition/component_model.py +1 -1
  33. pyedb/dotnet/database/definition/package_def.py +2 -3
  34. pyedb/dotnet/database/dotnet/database.py +3 -199
  35. pyedb/dotnet/database/dotnet/primitive.py +3 -3
  36. pyedb/dotnet/database/edb_data/control_file.py +5 -5
  37. pyedb/dotnet/database/edb_data/hfss_extent_info.py +6 -6
  38. pyedb/dotnet/database/edb_data/layer_data.py +23 -23
  39. pyedb/dotnet/database/edb_data/padstacks_data.py +63 -88
  40. pyedb/dotnet/database/edb_data/primitives_data.py +5 -5
  41. pyedb/dotnet/database/edb_data/sources.py +6 -6
  42. pyedb/dotnet/database/edb_data/variables.py +1 -1
  43. pyedb/dotnet/database/geometry/point_data.py +14 -10
  44. pyedb/dotnet/database/geometry/polygon_data.py +3 -3
  45. pyedb/dotnet/database/hfss.py +46 -48
  46. pyedb/dotnet/database/layout_validation.py +14 -11
  47. pyedb/dotnet/database/materials.py +10 -11
  48. pyedb/dotnet/database/modeler.py +97 -91
  49. pyedb/dotnet/database/nets.py +19 -22
  50. pyedb/dotnet/database/padstack.py +171 -83
  51. pyedb/dotnet/database/siwave.py +42 -42
  52. pyedb/dotnet/database/stackup.py +140 -72
  53. pyedb/dotnet/database/utilities/heatsink.py +4 -4
  54. pyedb/dotnet/database/utilities/obj_base.py +2 -2
  55. pyedb/dotnet/database/utilities/simulation_setup.py +2 -2
  56. pyedb/dotnet/database/utilities/value.py +16 -16
  57. pyedb/dotnet/edb.py +230 -152
  58. pyedb/edb_logger.py +12 -27
  59. pyedb/extensions/create_cell_array.py +394 -0
  60. pyedb/extensions/via_design_backend.py +6 -3
  61. pyedb/generic/data_handlers.py +6 -7
  62. pyedb/generic/design_types.py +81 -30
  63. pyedb/generic/filesystem.py +5 -2
  64. pyedb/generic/general_methods.py +2 -122
  65. pyedb/generic/process.py +44 -108
  66. pyedb/generic/settings.py +79 -19
  67. pyedb/grpc/database/components.py +26 -4
  68. pyedb/grpc/database/control_file.py +5 -5
  69. pyedb/grpc/database/definition/materials.py +1 -1
  70. pyedb/grpc/database/definition/package_def.py +3 -3
  71. pyedb/grpc/database/definition/padstack_def.py +53 -0
  72. pyedb/grpc/database/geometry/polygon_data.py +1 -1
  73. pyedb/grpc/database/layout/layout.py +81 -5
  74. pyedb/grpc/database/layout_validation.py +5 -5
  75. pyedb/grpc/database/modeler.py +24 -16
  76. pyedb/grpc/database/net/net.py +15 -14
  77. pyedb/grpc/database/nets.py +70 -0
  78. pyedb/grpc/database/padstacks.py +122 -17
  79. pyedb/grpc/database/primitive/padstack_instance.py +175 -7
  80. pyedb/grpc/database/primitive/polygon.py +2 -2
  81. pyedb/grpc/database/simulation_setup/siwave_cpa_simulation_setup.py +3 -2
  82. pyedb/grpc/database/siwave.py +1 -1
  83. pyedb/grpc/database/source_excitations.py +12 -5
  84. pyedb/grpc/database/stackup.py +1 -1
  85. pyedb/grpc/database/terminal/bundle_terminal.py +1 -1
  86. pyedb/grpc/database/terminal/padstack_instance_terminal.py +1 -1
  87. pyedb/grpc/database/terminal/pingroup_terminal.py +1 -1
  88. pyedb/grpc/database/utility/value.py +1 -0
  89. pyedb/grpc/database/utility/xml_control_file.py +5 -5
  90. pyedb/grpc/edb.py +80 -30
  91. pyedb/grpc/edb_init.py +3 -3
  92. pyedb/grpc/rpc_session.py +14 -13
  93. pyedb/libraries/common.py +366 -0
  94. pyedb/libraries/rf_libraries/base_functions.py +1358 -0
  95. pyedb/libraries/rf_libraries/planar_antennas.py +628 -0
  96. pyedb/misc/decorators.py +61 -0
  97. pyedb/misc/misc.py +0 -13
  98. pyedb/modeler/geometry_operators.py +6 -6
  99. pyedb/siwave.py +6 -8
  100. pyedb/siwave_core/__init__.py +0 -0
  101. pyedb/siwave_core/cpa/__init__.py +0 -0
  102. {pyedb-0.54.0.dist-info → pyedb-0.56.0.dist-info}/METADATA +1 -2
  103. {pyedb-0.54.0.dist-info → pyedb-0.56.0.dist-info}/RECORD +105 -98
  104. {pyedb-0.54.0.dist-info → pyedb-0.56.0.dist-info}/WHEEL +0 -0
  105. {pyedb-0.54.0.dist-info → pyedb-0.56.0.dist-info}/licenses/LICENSE +0 -0
@@ -181,13 +181,15 @@ class CSVDataset:
181
181
  if variable in key_string:
182
182
  found_variable = True
183
183
  break
184
- assert found_variable, "Input string {} is not a key of the data dictionary.".format(variable)
184
+ if not found_variable:
185
+ raise KeyError(f"Input string {variable} is not a key of the data dictionary.")
185
186
  data_out._data[variable] = self._data[key_string]
186
187
  data_out._header.append(variable)
187
188
  return data_out
188
189
 
189
190
  def __add__(self, other): # pragma: no cover
190
- assert self.number_of_columns == other.number_of_columns, "Inconsistent number of columns"
191
+ if self.number_of_columns != other.number_of_columns:
192
+ raise ValueError("Number of columns is inconsistent.")
191
193
  # Create a new object to return, avoiding changing the original inputs
192
194
  new_dataset = CSVDataset()
193
195
  # Add empty columns to new_dataset
@@ -222,7 +224,8 @@ class CSVDataset:
222
224
  for column in other.data:
223
225
  self._data[column] = []
224
226
 
225
- assert self.number_of_columns == other.number_of_columns, "Inconsistent number of columns"
227
+ if self.number_of_columns != other.number_of_columns:
228
+ raise ValueError("Number of columns is inconsistent.")
226
229
 
227
230
  # Append the data from 'other'
228
231
  for column, row_data in other.data.items():
@@ -1341,9 +1344,10 @@ class Variable(object):
1341
1344
  self._value = self._calculated_value
1342
1345
  # If units have been specified, check for a conflict and otherwise use the specified unit system
1343
1346
  if units:
1344
- assert not self._units, "The unit specification {} is inconsistent with the identified units {}.".format(
1345
- specified_units, self._units
1346
- )
1347
+ if self._units and self._units != specified_units:
1348
+ raise RuntimeError(
1349
+ f"The unit specification {specified_units} is inconsistent with the identified units {self._units}."
1350
+ )
1347
1351
  self._units = specified_units
1348
1352
 
1349
1353
  if not si_value and is_number(self._value):
@@ -1730,9 +1734,10 @@ class Variable(object):
1730
1734
 
1731
1735
  """
1732
1736
  new_unit_system = unit_system(units)
1733
- assert (
1734
- new_unit_system == self.unit_system
1735
- ), "New unit system {0} is inconsistent with the current unit system {1}."
1737
+ if new_unit_system != self.unit_system:
1738
+ raise ValueError(
1739
+ f"New unit system {new_unit_system} is inconsistent with the current unit system {self.unit_system}."
1740
+ )
1736
1741
  self._units = units
1737
1742
  return self
1738
1743
 
@@ -1803,7 +1808,8 @@ class Variable(object):
1803
1808
  >>> assert result_3.unit_system == "Power"
1804
1809
 
1805
1810
  """
1806
- assert is_number(other) or isinstance(other, Variable), "Multiplier must be a scalar quantity or a variable."
1811
+ if not is_number(other) and not isinstance(other, Variable):
1812
+ raise ValueError("Multiplier must be a scalar quantity or a variable.")
1807
1813
  if is_number(other):
1808
1814
  result_value = self.numeric_value * other
1809
1815
  result_units = self.units
@@ -1847,10 +1853,10 @@ class Variable(object):
1847
1853
  >>> assert result.unit_system == "Current"
1848
1854
 
1849
1855
  """
1850
- assert isinstance(other, Variable), "You can only add a variable with another variable."
1851
- assert (
1852
- self.unit_system == other.unit_system
1853
- ), "Only ``Variable`` objects with the same unit system can be added."
1856
+ if not isinstance(other, Variable):
1857
+ raise ValueError("You can only add a variable with another variable.")
1858
+ if self.unit_system != other.unit_system:
1859
+ raise ValueError("Only Variable objects with the same unit system can be added.")
1854
1860
  result_value = self.value + other.value
1855
1861
  result_units = SI_UNITS[self.unit_system]
1856
1862
  # If the units of the two operands are different, return SI-Units
@@ -1888,10 +1894,10 @@ class Variable(object):
1888
1894
  >>> assert result_2.unit_system == "Current"
1889
1895
 
1890
1896
  """
1891
- assert isinstance(other, Variable), "You can only subtract a variable from another variable."
1892
- assert (
1893
- self.unit_system == other.unit_system
1894
- ), "Only ``Variable`` objects with the same unit system can be subtracted."
1897
+ if not isinstance(other, Variable):
1898
+ raise ValueError("You can only subtract a variable from another variable.")
1899
+ if self.unit_system != other.unit_system:
1900
+ raise ValueError("Only Variable objects with the same unit system can be subtracted.")
1895
1901
  result_value = self.value - other.value
1896
1902
  result_units = SI_UNITS[self.unit_system]
1897
1903
  # If the units of the two operands are different, return SI-Units
@@ -1933,7 +1939,8 @@ class Variable(object):
1933
1939
  >>> assert result_1.unit_system == "Current"
1934
1940
 
1935
1941
  """
1936
- assert is_number(other) or isinstance(other, Variable), "Divisor must be a scalar quantity or a variable."
1942
+ if not is_number(other) and not isinstance(other, Variable):
1943
+ raise ValueError("Divisor must be a scalar quantity or a variable.")
1937
1944
  if is_number(other):
1938
1945
  result_value = self.numeric_value / other
1939
1946
  result_units = self.units
@@ -55,10 +55,11 @@ class Connectable(LayoutObj):
55
55
  -------
56
56
  str
57
57
  """
58
- try:
59
- return self._edb_object.GetNet().GetName()
60
- except (KeyError, AttributeError): # pragma: no cover
61
- return None
58
+ net = self._edb_object.GetNet()
59
+ if net.IsNull():
60
+ return ""
61
+ else:
62
+ return net.GetName()
62
63
 
63
64
  @net_name.setter
64
65
  def net_name(self, name):
@@ -76,10 +77,38 @@ class Connectable(LayoutObj):
76
77
  -------
77
78
  :class:`dotnet.database.edb_data.nets_data.EDBComponent`
78
79
  """
79
- from pyedb.dotnet.database.cell.hierarchy.component import EDBComponent
80
+ return self._pedb.layout.find_component_by_name(self.component_name) if self.component_name else ""
81
+
82
+ @component.setter
83
+ def component(self, value):
84
+ self._edb_object.SetGroup(self._pedb.components.instances[value]._edb_object)
80
85
 
81
- edb_comp = self._edb_object.GetComponent()
82
- if edb_comp.IsNull():
83
- return None
86
+ @property
87
+ def component_name(self):
88
+ """Get the name of the component connected to this object."""
89
+ comp = self._edb_object.GetComponent()
90
+ if comp.IsNull():
91
+ return ""
84
92
  else:
85
- return EDBComponent(self._pedb, edb_comp)
93
+ return comp.GetName()
94
+
95
+ def get_connected_objects(self):
96
+ """Get connected objects.
97
+
98
+ Returns
99
+ -------
100
+ list
101
+ """
102
+ return self._pedb.get_connected_objects(self._layout_obj_instance)
103
+
104
+ def get_connected_object_id_set(self):
105
+ """Produce a list of all geometries physically connected to a given layout object.
106
+
107
+ Returns
108
+ -------
109
+ list
110
+ Found connected objects IDs with Layout object.
111
+ """
112
+ layoutInst = self._edb_object.GetLayout().GetLayoutInstance()
113
+ layoutObjInst = layoutInst.GetLayoutObjInstance(self._edb_object, None) # 2nd arg was []
114
+ return [loi.GetLayoutObj().GetId() for loi in layoutInst.GetConnectedObjects(layoutObjInst).Items]
@@ -295,7 +295,7 @@ class EDBComponent(Group):
295
295
  @solder_ball_height.setter
296
296
  def solder_ball_height(self, value):
297
297
  if "GetSolderBallProperty" in dir(self.component_property):
298
- sball_height = round(self._edb.utility.Value(value).ToDouble(), 9)
298
+ sball_height = round(self._pedb.edb_value(value).ToDouble(), 9)
299
299
  cmp_property = self.component_property
300
300
  solder_ball_prop = cmp_property.GetSolderBallProperty().Clone()
301
301
  solder_ball_prop.SetHeight(self._get_edb_value(sball_height))
@@ -319,18 +319,18 @@ class EDBComponent(Group):
319
319
  shape = None
320
320
  if isinstance(value, str):
321
321
  if value.lower() == "cylinder":
322
- shape = self._edb.definition.SolderballShape.Cylinder
322
+ shape = self._edb.Definition.SolderballShape.Cylinder
323
323
  elif value.lower() == "none":
324
- shape = self._edb.definition.SolderballShape.NoSolderball
324
+ shape = self._edb.Definition.SolderballShape.NoSolderball
325
325
  elif value.lower() == "spheroid":
326
- shape = self._edb.definition.SolderballShape.Spheroid
326
+ shape = self._edb.Definition.SolderballShape.Spheroid
327
327
  if isinstance(value, int):
328
328
  if value == 0:
329
- shape = self._edb.definition.SolderballShape.NoSolderball
329
+ shape = self._edb.Definition.SolderballShape.NoSolderball
330
330
  elif value == 1:
331
- shape = self._edb.definition.SolderballShape.Cylinder
331
+ shape = self._edb.Definition.SolderballShape.Cylinder
332
332
  elif value == 2:
333
- shape = self._edb.definition.SolderballShape.Spheroid
333
+ shape = self._edb.Definition.SolderballShape.Spheroid
334
334
  if shape:
335
335
  cmp_property = self.component_property
336
336
  solder_ball_prop = cmp_property.GetSolderBallProperty().Clone()
@@ -441,11 +441,11 @@ class EDBComponent(Group):
441
441
  if isinstance(value, list): # pragma no cover
442
442
  rlc_enabled = [True if i else False for i in value]
443
443
  rlc_values = [self._get_edb_value(i) for i in value]
444
- model = self._edb.cell.hierarchy._hierarchy.PinPairModel()
444
+ model = self._edb.Cell.Hierarchy.PinPairModel()
445
445
  pin_names = list(self.pins.keys())
446
446
  for idx, i in enumerate(np.arange(len(pin_names) // 2)):
447
- pin_pair = self._edb.utility.utility.PinPair(pin_names[idx], pin_names[idx + 1])
448
- rlc = self._edb.utility.utility.Rlc(
447
+ pin_pair = self._edb.Utility.PinPair(pin_names[idx], pin_names[idx + 1])
448
+ rlc = self._edb.Utility.Rlc(
449
449
  rlc_values[0], rlc_enabled[0], rlc_values[1], rlc_enabled[1], rlc_values[2], rlc_enabled[2], False
450
450
  )
451
451
  model.SetPinPairRlc(pin_pair, rlc)
@@ -482,11 +482,11 @@ class EDBComponent(Group):
482
482
  rlc_values = [value if i == self.type else 0 for i in ["Resistor", "Inductor", "Capacitor"]]
483
483
  rlc_values = [self._get_edb_value(i) for i in rlc_values]
484
484
 
485
- model = self._edb.cell.hierarchy._hierarchy.PinPairModel()
485
+ model = self._edb.Cell.Hierarchy.PinPairModel()
486
486
  pin_names = list(self.pins.keys())
487
487
  for idx, i in enumerate(np.arange(len(pin_names) // 2)):
488
- pin_pair = self._edb.utility.utility.PinPair(pin_names[idx], pin_names[idx + 1])
489
- rlc = self._edb.utility.utility.Rlc(
488
+ pin_pair = self._edb.Utility.PinPair(pin_names[idx], pin_names[idx + 1])
489
+ rlc = self._edb.Utility.Rlc(
490
490
  rlc_values[0], rlc_enabled[0], rlc_values[1], rlc_enabled[1], rlc_values[2], rlc_enabled[2], False
491
491
  )
492
492
  model.SetPinPairRlc(pin_pair, rlc)
@@ -671,7 +671,7 @@ class EDBComponent(Group):
671
671
  pins = [
672
672
  p
673
673
  for p in self.edbcomponent.LayoutObjs
674
- if p.GetObjType() == self._edb.cell.layout_object_type.PadstackInstance
674
+ if p.GetObjType() == self._edb.Cell.LayoutObjType.PadstackInstance
675
675
  and p.IsLayoutPin()
676
676
  and p.GetComponent().GetName() == self.refdes
677
677
  ]
@@ -740,17 +740,17 @@ class EDBComponent(Group):
740
740
  """
741
741
  new_type = new_type.lower()
742
742
  if new_type == "resistor":
743
- type_id = self._pedb.definition.ComponentType.Resistor
743
+ type_id = self._pedb.core.Definition.ComponentType.Resistor
744
744
  elif new_type == "inductor":
745
- type_id = self._pedb.definition.ComponentType.Inductor
745
+ type_id = self._pedb.core.Definition.ComponentType.Inductor
746
746
  elif new_type == "capacitor":
747
- type_id = self._pedb.definition.ComponentType.Capacitor
747
+ type_id = self._pedb.core.Definition.ComponentType.Capacitor
748
748
  elif new_type == "ic":
749
- type_id = self._pedb.definition.ComponentType.IC
749
+ type_id = self._pedb.core.Definition.ComponentType.IC
750
750
  elif new_type == "io":
751
- type_id = self._pedb.definition.ComponentType.IO
751
+ type_id = self._pedb.core.Definition.ComponentType.IO
752
752
  elif new_type == "other":
753
- type_id = self._pedb.definition.ComponentType.Other
753
+ type_id = self._pedb.core.Definition.ComponentType.Other
754
754
  else:
755
755
  return
756
756
  self.edbcomponent.SetComponentType(type_id)
@@ -911,7 +911,7 @@ class EDBComponent(Group):
911
911
  if not len(pin_names_sp) == self.numpins: # pragma: no cover
912
912
  raise ValueError(f"Pin counts doesn't match component {self.name}.")
913
913
 
914
- model = self._edb.cell.hierarchy._hierarchy.SPICEModel()
914
+ model = self._edb.Cell.Hierarchy.SPICEModel()
915
915
  model.SetModelPath(file_path)
916
916
  model.SetModelName(name)
917
917
  if sub_circuit_name:
@@ -949,13 +949,13 @@ class EDBComponent(Group):
949
949
  name = get_filename_without_extension(file_path)
950
950
 
951
951
  edbComponentDef = self.edbcomponent.GetComponentDef()
952
- nPortModel = self._edb.definition.NPortComponentModel.FindByName(edbComponentDef, name)
952
+ nPortModel = self._edb.Definition.NPortComponentModel.FindByName(edbComponentDef, name)
953
953
  if nPortModel.IsNull():
954
- nPortModel = self._edb.definition.NPortComponentModel.Create(name)
954
+ nPortModel = self._edb.Definition.NPortComponentModel.Create(name)
955
955
  nPortModel.SetReferenceFile(file_path)
956
956
  edbComponentDef.AddComponentModel(nPortModel)
957
957
 
958
- model = self._edb.cell.hierarchy._hierarchy.SParameterModel()
958
+ model = self._edb.Cell.Hierarchy.SParameterModel()
959
959
  model.SetComponentModelName(name)
960
960
  if reference_net:
961
961
  model.SetReferenceNet(reference_net)
@@ -983,7 +983,7 @@ class EDBComponent(Group):
983
983
  >>>comp_def.add_n_port_model("c:GRM32_DC0V_25degC_series.s2p", "GRM32_DC0V_25degC_series")
984
984
  >>>edbapp.components["C200"].use_s_parameter_model("GRM32_DC0V_25degC_series")
985
985
  """
986
- model = self._edb.cell.hierarchy._hierarchy.SParameterModel()
986
+ model = self._edb.Cell.Hierarchy.SParameterModel()
987
987
  model.SetComponentModelName(name)
988
988
  if reference_net:
989
989
  model.SetReferenceNet(reference_net)
@@ -1013,13 +1013,13 @@ class EDBComponent(Group):
1013
1013
  ind = 0 if ind is None else ind
1014
1014
  cap = 0 if cap is None else cap
1015
1015
  res, ind, cap = self._get_edb_value(res), self._get_edb_value(ind), self._get_edb_value(cap)
1016
- model = self._edb.cell.hierarchy._hierarchy.PinPairModel()
1016
+ model = self._edb.Cell.Hierarchy.PinPairModel()
1017
1017
 
1018
1018
  pin_names = list(self.pins.keys())
1019
1019
  for idx, i in enumerate(np.arange(len(pin_names) // 2)):
1020
- pin_pair = self._edb.utility.utility.PinPair(pin_names[idx], pin_names[idx + 1])
1020
+ pin_pair = self._edb.Utility.PinPair(pin_names[idx], pin_names[idx + 1])
1021
1021
 
1022
- rlc = self._edb.utility.utility.Rlc(res, r_enabled, ind, l_enabled, cap, c_enabled, is_parallel)
1022
+ rlc = self._edb.Utility.Rlc(res, r_enabled, ind, l_enabled, cap, c_enabled, is_parallel)
1023
1023
  model.SetPinPairRlc(pin_pair, rlc)
1024
1024
  return self._set_model(model)
1025
1025
 
@@ -28,7 +28,7 @@ class Model(ObjBase):
28
28
 
29
29
  def __init__(self, pedb, edb_object):
30
30
  super().__init__(pedb, edb_object)
31
- self._model_type_mapping = {"PinPairModel": self._pedb.core.cell}
31
+ self._model_type_mapping = {"PinPairModel": self._pedb.core.Cell}
32
32
 
33
33
  @property
34
34
  def model_type(self):
@@ -23,7 +23,7 @@
23
23
  """
24
24
  This module contains these classes: `EdbLayout` and `Shape`.
25
25
  """
26
- from typing import Union
26
+ from typing import List, Union
27
27
 
28
28
  from pyedb.dotnet.database.cell.hierarchy.component import EDBComponent
29
29
  from pyedb.dotnet.database.cell.primitive.bondwire import Bondwire
@@ -337,7 +337,7 @@ class Layout(ObjBase):
337
337
  -------
338
338
 
339
339
  """
340
- obj = self._pedb._edb.Cell.Hierarchy.Component.FindByName(self._edb_object, value)
340
+ obj = self._pedb.core.Cell.Hierarchy.Component.FindByName(self._edb_object, value)
341
341
  return EDBComponent(self._pedb, obj) if obj is not None else None
342
342
 
343
343
  def find_primitive(
@@ -369,3 +369,64 @@ class Layout(ObjBase):
369
369
  prims = [i for i in prims if i.layer_name in layer_name] if layer_name is not None else prims
370
370
  prims = [i for i in prims if i.net_name in net_name] if net_name is not None else prims
371
371
  return prims
372
+
373
+ def find_padstack_instances(
374
+ self,
375
+ aedt_name: Union[str, List[str]] = None,
376
+ component_name: Union[str, List[str]] = None,
377
+ component_pin_name: Union[str, List[str]] = None,
378
+ net_name: Union[str, List[str]] = None,
379
+ instance_id: Union[int, List[int]] = None,
380
+ ) -> List:
381
+ """
382
+ Finds padstack instances matching the specified criteria.
383
+
384
+ This method filters the available padstack instances based on specified attributes such as
385
+ `aedt_name`, `component_name`, `component_pin_name`, `net_name`, or `instance_id`. Criteria
386
+ can be passed as individual values or as a list of values. If no padstack instances match
387
+ the criteria, an error is raised.
388
+
389
+ Parameters
390
+ ----------
391
+ aedt_name : Union[str, List[str]], optional
392
+ Name(s) of the AEDT padstack instance(s) to filter.
393
+ component_name : Union[str, List[str]], optional
394
+ Name(s) of the component(s) to filter padstack instances by.
395
+ component_pin_name : Union[str, List[str]], optional
396
+ Name(s) of the component pin(s) to filter padstack instances by.
397
+ net_name : Union[str, List[str]], optional
398
+ Name(s) of the net(s) to filter padstack instances by.
399
+ instance_id : Union[int, List[int]], optional
400
+ ID(s) of the padstack instance(s) to filter.
401
+
402
+ Returns
403
+ -------
404
+ List
405
+ A list of padstack instances matching the specified criteria.
406
+ """
407
+ candidates = self.padstack_instances
408
+ if instance_id is not None:
409
+ value = instance_id if isinstance(instance_id, list) else [instance_id]
410
+ candidates = [i for i in candidates if i.id in value]
411
+
412
+ if aedt_name is not None:
413
+ name = aedt_name if isinstance(aedt_name, list) else [aedt_name]
414
+ candidates = [i for i in candidates if i.aedt_name in name]
415
+
416
+ if component_name is not None:
417
+ value = component_name if isinstance(component_name, list) else [component_name]
418
+ candidates = [i for i in candidates if i.component_name in value]
419
+
420
+ if net_name is not None:
421
+ value = net_name if isinstance(net_name, list) else [net_name]
422
+ candidates = [i for i in candidates if i.net_name in value]
423
+
424
+ if component_pin_name is not None:
425
+ value = component_pin_name if isinstance(component_pin_name, list) else [component_pin_name]
426
+ candidates = [i for i in candidates if i.name in value]
427
+ if not candidates: # pragma: no cover
428
+ raise ValueError(
429
+ f"Failed to find padstack instances with aedt_name={aedt_name}, component_name={component_name}, "
430
+ f"net_name={net_name}, component_pin_name={component_pin_name}"
431
+ )
432
+ return candidates
@@ -48,12 +48,12 @@ class LayoutObj(ObjBase):
48
48
 
49
49
  @property
50
50
  def _edb_properties(self):
51
- p = self._edb_object.GetProductSolverOption(self._edb.core.ProductId.Designer, "HFSS")
51
+ p = self._edb_object.GetProductSolverOption(self._edb.ProductId.Designer, "HFSS")
52
52
  return p
53
53
 
54
54
  @_edb_properties.setter
55
55
  def _edb_properties(self, value):
56
- self._edb_object.SetProductSolverOption(self._edb.core.ProductId.Designer, "HFSS", value)
56
+ self._edb_object.SetProductSolverOption(self._edb.ProductId.Designer, "HFSS", value)
57
57
 
58
58
  @property
59
59
  def _obj_type(self):
@@ -122,7 +122,7 @@ class Path(Primitive):
122
122
  last_point = list(center_line.Points)[-1]
123
123
  x = "({})+({})".format(x, last_point.X.ToString())
124
124
  y = "({})+({})".format(y, last_point.Y.ToString())
125
- center_line.AddPoint(PointData(self._pedb, x=x, y=y)._edb_object)
125
+ center_line.AddPoint(PointData.create_from_xy(self._pedb, x=x, y=y)._edb_object)
126
126
  return self._edb_object.SetCenterLine(center_line)
127
127
 
128
128
  def get_center_line(self, to_string=False):
@@ -151,19 +151,17 @@ class Path(Primitive):
151
151
  bool
152
152
  ``True`` when successful, ``False`` when failed.
153
153
  """
154
- center_line = self.center_line
155
- width = self.width
156
154
  corner_style = self.corner_style
157
155
  end_cap_style = self.get_end_cap_style()
158
- cloned_path = self._app.core.cell.primitive.path.create(
156
+ cloned_path = self._app.core.Cell.Primitive.Path.Create(
159
157
  self._app.active_layout,
160
158
  self.layer_name,
161
- self.net,
162
- width,
159
+ self.net._edb_object,
160
+ self._edb_object.GetWidthValue(),
163
161
  end_cap_style[1],
164
162
  end_cap_style[2],
165
163
  corner_style,
166
- center_line,
164
+ self._edb_object.GetCenterLine(),
167
165
  )
168
166
  if cloned_path:
169
167
  return cloned_path
@@ -338,7 +336,7 @@ class Path(Primitive):
338
336
  def center_line(self, value):
339
337
  if isinstance(value, list):
340
338
  points = [self._pedb.point_data(i[0], i[1]) for i in value]
341
- polygon_data = self._edb.geometry.polygon_data.dotnetobj(convert_py_list_to_net_list(points), False)
339
+ polygon_data = self._edb.Geometry.PolygonData(convert_py_list_to_net_list(points), False)
342
340
  self._edb_object.SetCenterLine(polygon_data)
343
341
 
344
342
  def get_center_line_polygon_data(self):
@@ -21,6 +21,8 @@
21
21
  # SOFTWARE.
22
22
  import re
23
23
 
24
+ from System import String
25
+
24
26
  from pyedb.dotnet.database.cell.connectable import Connectable
25
27
  from pyedb.dotnet.database.general import convert_py_list_to_net_list
26
28
  from pyedb.dotnet.database.geometry.polygon_data import PolygonData
@@ -147,15 +149,6 @@ class Primitive(Connectable):
147
149
  """
148
150
  return self._edb_object.IsVoid()
149
151
 
150
- def get_connected_objects(self):
151
- """Get connected objects.
152
-
153
- Returns
154
- -------
155
- list
156
- """
157
- return self._pedb.get_connected_objects(self._layout_obj_instance)
158
-
159
152
  def area(self, include_voids=True):
160
153
  """Return the total area.
161
154
 
@@ -240,18 +233,6 @@ class Primitive(Connectable):
240
233
  """
241
234
  return point.IsArc()
242
235
 
243
- def get_connected_object_id_set(self):
244
- """Produce a list of all geometries physically connected to a given layout object.
245
-
246
- Returns
247
- -------
248
- list
249
- Found connected objects IDs with Layout object.
250
- """
251
- layoutInst = self._edb_object.GetLayout().GetLayoutInstance()
252
- layoutObjInst = layoutInst.GetLayoutObjInstance(self._edb_object, None) # 2nd arg was []
253
- return [loi.GetLayoutObj().GetId() for loi in layoutInst.GetConnectedObjects(layoutObjInst).Items]
254
-
255
236
  @property
256
237
  def bbox(self):
257
238
  """Return the primitive bounding box points. Lower left corner, upper right corner.
@@ -540,7 +521,7 @@ class Primitive(Connectable):
540
521
  -------
541
522
  list of float
542
523
  """
543
- if isinstance(point, self._app.core.geometry.geometry.PointData):
524
+ if isinstance(point, self._app.core.Geometry.PointData):
544
525
  point = [point.X.ToDouble(), point.Y.ToDouble()]
545
526
  dist = 1e12
546
527
  out = None
@@ -581,8 +562,6 @@ class Primitive(Connectable):
581
562
  str
582
563
  Name.
583
564
  """
584
- from System import String
585
-
586
565
  val = String("")
587
566
 
588
567
  _, name = self._edb_object.GetProductProperty(self._pedb._edb.ProductId.Designer, 1, val)
@@ -45,8 +45,8 @@ class EdgeTerminal(Terminal):
45
45
  port = [port]
46
46
  temp = [self._edb_object]
47
47
  temp.extend([i._edb_object for i in port])
48
- edb_list = convert_py_list_to_net_list(temp, self._edb.cell.terminal.Terminal)
49
- _edb_bundle_terminal = self._edb.cell.terminal.BundleTerminal.Create(edb_list)
48
+ edb_list = convert_py_list_to_net_list(temp, self._edb.Cell.Terminal.Terminal)
49
+ _edb_bundle_terminal = self._edb.Cell.Terminal.BundleTerminal.Create(edb_list)
50
50
  return self._pedb.ports[_edb_bundle_terminal.GetName()]
51
51
 
52
52
  @property
@@ -80,7 +80,7 @@ class PadstackInstanceTerminal(Terminal):
80
80
 
81
81
  layer_obj = self._pedb.stackup.signal_layers[layer]
82
82
 
83
- terminal = self._edb.cell.terminal.PadstackInstanceTerminal.Create(
83
+ terminal = self._edb.Cell.Terminal.PadstackInstanceTerminal.Create(
84
84
  self._pedb.active_layout,
85
85
  padstack_instance.net.net_object,
86
86
  name,
@@ -48,7 +48,7 @@ class PinGroupTerminal(Terminal):
48
48
  :class:`pyedb.dotnet.database.edb_data.terminals.PinGroupTerminal`
49
49
  """
50
50
  net_obj = self._pedb.layout.find_net_by_name(net_name)
51
- term = self._pedb.core.cell.terminal.PinGroupTerminal.Create(
51
+ term = self._pedb.core.Cell.Terminal.PinGroupTerminal.Create(
52
52
  self._pedb.active_layout,
53
53
  net_obj._edb_object,
54
54
  name,
@@ -50,7 +50,7 @@ class PointTerminal(Terminal):
50
50
  -------
51
51
  :class:`pyedb.dotnet.database.edb_data.terminals.PointTerminal`
52
52
  """
53
- terminal = self._pedb.core.cell.terminal.PointTerminal.Create(
53
+ terminal = self._pedb.core.Cell.Terminal.PointTerminal.Create(
54
54
  self._pedb.active_layout,
55
55
  self._pedb.layout.find_net_by_name(net)._edb_object,
56
56
  name,