pyedb 0.56.0__py3-none-any.whl → 0.58.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 (110) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_data.py +3 -0
  3. pyedb/configuration/cfg_pin_groups.py +2 -0
  4. pyedb/configuration/cfg_terminals.py +232 -0
  5. pyedb/configuration/configuration.py +146 -3
  6. pyedb/dotnet/clr_module.py +1 -2
  7. pyedb/dotnet/database/Variables.py +30 -22
  8. pyedb/dotnet/database/cell/hierarchy/component.py +2 -8
  9. pyedb/dotnet/database/cell/layout.py +5 -1
  10. pyedb/dotnet/database/cell/primitive/primitive.py +2 -2
  11. pyedb/dotnet/database/cell/terminal/bundle_terminal.py +12 -0
  12. pyedb/dotnet/database/cell/terminal/pingroup_terminal.py +1 -1
  13. pyedb/dotnet/database/cell/terminal/terminal.py +38 -0
  14. pyedb/dotnet/database/components.py +15 -19
  15. pyedb/dotnet/database/dotnet/database.py +1 -0
  16. pyedb/dotnet/database/edb_data/control_file.py +19 -8
  17. pyedb/dotnet/database/edb_data/nets_data.py +3 -3
  18. pyedb/dotnet/database/edb_data/padstacks_data.py +39 -14
  19. pyedb/dotnet/database/edb_data/ports.py +0 -25
  20. pyedb/dotnet/database/edb_data/primitives_data.py +3 -3
  21. pyedb/dotnet/database/edb_data/raptor_x_simulation_setup_data.py +18 -19
  22. pyedb/dotnet/database/edb_data/simulation_configuration.py +3 -3
  23. pyedb/dotnet/database/edb_data/sources.py +21 -2
  24. pyedb/dotnet/database/general.py +1 -6
  25. pyedb/dotnet/database/hfss.py +9 -8
  26. pyedb/dotnet/database/layout_validation.py +14 -3
  27. pyedb/dotnet/database/materials.py +1 -3
  28. pyedb/dotnet/database/modeler.py +7 -3
  29. pyedb/dotnet/database/nets.py +27 -19
  30. pyedb/dotnet/database/padstack.py +4 -2
  31. pyedb/dotnet/database/sim_setup_data/io/siwave.py +54 -1
  32. pyedb/dotnet/database/siwave.py +4 -3
  33. pyedb/dotnet/database/stackup.py +55 -58
  34. pyedb/dotnet/database/utilities/heatsink.py +0 -1
  35. pyedb/dotnet/database/utilities/hfss_simulation_setup.py +81 -0
  36. pyedb/dotnet/database/utilities/simulation_setup.py +7 -5
  37. pyedb/dotnet/database/utilities/siwave_cpa_simulation_setup.py +1 -0
  38. pyedb/dotnet/database/utilities/siwave_simulation_setup.py +264 -13
  39. pyedb/dotnet/edb.py +65 -47
  40. pyedb/exceptions.py +1 -2
  41. pyedb/extensions/create_cell_array.py +67 -49
  42. pyedb/generic/data_handlers.py +13 -23
  43. pyedb/generic/design_types.py +9 -35
  44. pyedb/generic/filesystem.py +4 -2
  45. pyedb/generic/general_methods.py +28 -41
  46. pyedb/generic/plot.py +8 -23
  47. pyedb/generic/process.py +78 -10
  48. pyedb/grpc/database/_typing.py +0 -0
  49. pyedb/grpc/database/components.py +14 -13
  50. pyedb/grpc/database/control_file.py +27 -40
  51. pyedb/grpc/database/definition/materials.py +1 -1
  52. pyedb/grpc/database/definition/package_def.py +6 -3
  53. pyedb/grpc/database/definition/padstack_def.py +14 -12
  54. pyedb/grpc/database/hfss.py +1 -4
  55. pyedb/grpc/database/hierarchy/component.py +5 -13
  56. pyedb/grpc/database/hierarchy/pingroup.py +16 -3
  57. pyedb/grpc/database/layers/layer.py +1 -2
  58. pyedb/grpc/database/layers/stackup_layer.py +42 -19
  59. pyedb/grpc/database/layout/layout.py +43 -27
  60. pyedb/grpc/database/layout/voltage_regulator.py +6 -1
  61. pyedb/grpc/database/layout_validation.py +5 -2
  62. pyedb/grpc/database/modeler.py +254 -252
  63. pyedb/grpc/database/net/differential_pair.py +9 -2
  64. pyedb/grpc/database/net/extended_net.py +24 -9
  65. pyedb/grpc/database/net/net.py +14 -5
  66. pyedb/grpc/database/net/net_class.py +24 -7
  67. pyedb/grpc/database/nets.py +11 -43
  68. pyedb/grpc/database/padstacks.py +67 -119
  69. pyedb/grpc/database/primitive/bondwire.py +3 -67
  70. pyedb/grpc/database/primitive/circle.py +42 -3
  71. pyedb/grpc/database/primitive/padstack_instance.py +58 -31
  72. pyedb/grpc/database/primitive/path.py +160 -11
  73. pyedb/grpc/database/primitive/polygon.py +73 -7
  74. pyedb/grpc/database/primitive/primitive.py +2 -2
  75. pyedb/grpc/database/primitive/rectangle.py +105 -4
  76. pyedb/grpc/database/simulation_setup/hfss_general_settings.py +0 -2
  77. pyedb/grpc/database/simulation_setup/hfss_settings_options.py +0 -4
  78. pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +79 -0
  79. pyedb/grpc/database/simulation_setup/siwave_cpa_simulation_setup.py +1 -0
  80. pyedb/grpc/database/simulation_setup/sweep_data.py +1 -3
  81. pyedb/grpc/database/siwave.py +6 -13
  82. pyedb/grpc/database/source_excitations.py +46 -63
  83. pyedb/grpc/database/stackup.py +55 -60
  84. pyedb/grpc/database/terminal/bundle_terminal.py +10 -3
  85. pyedb/grpc/database/terminal/padstack_instance_terminal.py +9 -11
  86. pyedb/grpc/database/terminal/pingroup_terminal.py +8 -1
  87. pyedb/grpc/database/terminal/point_terminal.py +30 -0
  88. pyedb/grpc/database/terminal/terminal.py +35 -10
  89. pyedb/grpc/database/utility/heat_sink.py +0 -1
  90. pyedb/grpc/database/utility/hfss_extent_info.py +2 -2
  91. pyedb/grpc/database/utility/xml_control_file.py +19 -8
  92. pyedb/grpc/edb.py +63 -32
  93. pyedb/grpc/edb_init.py +1 -0
  94. pyedb/ipc2581/ecad/cad_data/layer_feature.py +6 -2
  95. pyedb/ipc2581/ecad/cad_data/step.py +1 -1
  96. pyedb/ipc2581/ipc2581.py +8 -7
  97. pyedb/libraries/common.py +3 -4
  98. pyedb/libraries/rf_libraries/base_functions.py +7 -16
  99. pyedb/libraries/rf_libraries/planar_antennas.py +3 -21
  100. pyedb/misc/aedtlib_personalib_install.py +2 -2
  101. pyedb/misc/downloads.py +19 -3
  102. pyedb/misc/misc.py +5 -2
  103. pyedb/misc/siw_feature_config/emc_rule_checker_settings.py +3 -2
  104. pyedb/misc/siw_feature_config/xtalk_scan/scan_config.py +0 -1
  105. pyedb/misc/utilities.py +0 -1
  106. pyedb/modeler/geometry_operators.py +3 -2
  107. {pyedb-0.56.0.dist-info → pyedb-0.58.0.dist-info}/METADATA +6 -7
  108. {pyedb-0.56.0.dist-info → pyedb-0.58.0.dist-info}/RECORD +110 -108
  109. {pyedb-0.56.0.dist-info → pyedb-0.58.0.dist-info}/WHEEL +0 -0
  110. {pyedb-0.56.0.dist-info → pyedb-0.58.0.dist-info}/licenses/LICENSE +0 -0
@@ -39,8 +39,8 @@ class Primitive(Connectable):
39
39
  >>> from pyedb import Edb
40
40
  >>> edb = Edb(myedb, edbversion="2021.2")
41
41
  >>> edb_prim = edb.modeler.primitives[0]
42
- >>> edb_prim.is_void # Class Property
43
- >>> edb_prim.IsVoid() # EDB Object Property
42
+ >>> edb_prim.is_void # Class Property
43
+ >>> edb_prim.IsVoid() # EDB Object Property
44
44
  """
45
45
 
46
46
  def __init__(self, pedb, edb_object):
@@ -22,6 +22,7 @@
22
22
 
23
23
  from pyedb.dotnet.database.cell.terminal.edge_terminal import EdgeTerminal
24
24
  from pyedb.dotnet.database.cell.terminal.terminal import Terminal
25
+ from pyedb.dotnet.database.general import convert_py_list_to_net_list
25
26
 
26
27
 
27
28
  class BundleTerminal(Terminal):
@@ -46,3 +47,14 @@ class BundleTerminal(Terminal):
46
47
  def decouple(self):
47
48
  """Ungroup a bundle of terminals."""
48
49
  return self._edb_object.Ungroup()
50
+
51
+ @classmethod
52
+ def create(cls, pedb, name, terminals):
53
+ terminal_list = [pedb.terminals[i]._edb_object for i in terminals]
54
+ edb_list = convert_py_list_to_net_list(terminal_list, pedb._edb.Cell.Terminal.Terminal)
55
+ _edb_boundle_terminal = pedb._edb.Cell.Terminal.BundleTerminal.Create(edb_list)
56
+ _edb_boundle_terminal.SetName(name)
57
+ pos, neg = list(_edb_boundle_terminal.GetTerminals())
58
+ pos.SetName(name + ":T1")
59
+ neg.SetName(name + ":T2")
60
+ return pedb.terminals[name]
@@ -57,7 +57,7 @@ class PinGroupTerminal(Terminal):
57
57
  )
58
58
  term = PinGroupTerminal(self._pedb, term)
59
59
  if term.is_null:
60
- msg = f"Failed to create terminal. "
60
+ msg = f"Failed to create terminal {name}."
61
61
  if name in self._pedb.terminals:
62
62
  msg += f"Terminal {name} already exists."
63
63
  raise ValueError(msg)
@@ -56,6 +56,12 @@ class Terminal(Connectable):
56
56
  "PinGroupTerminal": self._pedb.core.Cell.Terminal.TerminalType.PinGroupTerminal,
57
57
  }
58
58
 
59
+ self._source_term_to_ground_mapping = {
60
+ "kNoGround": self._pedb.core.Cell.Terminal.SourceTermToGround.kNoGround,
61
+ "kNegative": self._pedb.core.Cell.Terminal.SourceTermToGround.kNegative,
62
+ "kPositive": self._pedb.core.Cell.Terminal.SourceTermToGround.kPositive,
63
+ }
64
+
59
65
  @property
60
66
  def _hfss_port_property(self):
61
67
  """HFSS port property."""
@@ -444,3 +450,35 @@ class Terminal(Connectable):
444
450
  @phase.setter
445
451
  def phase(self, value):
446
452
  self._edb_object.SetSourcePhase(self._edb.Utility.Value(value))
453
+
454
+ @property
455
+ def amplitude(self):
456
+ """Property added for grpc compatibility"""
457
+ return self.magnitude
458
+
459
+ @property
460
+ def source_amplitude(self):
461
+ """Property added for grpc compatibility"""
462
+ return self.magnitude
463
+
464
+ @source_amplitude.setter
465
+ def source_amplitude(self, value):
466
+ self.magnitude = value
467
+
468
+ @property
469
+ def source_phase(self):
470
+ """Property added for grpc compatibility"""
471
+ return self.phase
472
+
473
+ @source_phase.setter
474
+ def source_phase(self, value):
475
+ self.phase = value
476
+
477
+ @property
478
+ def terminal_to_ground(self):
479
+ return self._edb_object.GetTerminalToGround().ToString()
480
+
481
+ @terminal_to_ground.setter
482
+ def terminal_to_ground(self, value):
483
+ obj = self._source_term_to_ground_mapping[value]
484
+ self._edb_object.SetTerminalToGround(obj)
@@ -20,9 +20,8 @@
20
20
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  # SOFTWARE.
22
22
 
23
- """This module contains the `Components` class.
23
+ """This module contains the `Components` class."""
24
24
 
25
- """
26
25
  import codecs
27
26
  import json
28
27
  import math
@@ -541,16 +540,17 @@ class Components(object):
541
540
 
542
541
  Examples
543
542
  --------
544
- >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2")
543
+ >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2")
545
544
  >>> hosting_cmp = edb1.components.get_component_by_name("U100")
546
545
  >>> mounted_cmp = edb2.components.get_component_by_name("BGA")
547
546
  >>> vector, rotation, solder_ball_height = edb1.components.get_component_placement_vector(
548
- ... mounted_component=mounted_cmp,
549
- ... hosting_component=hosting_cmp,
550
- ... mounted_component_pin1="A12",
551
- ... mounted_component_pin2="A14",
552
- ... hosting_component_pin1="A12",
553
- ... hosting_component_pin2="A14")
547
+ ... mounted_component=mounted_cmp,
548
+ ... hosting_component=hosting_cmp,
549
+ ... mounted_component_pin1="A12",
550
+ ... mounted_component_pin2="A14",
551
+ ... hosting_component_pin1="A12",
552
+ ... hosting_component_pin2="A14",
553
+ ... )
554
554
  """
555
555
  m_pin1_pos = [0.0, 0.0]
556
556
  m_pin2_pos = [0.0, 0.0]
@@ -961,7 +961,7 @@ class Components(object):
961
961
  if not isinstance(port_type, int):
962
962
  if port_type == "circuit_port":
963
963
  port_type = SourceType.CircPort
964
- elif port_type == "coaxial_port":
964
+ elif port_type in ["coaxial_port", "coax_port"]:
965
965
  port_type = SourceType.CoaxPort
966
966
  elif port_type == "lumped_port":
967
967
  port_type = SourceType.LumpedPort
@@ -1270,7 +1270,7 @@ class Components(object):
1270
1270
  Examples
1271
1271
  --------
1272
1272
  >>> from pyedb import Edb
1273
- >>> edb_file = r'C:\my_edb_file.aedb'
1273
+ >>> edb_file = r"C:\my_edb_file.aedb"
1274
1274
  >>> edb = Edb(edb_file)
1275
1275
  >>> for cmp in list(edb.components.instances.keys()):
1276
1276
  >>> edb.components.deactivate_rlc_component(component=cmp, create_circuit_port=False)
@@ -1518,8 +1518,6 @@ class Components(object):
1518
1518
  if componentDefinitionPin.IsNull():
1519
1519
  self._logger.error("Failed to create component definition pin {}-{}".format(name, pin.GetName()))
1520
1520
  return None
1521
- else:
1522
- self._logger.warning("Found existing component definition for footprint {}".format(name))
1523
1521
  return componentDefinition
1524
1522
 
1525
1523
  def create_rlc_component(
@@ -1750,9 +1748,9 @@ class Components(object):
1750
1748
 
1751
1749
  >>> from pyedb import Edb
1752
1750
  >>> edbapp = Edb("myaedbfolder")
1753
- >>> edbapp.components.set_component_model("A1", model_type="Spice",
1754
- ... modelpath="pathtospfile",
1755
- ... modelname="spicemodelname")
1751
+ >>> edbapp.components.set_component_model(
1752
+ ... "A1", model_type="Spice", modelpath="pathtospfile", modelname="spicemodelname"
1753
+ ... )
1756
1754
 
1757
1755
  """
1758
1756
  if not modelname:
@@ -2152,9 +2150,7 @@ class Components(object):
2152
2150
 
2153
2151
  >>> from pyedb import Edb
2154
2152
  >>> edbapp = Edb("myaedbfolder")
2155
- >>> edbapp.components.set_component_rlc(
2156
- ... "R1", res_value=50, ind_value=1e-9, cap_value=1e-12, isparallel=False
2157
- ... )
2153
+ >>> edbapp.components.set_component_rlc("R1", res_value=50, ind_value=1e-9, cap_value=1e-12, isparallel=False)
2158
2154
 
2159
2155
  """
2160
2156
  if res_value is None and ind_value is None and cap_value is None:
@@ -21,6 +21,7 @@
21
21
  # SOFTWARE.
22
22
 
23
23
  """Database."""
24
+
24
25
  import re
25
26
 
26
27
  from pyedb.dotnet.database.general import convert_py_list_to_net_list
@@ -23,10 +23,12 @@
23
23
  import copy
24
24
  import os
25
25
  import re
26
- import subprocess
26
+ import subprocess # nosec B404
27
27
  import sys
28
28
  import xml
29
29
 
30
+ from defusedxml.ElementTree import parse as defused_parse
31
+
30
32
  from pyedb.generic.general_methods import ET, env_path, env_value, is_linux
31
33
  from pyedb.generic.settings import settings
32
34
  from pyedb.misc.aedtlib_personalib_install import write_pretty_xml
@@ -36,6 +38,11 @@ from pyedb.misc.misc import list_installed_ansysem
36
38
  def convert_technology_file(tech_file, edbversion=None, control_file=None):
37
39
  """Convert a technology file to edb control file (xml).
38
40
 
41
+ .. warning::
42
+ Do not execute this function with untrusted function argument, environment
43
+ variables or pyedb global settings.
44
+ See the :ref:`security guide<ref_security_consideration>` for details.
45
+
39
46
  Parameters
40
47
  ----------
41
48
  tech_file : str
@@ -99,10 +106,11 @@ def convert_technology_file(tech_file, edbversion=None, control_file=None):
99
106
  ]
100
107
  commands.append(command)
101
108
  commands.append(["rm", "-r", vlc_file_name + ".aedb"])
102
- my_env = os.environ.copy()
103
109
  for command in commands:
104
- p = subprocess.Popen(command, env=my_env)
105
- p.wait()
110
+ try:
111
+ subprocess.run(command, check=True) # nosec
112
+ except subprocess.CalledProcessError as e: # nosec
113
+ raise RuntimeError("An error occurred while converting a technology file to edb control file") from e
106
114
  if os.path.exists(control_file):
107
115
  settings.logger.info("Xml file created.")
108
116
  return control_file
@@ -123,7 +131,7 @@ class ControlProperty:
123
131
  float(value)
124
132
  self.type = 0
125
133
  except TypeError:
126
- pass
134
+ self.type = -1
127
135
 
128
136
  def _write_xml(self, root):
129
137
  try:
@@ -133,8 +141,11 @@ class ControlProperty:
133
141
  double.text = str(self.value)
134
142
  else:
135
143
  pass
136
- except:
137
- pass
144
+ except Exception as e:
145
+ settings.logger.error(
146
+ f"A(n) {type(e).__name__} error occurred while attempting to create a new sub-element {self.name} "
147
+ f"for element {root}: {str(e)}"
148
+ )
138
149
 
139
150
 
140
151
  class ControlFileMaterial:
@@ -1210,7 +1221,7 @@ class ControlFile:
1210
1221
  -------
1211
1222
  bool
1212
1223
  """
1213
- tree = ET.parse(xml_input)
1224
+ tree = defused_parse(xml_input)
1214
1225
  root = tree.getroot()
1215
1226
  for el in root:
1216
1227
  if el.tag == "Stackup":
@@ -37,8 +37,8 @@ class EDBNetsData(NetDotNet):
37
37
  >>> from pyedb import Edb
38
38
  >>> edb = Edb(myedb, edbversion="2021.2")
39
39
  >>> edb_net = edb.nets.nets["GND"]
40
- >>> edb_net.name # Class Property
41
- >>> edb_net.name # EDB Object Property
40
+ >>> edb_net.name # Class Property
41
+ >>> edb_net.name # EDB Object Property
42
42
  """
43
43
 
44
44
  def __init__(self, raw_net, core_app):
@@ -220,7 +220,7 @@ class EDBExtendedNetData(ExtendedNetDotNet):
220
220
  >>> from pyedb import Edb
221
221
  >>> edb = Edb(myedb, edbversion="2021.2")
222
222
  >>> edb_extended_net = edb.nets.extended_nets["GND"]
223
- >>> edb_extended_net.name # Class Property
223
+ >>> edb_extended_net.name # Class Property
224
224
  """
225
225
 
226
226
  def __init__(self, core_app, raw_extended_net=None):
@@ -22,6 +22,7 @@
22
22
 
23
23
  from collections import OrderedDict
24
24
  import math
25
+ import re
25
26
  import warnings
26
27
 
27
28
  from pyedb.dotnet.clr_module import String
@@ -1213,6 +1214,39 @@ class EDBPadstackInstance(Connectable):
1213
1214
  if not term.is_null:
1214
1215
  return term
1215
1216
 
1217
+ @property
1218
+ def side_number(self):
1219
+ """Return the number of sides meshed of the padstack instance.
1220
+ Returns
1221
+ -------
1222
+ int
1223
+ Number of sides meshed of the padstack instance.
1224
+ """
1225
+ side_value = self._edb_object.GetProductProperty(self._pedb._edb.ProductId.Hfss3DLayout, 21)
1226
+ if side_value[0]:
1227
+ return int(re.search(r"(?m)^\s*sid=(\d+)", side_value[1]).group(1))
1228
+ return 0
1229
+
1230
+ @side_number.setter
1231
+ def side_number(self, value):
1232
+ """Set the number of sides meshed of the padstack instance.
1233
+
1234
+ Parameters
1235
+ ----------
1236
+ value : int
1237
+ Number of sides to mesh the padstack instance.
1238
+
1239
+ Returns
1240
+ -------
1241
+ bool
1242
+ True if successful, False otherwise.
1243
+ """
1244
+ if isinstance(value, int) and 3 <= value <= 64:
1245
+ prop_string = f"$begin ''\n\tsid={value}\n\tmat='copper'\n\tvs='Wirebond'\n$end ''\n"
1246
+ self._edb_object.SetProductProperty(self._pedb._edb.ProductId.Hfss3DLayout, 21, prop_string)
1247
+ else:
1248
+ raise ValueError("Number of sides must be an integer between 3 and 64")
1249
+
1216
1250
  @property
1217
1251
  def terminal(self):
1218
1252
  """Terminal."""
@@ -1740,8 +1774,11 @@ class EDBPadstackInstance(Connectable):
1740
1774
  hole_diam = 0
1741
1775
  try: # pragma no cover
1742
1776
  hole_diam = padstack_def.hole_properties[0]
1743
- except: # pragma no cover
1744
- pass
1777
+ except Exception as e: # pragma no cover
1778
+ self._pedb.logger.error(
1779
+ f"Failed to access first element of hole_properties attribute of object "
1780
+ f"{padstack_def} - Hole diameter is set to default value 0 - {type(e).__name__}: {str(e)}"
1781
+ )
1745
1782
  if hole_diam: # pragma no cover
1746
1783
  hole_finished_size = padstack_def.hole_finished_size
1747
1784
  via_length = (
@@ -1915,18 +1952,6 @@ class EDBPadstackInstance(Connectable):
1915
1952
  """
1916
1953
  return int(self._edb_padstackinstance.GetGroup().GetPlacementLayer().GetTopBottomAssociation())
1917
1954
 
1918
- @property
1919
- def side_number(self) -> float:
1920
- if not self._side_number:
1921
- prop_string = "$begin ''\n\tsid=3\n\tmat='copper'\n\tvs='Wirebond'\n$end ''\n"
1922
- self._edb_padstackinstance.SetProductProperty(self._pedb._edb.ProductId.Designer, 21, prop_string)
1923
- self._side_number = self._edb_padstackinstance.GetProductProperty(self._pedb._edb.ProductId.Designer, 21)
1924
- return self._side_number
1925
-
1926
- @side_number.setter
1927
- def side_number(self, value):
1928
- self._side_number = self._edb_padstackinstance.GetProductProperty(self._pedb._edb.ProductId.Designer, 21, value)
1929
-
1930
1955
  def create_rectangle_in_pad(self, layer_name, return_points=False, partition_max_order=16):
1931
1956
  """Create a rectangle inscribed inside a padstack instance pad.
1932
1957
 
@@ -49,36 +49,11 @@ class GapPort(EdgeTerminal):
49
49
  def __init__(self, pedb, edb_object):
50
50
  super().__init__(pedb, edb_object)
51
51
 
52
- @property
53
- def magnitude(self):
54
- """Magnitude."""
55
- return self._edb_object.GetSourceAmplitude().ToDouble()
56
-
57
- @property
58
- def source_amplitude(self):
59
- """Property added for grpc compatibility"""
60
- return self.magnitude
61
-
62
- @property
63
- def source_phase(self):
64
- """Property added for grpc compatibility"""
65
- return self.phase
66
-
67
- @property
68
- def phase(self):
69
- """Phase."""
70
- return self._edb_object.GetSourcePhase().ToDouble()
71
-
72
52
  @property
73
53
  def renormalize(self):
74
54
  """Whether renormalize is active."""
75
55
  return self._edb_object.GetPortPostProcessingProp().DoRenormalize
76
56
 
77
- @property
78
- def deembed(self):
79
- """Inductance value of the deembed gap port."""
80
- return self._edb_object.GetPortPostProcessingProp().DoDeembedGapL
81
-
82
57
  @property
83
58
  def renormalize_z0(self):
84
59
  """Renormalize Z0 value (real, imag)."""
@@ -358,9 +358,9 @@ class EDBArcs(object):
358
358
  >>> from pyedb import Edb
359
359
  >>> edb = Edb(myedb, edbversion="2021.2")
360
360
  >>> prim_arcs = edb.modeler.primitives[0].arcs
361
- >>> prim_arcs.center # arc center
362
- >>> prim_arcs.points # arc point list
363
- >>> prim_arcs.mid_point # arc mid point
361
+ >>> prim_arcs.center # arc center
362
+ >>> prim_arcs.points # arc point list
363
+ >>> prim_arcs.mid_point # arc mid point
364
364
  """
365
365
 
366
366
  def __init__(self, app, arc):
@@ -85,11 +85,13 @@ class RaptorXSimulationSetup(SimulationSetup):
85
85
  Examples
86
86
  --------
87
87
  >>> setup1 = edbapp.create_hfss_setup("setup1")
88
- >>> setup1.add_frequency_sweep(frequency_sweep=[
89
- ... ["linear count", "0", "1kHz", 1],
90
- ... ["log scale", "1kHz", "0.1GHz", 10],
91
- ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"],
92
- ... ])
88
+ >>> setup1.add_frequency_sweep(
89
+ ... frequency_sweep=[
90
+ ... ["linear count", "0", "1kHz", 1],
91
+ ... ["log scale", "1kHz", "0.1GHz", 10],
92
+ ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"],
93
+ ... ]
94
+ ... )
93
95
  """
94
96
  if name in self.frequency_sweeps:
95
97
  return False
@@ -234,9 +236,7 @@ class RaptorXSimulationAdvancedSettings(object):
234
236
  if isinstance(value, list):
235
237
  self._advanced_settings.NetSettingsOptions = convert_py_list_to_net_list(value)
236
238
  else:
237
- self.logger.error(
238
- f"RaptorX setup net_settings_options input setter must be a list. " f"Provided value {value}"
239
- )
239
+ self.logger.error(f"RaptorX setup net_settings_options input setter must be a list. Provided value {value}")
240
240
 
241
241
  @property
242
242
  def override_shrink_fac(self):
@@ -276,7 +276,7 @@ class RaptorXSimulationAdvancedSettings(object):
276
276
  self._advanced_settings.UseAccelerateViaExtraction = value
277
277
  else:
278
278
  self.logger.error(
279
- "RaptorX setup use_accelerate_via_extraction setter input must be boolean." f"Provided value {value}"
279
+ f"RaptorX setup use_accelerate_via_extraction setter input must be boolean. Provided value {value}"
280
280
  )
281
281
 
282
282
  @property
@@ -290,7 +290,7 @@ class RaptorXSimulationAdvancedSettings(object):
290
290
  self._advanced_settings.UseAutoRemovalSliverPoly = value
291
291
  else:
292
292
  self.logger.error(
293
- f"RaptorX setup use_auto_removal_sliver_poly setter must be a boolean. " f"Provided value {value}"
293
+ f"RaptorX setup use_auto_removal_sliver_poly setter must be a boolean. Provided value {value}"
294
294
  )
295
295
 
296
296
  @property
@@ -334,7 +334,7 @@ class RaptorXSimulationAdvancedSettings(object):
334
334
  self._advanced_settings.UseEliminateSlitPerHoles = value
335
335
  else:
336
336
  self.logger.error(
337
- f"RaptorX setup use_eliminate_slit_per_holes setter must be a boolean. " f"Provided value {value}"
337
+ f"RaptorX setup use_eliminate_slit_per_holes setter must be a boolean. Provided value {value}"
338
338
  )
339
339
 
340
340
  @property
@@ -350,7 +350,7 @@ class RaptorXSimulationAdvancedSettings(object):
350
350
  self._advanced_settings.UseEnableAdvancedCapEffects = value
351
351
  else:
352
352
  self.logger.error(
353
- f"RaptorX setup use_enable_advanced_cap_effects setter must be a boolean. " f"Provided value {value}"
353
+ f"RaptorX setup use_enable_advanced_cap_effects setter must be a boolean. Provided value {value}"
354
354
  )
355
355
 
356
356
  @property
@@ -366,7 +366,7 @@ class RaptorXSimulationAdvancedSettings(object):
366
366
  self._advanced_settings.UseEnableEtchTransform = value
367
367
  else:
368
368
  self.logger.error(
369
- f"RaptorX setup use_enable_etch_transform setter must be a boolean. " f"Provided value {value}"
369
+ f"RaptorX setup use_enable_etch_transform setter must be a boolean. Provided value {value}"
370
370
  )
371
371
 
372
372
  @property
@@ -382,7 +382,7 @@ class RaptorXSimulationAdvancedSettings(object):
382
382
  self._advanced_settings.UseEnableHybridExtraction = value
383
383
  else:
384
384
  self.logger.error(
385
- f"RaptorX setup use_enable_hybrid_extraction setter must be a boolean. " f"Provided value {value}"
385
+ f"RaptorX setup use_enable_hybrid_extraction setter must be a boolean. Provided value {value}"
386
386
  )
387
387
 
388
388
  @property
@@ -414,7 +414,7 @@ class RaptorXSimulationAdvancedSettings(object):
414
414
  self._advanced_settings.UseExtractFloatingMetalsDummy = value
415
415
  else:
416
416
  self.logger.error(
417
- f"RaptorX setup use_extract_floating_metals_dummy setter must be a boolean. " f"Provided value {value}"
417
+ f"RaptorX setup use_extract_floating_metals_dummy setter must be a boolean. Provided value {value}"
418
418
  )
419
419
 
420
420
  @property
@@ -430,8 +430,7 @@ class RaptorXSimulationAdvancedSettings(object):
430
430
  self._advanced_settings.UseExtractFloatingMetalsFloating = value
431
431
  else:
432
432
  self.logger.error(
433
- f"RaptorX setup use_extract_floating_metals_floating setter must be a boolean. "
434
- f"Provided value {value}"
433
+ f"RaptorX setup use_extract_floating_metals_floating setter must be a boolean. Provided value {value}"
435
434
  )
436
435
 
437
436
  @property
@@ -493,7 +492,7 @@ class RaptorXSimulationAdvancedSettings(object):
493
492
  self._advanced_settings.UsePlaneProjectionFactor = value
494
493
  else:
495
494
  self.logger.error(
496
- f"RaptorX setup use_plane_projection_factor setter must be a boolean. " f"Provided value {value}"
495
+ f"RaptorX setup use_plane_projection_factor setter must be a boolean. Provided value {value}"
497
496
  )
498
497
 
499
498
  @property
@@ -506,4 +505,4 @@ class RaptorXSimulationAdvancedSettings(object):
506
505
  if isinstance(value, bool):
507
506
  self._advanced_settings.UseRelaxedZAxis = value
508
507
  else:
509
- self.logger.error(f"RaptorX setup use_relaxed_z_axis setter must be a boolean. " f"Provided value {value}")
508
+ self.logger.error(f"RaptorX setup use_relaxed_z_axis setter must be a boolean. Provided value {value}")
@@ -2132,7 +2132,7 @@ class SimulationConfiguration(object):
2132
2132
 
2133
2133
  Defined the radiation box type, Conformal, Bounding box and ConvexHull are supported (HFSS only).
2134
2134
 
2135
- >>> sim_setup.max_num_passes= 30
2135
+ >>> sim_setup.max_num_passes = 30
2136
2136
 
2137
2137
  Default value is 30, specify the maximum number of adaptive passes (only HFSS). Reasonable high value is recommended
2138
2138
  to force the solver reaching the convergence criteria.
@@ -2147,7 +2147,7 @@ class SimulationConfiguration(object):
2147
2147
  local minima.
2148
2148
 
2149
2149
  >>> from dotnet.generic.constants import BasisOrder
2150
- >>> sim_setup.basis_order = BasisOrder.Single
2150
+ >>> sim_setup.basis_order = BasisOrder.Single
2151
2151
 
2152
2152
  Select the order basis (HFSS only), Zero, Single, Double and Mixed are supported. For Signal integrity Single or
2153
2153
  Mixed should be used.
@@ -2229,7 +2229,7 @@ class SimulationConfiguration(object):
2229
2229
 
2230
2230
  Activate the loop resistance usage per pin when ``True``
2231
2231
 
2232
- >>> sim_setup.dc_via_report_path = 'C:\\temp\\via_report_file'
2232
+ >>> sim_setup.dc_via_report_path = "C:\\temp\\via_report_file"
2233
2233
 
2234
2234
  Define the via report path file.
2235
2235
 
@@ -20,6 +20,7 @@
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 typing import List, Tuple, Union
23
24
  import warnings
24
25
 
25
26
  from pyedb.generic.constants import NodeType, SourceType
@@ -279,9 +280,27 @@ class PinGroup(object):
279
280
  @property
280
281
  def pins(self):
281
282
  """Gets the pins belong to this pin group."""
282
- from pyedb.dotnet.database.edb_data.padstacks_data import EDBPadstackInstance
283
+ edb_pin_ids = [edb_pin.GetId() for edb_pin in list(self._edb_object.GetPins())]
284
+ if len(edb_pin_ids) == 0:
285
+ return {}
286
+ else:
287
+ pins = self._pedb.layout.find_padstack_instances(instance_id=edb_pin_ids)
288
+ return {i.name: i for i in pins}
289
+
290
+ def remove_pins(self, pins: Union[str, List[str]]):
291
+ """Remove pins from the pin group.
292
+
293
+ Parameters
294
+ ----------
295
+ pins : str, list
296
+ List of padstack instance names.
297
+
298
+ """
299
+ _pins = pins if isinstance(pins, Union[list, Tuple]) else [pins]
283
300
 
284
- return {i.GetName(): EDBPadstackInstance(i, self._pedb) for i in list(self._edb_object.GetPins())}
301
+ pin_objs = [j for i, j in self.pins.items() if i in _pins]
302
+ for p in pin_objs:
303
+ self._edb_object.RemovePin(p._edb_object)
285
304
 
286
305
  @property
287
306
  def node_pins(self):
@@ -27,17 +27,12 @@ This module contains EDB general methods and related methods.
27
27
 
28
28
  from __future__ import absolute_import # noreorder
29
29
 
30
+ from enum import Enum
30
31
  import logging
31
32
  import re
32
33
 
33
34
  from pyedb.dotnet.clr_module import Dictionary, List, Tuple
34
35
 
35
- try:
36
- from enum import Enum
37
- except ImportError:
38
- Enum = None
39
-
40
-
41
36
  logger = logging.getLogger(__name__)
42
37
 
43
38
 
@@ -23,6 +23,7 @@
23
23
  """
24
24
  This module contains the ``EdbHfss`` class.
25
25
  """
26
+
26
27
  import math
27
28
 
28
29
  from pyedb.dotnet.database.edb_data.hfss_extent_info import HfssExtentInfo
@@ -174,8 +175,8 @@ class EdbHfss(object):
174
175
 
175
176
  >>> from pyedb import Edb
176
177
  >>> edbapp = Edb("myaedbfolder", "project name", "release version")
177
- >>> pins =edbapp.components.get_pin_from_component("U2A5")
178
- >>> edbapp.hfss.create_circuit_port_on_pin(pins[0], pins[1],50,"port_name")
178
+ >>> pins = edbapp.components.get_pin_from_component("U2A5")
179
+ >>> edbapp.hfss.create_circuit_port_on_pin(pins[0], pins[1], 50, "port_name")
179
180
 
180
181
  Returns
181
182
  -------
@@ -211,8 +212,8 @@ class EdbHfss(object):
211
212
 
212
213
  >>> from pyedb import Edb
213
214
  >>> edbapp = Edb("myaedbfolder", "project name", "release version")
214
- >>> pins =edbapp.components.get_pin_from_component("U2A5")
215
- >>> edbapp.hfss.create_voltage_source_on_pin(pins[0], pins[1],50,"source_name")
215
+ >>> pins = edbapp.components.get_pin_from_component("U2A5")
216
+ >>> edbapp.hfss.create_voltage_source_on_pin(pins[0], pins[1], 50, "source_name")
216
217
  """
217
218
  return self._pedb.siwave.create_voltage_source_on_pin(pos_pin, neg_pin, voltage_value, phase_value, source_name)
218
219
 
@@ -242,8 +243,8 @@ class EdbHfss(object):
242
243
 
243
244
  >>> from pyedb import Edb
244
245
  >>> edbapp = Edb("myaedbfolder", "project name", "release version")
245
- >>> pins =edbapp.components.get_pin_from_component("U2A5")
246
- >>> edbapp.hfss.create_current_source_on_pin(pins[0], pins[1],50,"source_name")
246
+ >>> pins = edbapp.components.get_pin_from_component("U2A5")
247
+ >>> edbapp.hfss.create_current_source_on_pin(pins[0], pins[1], 50, "source_name")
247
248
  """
248
249
 
249
250
  return self._pedb.siwave.create_current_source_on_pin(pos_pin, neg_pin, current_value, phase_value, source_name)
@@ -272,8 +273,8 @@ class EdbHfss(object):
272
273
 
273
274
  >>> from pyedb import Edb
274
275
  >>> edbapp = Edb("myaedbfolder", "project name", "release version")
275
- >>> pins =edbapp.components.get_pin_from_component("U2A5")
276
- >>> edbapp.hfss.create_resistor_on_pin(pins[0], pins[1],50,"res_name")
276
+ >>> pins = edbapp.components.get_pin_from_component("U2A5")
277
+ >>> edbapp.hfss.create_resistor_on_pin(pins[0], pins[1], 50, "res_name")
277
278
  """
278
279
  return self._pedb.siwave.create_resistor_on_pin(pos_pin, neg_pin, rvalue, resistor_name)
279
280