pyedb 0.56.0__py3-none-any.whl → 0.57.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 (99) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_data.py +3 -0
  3. pyedb/configuration/cfg_terminals.py +232 -0
  4. pyedb/configuration/configuration.py +146 -3
  5. pyedb/dotnet/clr_module.py +1 -2
  6. pyedb/dotnet/database/Variables.py +30 -22
  7. pyedb/dotnet/database/cell/layout.py +5 -1
  8. pyedb/dotnet/database/cell/primitive/primitive.py +2 -2
  9. pyedb/dotnet/database/cell/terminal/bundle_terminal.py +12 -0
  10. pyedb/dotnet/database/cell/terminal/pingroup_terminal.py +1 -1
  11. pyedb/dotnet/database/cell/terminal/terminal.py +38 -0
  12. pyedb/dotnet/database/components.py +14 -16
  13. pyedb/dotnet/database/dotnet/database.py +1 -0
  14. pyedb/dotnet/database/edb_data/control_file.py +6 -3
  15. pyedb/dotnet/database/edb_data/nets_data.py +3 -3
  16. pyedb/dotnet/database/edb_data/padstacks_data.py +5 -2
  17. pyedb/dotnet/database/edb_data/ports.py +0 -25
  18. pyedb/dotnet/database/edb_data/primitives_data.py +3 -3
  19. pyedb/dotnet/database/edb_data/raptor_x_simulation_setup_data.py +18 -19
  20. pyedb/dotnet/database/edb_data/simulation_configuration.py +3 -3
  21. pyedb/dotnet/database/hfss.py +9 -8
  22. pyedb/dotnet/database/layout_validation.py +6 -3
  23. pyedb/dotnet/database/materials.py +1 -3
  24. pyedb/dotnet/database/modeler.py +7 -3
  25. pyedb/dotnet/database/nets.py +27 -19
  26. pyedb/dotnet/database/padstack.py +4 -2
  27. pyedb/dotnet/database/sim_setup_data/io/siwave.py +1 -1
  28. pyedb/dotnet/database/siwave.py +4 -3
  29. pyedb/dotnet/database/stackup.py +50 -26
  30. pyedb/dotnet/database/utilities/heatsink.py +0 -1
  31. pyedb/dotnet/database/utilities/simulation_setup.py +7 -5
  32. pyedb/dotnet/database/utilities/siwave_cpa_simulation_setup.py +1 -0
  33. pyedb/dotnet/database/utilities/siwave_simulation_setup.py +5 -2
  34. pyedb/dotnet/edb.py +39 -34
  35. pyedb/exceptions.py +1 -2
  36. pyedb/extensions/create_cell_array.py +19 -5
  37. pyedb/generic/data_handlers.py +13 -23
  38. pyedb/generic/design_types.py +9 -35
  39. pyedb/generic/filesystem.py +4 -2
  40. pyedb/generic/general_methods.py +4 -5
  41. pyedb/generic/plot.py +2 -2
  42. pyedb/grpc/database/_typing.py +0 -0
  43. pyedb/grpc/database/components.py +7 -8
  44. pyedb/grpc/database/control_file.py +14 -35
  45. pyedb/grpc/database/definition/materials.py +1 -1
  46. pyedb/grpc/database/definition/package_def.py +6 -3
  47. pyedb/grpc/database/definition/padstack_def.py +4 -7
  48. pyedb/grpc/database/hfss.py +1 -4
  49. pyedb/grpc/database/hierarchy/component.py +3 -4
  50. pyedb/grpc/database/hierarchy/pingroup.py +16 -3
  51. pyedb/grpc/database/layers/layer.py +1 -2
  52. pyedb/grpc/database/layers/stackup_layer.py +42 -19
  53. pyedb/grpc/database/layout/layout.py +43 -27
  54. pyedb/grpc/database/layout/voltage_regulator.py +6 -1
  55. pyedb/grpc/database/layout_validation.py +5 -2
  56. pyedb/grpc/database/modeler.py +226 -244
  57. pyedb/grpc/database/net/differential_pair.py +9 -2
  58. pyedb/grpc/database/net/extended_net.py +24 -9
  59. pyedb/grpc/database/net/net.py +14 -5
  60. pyedb/grpc/database/net/net_class.py +24 -7
  61. pyedb/grpc/database/nets.py +11 -43
  62. pyedb/grpc/database/padstacks.py +5 -16
  63. pyedb/grpc/database/primitive/bondwire.py +3 -67
  64. pyedb/grpc/database/primitive/circle.py +42 -3
  65. pyedb/grpc/database/primitive/padstack_instance.py +17 -19
  66. pyedb/grpc/database/primitive/path.py +154 -5
  67. pyedb/grpc/database/primitive/polygon.py +73 -7
  68. pyedb/grpc/database/primitive/primitive.py +2 -2
  69. pyedb/grpc/database/primitive/rectangle.py +105 -4
  70. pyedb/grpc/database/simulation_setup/hfss_general_settings.py +0 -2
  71. pyedb/grpc/database/simulation_setup/hfss_settings_options.py +0 -4
  72. pyedb/grpc/database/simulation_setup/siwave_cpa_simulation_setup.py +1 -0
  73. pyedb/grpc/database/simulation_setup/sweep_data.py +1 -3
  74. pyedb/grpc/database/siwave.py +6 -13
  75. pyedb/grpc/database/source_excitations.py +39 -56
  76. pyedb/grpc/database/stackup.py +50 -27
  77. pyedb/grpc/database/terminal/bundle_terminal.py +10 -3
  78. pyedb/grpc/database/terminal/pingroup_terminal.py +8 -1
  79. pyedb/grpc/database/terminal/terminal.py +19 -8
  80. pyedb/grpc/database/utility/heat_sink.py +0 -1
  81. pyedb/grpc/database/utility/hfss_extent_info.py +2 -2
  82. pyedb/grpc/database/utility/xml_control_file.py +6 -3
  83. pyedb/grpc/edb.py +24 -19
  84. pyedb/grpc/edb_init.py +1 -0
  85. pyedb/ipc2581/ecad/cad_data/layer_feature.py +6 -2
  86. pyedb/ipc2581/ecad/cad_data/step.py +1 -1
  87. pyedb/ipc2581/ipc2581.py +8 -7
  88. pyedb/libraries/common.py +3 -4
  89. pyedb/libraries/rf_libraries/base_functions.py +7 -16
  90. pyedb/libraries/rf_libraries/planar_antennas.py +3 -21
  91. pyedb/misc/downloads.py +1 -0
  92. pyedb/misc/misc.py +5 -2
  93. pyedb/misc/siw_feature_config/emc_rule_checker_settings.py +1 -1
  94. pyedb/misc/utilities.py +0 -1
  95. pyedb/modeler/geometry_operators.py +3 -2
  96. {pyedb-0.56.0.dist-info → pyedb-0.57.0.dist-info}/METADATA +3 -3
  97. {pyedb-0.56.0.dist-info → pyedb-0.57.0.dist-info}/RECORD +99 -97
  98. {pyedb-0.56.0.dist-info → pyedb-0.57.0.dist-info}/WHEEL +0 -0
  99. {pyedb-0.56.0.dist-info → pyedb-0.57.0.dist-info}/licenses/LICENSE +0 -0
@@ -25,8 +25,7 @@ from typing import Any, Dict, List, Optional, Set, Tuple, Union
25
25
  from ansys.edb.core.database import ProductIdType as GrpcProductIdType
26
26
  from ansys.edb.core.geometry.point_data import PointData as GrpcPointData
27
27
  from ansys.edb.core.geometry.polygon_data import PolygonData as GrpcPolygonData
28
- from ansys.edb.core.terminal.edge_terminal import EdgeTerminal as GrpcEdgeTerminal
29
- from ansys.edb.core.terminal.edge_terminal import PrimitiveEdge as GrpcPrimitiveEdge
28
+ from ansys.edb.core.terminal.edge_terminal import EdgeTerminal as GrpcEdgeTerminal, PrimitiveEdge as GrpcPrimitiveEdge
30
29
  from ansys.edb.core.terminal.terminal import BoundaryType as GrpcBoundaryType
31
30
  from ansys.edb.core.utility.rlc import Rlc as GrpcRlc
32
31
 
@@ -66,14 +65,14 @@ class SourceExcitation:
66
65
  >>> # Create voltage source on component pins
67
66
  >>> from pyedb.grpc.database.utility.sources import Source, SourceType
68
67
  >>> source = Source(
69
- >>> source_type=SourceType.Vsource,
70
- >>> name="V1",
71
- >>> positive_node=("U1", "VCC"),
72
- >>> negative_node=("U1", "GND"),
73
- >>> amplitude="1V",
74
- >>> phase="0deg",
75
- >>> impedance="50ohm"
76
- >>> )
68
+ ... source_type=SourceType.Vsource,
69
+ ... name="V1",
70
+ ... positive_node=("U1", "VCC"),
71
+ ... negative_node=("U1", "GND"),
72
+ ... amplitude="1V",
73
+ ... phase="0deg",
74
+ ... impedance="50ohm",
75
+ ... )
77
76
  >>> source_excitations.create_source_on_component([source])
78
77
 
79
78
  >>> # 2. create_port
@@ -85,21 +84,14 @@ class SourceExcitation:
85
84
  >>> # 3. create_port_on_pins
86
85
  >>> # Create circuit port between component pins
87
86
  >>> port_term = source_excitations.create_port_on_pins(
88
- >>> refdes="U1",
89
- >>> pins="Pin1",
90
- >>> reference_pins=["GND_Pin1", "GND_Pin2"],
91
- >>> impedance=50,
92
- >>> port_name="Port1"
93
- >>> )
87
+ ... refdes="U1", pins="Pin1", reference_pins=["GND_Pin1", "GND_Pin2"], impedance=50, port_name="Port1"
88
+ ... )
94
89
 
95
90
  >>> # 4. create_port_on_component
96
91
  >>> # Create coaxial ports on component nets
97
92
  >>> source_excitations.create_port_on_component(
98
- >>> component="U1",
99
- >>> net_list=["PCIe_RX0", "PCIe_RX1"],
100
- >>> port_type=SourceType.CoaxPort,
101
- >>> reference_net="GND"
102
- >>> )
93
+ ... component="U1", net_list=["PCIe_RX0", "PCIe_RX1"], port_type=SourceType.CoaxPort, reference_net="GND"
94
+ ... )
103
95
 
104
96
  >>> # 5. add_port_on_rlc_component
105
97
  >>> # Replace RLC component with circuit port
@@ -153,35 +145,26 @@ class SourceExcitation:
153
145
  >>> # 16. create_coax_port_on_component
154
146
  >>> # Create coaxial ports on component
155
147
  >>> ports = source_excitations.create_coax_port_on_component(
156
- >>> ["U1", "U2"],
157
- >>> ["PCIe_RX0", "PCIe_TX0"],
158
- >>> delete_existing_terminal=True
159
- >>> )
148
+ ... ["U1", "U2"], ["PCIe_RX0", "PCIe_TX0"], delete_existing_terminal=True
149
+ ... )
160
150
 
161
151
  >>> # 17. create_differential_wave_port
162
152
  >>> # Create differential wave port
163
153
  >>> pos_prim = edb.modeler.primitives[0]
164
154
  >>> neg_prim = edb.modeler.primitives[1]
165
155
  >>> port_name, diff_port = source_excitations.create_differential_wave_port(
166
- >>> pos_prim.id, [0, 0],
167
- >>> neg_prim.id, [0, 0.2],
168
- >>> "DiffPort"
169
- >>> )
156
+ ... pos_prim.id, [0, 0], neg_prim.id, [0, 0.2], "DiffPort"
157
+ ... )
170
158
 
171
159
  >>> # 18. create_wave_port
172
160
  >>> # Create wave port
173
- >>> port_name, wave_port = source_excitations.create_wave_port(
174
- >>> pos_prim.id, [0, 0],
175
- >>> "WavePort"
176
- >>> )
161
+ >>> port_name, wave_port = source_excitations.create_wave_port(pos_prim.id, [0, 0], "WavePort")
177
162
 
178
163
  >>> # 19. create_bundle_wave_port
179
164
  >>> # Create bundle wave port
180
165
  >>> port_name, bundle_port = source_excitations.create_bundle_wave_port(
181
- >>> [pos_prim.id, neg_prim.id],
182
- >>> [[0,0], [0,0.2]],
183
- >>> "BundlePort"
184
- >>> )
166
+ ... [pos_prim.id, neg_prim.id], [[0, 0], [0, 0.2]], "BundlePort"
167
+ ... )
185
168
 
186
169
  >>> # 20. create_dc_terminal
187
170
  >>> # Create DC terminal
@@ -194,10 +177,8 @@ class SourceExcitation:
194
177
  >>> # 22. place_voltage_probe
195
178
  >>> # Place voltage probe between points
196
179
  >>> source_excitations.place_voltage_probe(
197
- >>> "Probe1",
198
- >>> "SignalNet", [0, 0], "TopLayer",
199
- >>> "GND", [0.1, 0.1], "BottomLayer"
200
- >>> )
180
+ ... "Probe1", "SignalNet", [0, 0], "TopLayer", "GND", [0.1, 0.1], "BottomLayer"
181
+ ... )
201
182
 
202
183
  >>> # Save and close EDB
203
184
  >>> edb.save()
@@ -584,8 +565,11 @@ class SourceExcitation:
584
565
  net_name = net.name
585
566
  if net_name:
586
567
  net_list.append(net_name)
587
- except:
588
- pass
568
+ except Exception as e:
569
+ self._logger.warning(
570
+ f"A(n) {type(e).__name__} error occurred while attempting to append 'name' "
571
+ f"of net {net} to list of nets {net_list}: {str(e)}"
572
+ )
589
573
  if isinstance(reference_net, str) or isinstance(reference_net, Net):
590
574
  reference_net = [reference_net]
591
575
  _reference_net = [ref.name for ref in reference_net if isinstance(ref, Net)]
@@ -1656,8 +1640,7 @@ class SourceExcitation:
1656
1640
 
1657
1641
  if not source_name:
1658
1642
  source_name = (
1659
- f"Vsource_{positive_component_name}_{positive_net_name}_"
1660
- f"{negative_component_name}_{negative_net_name}"
1643
+ f"Vsource_{positive_component_name}_{positive_net_name}_{negative_component_name}_{negative_net_name}"
1661
1644
  )
1662
1645
  return self.create_pin_group_terminal(
1663
1646
  positive_pins=pos_node_pins,
@@ -1720,8 +1703,7 @@ class SourceExcitation:
1720
1703
 
1721
1704
  if not source_name:
1722
1705
  source_name = (
1723
- f"Vsource_{positive_component_name}_{positive_net_name}_"
1724
- f"{negative_component_name}_{negative_net_name}"
1706
+ f"Vsource_{positive_component_name}_{positive_net_name}_{negative_component_name}_{negative_net_name}"
1725
1707
  )
1726
1708
  return self.create_pin_group_terminal(
1727
1709
  positive_pins=pos_node_pins,
@@ -1865,7 +1847,7 @@ class SourceExcitation:
1865
1847
  --------
1866
1848
  >>> from pyedb import Edb
1867
1849
  >>> edb = Edb()
1868
- >>> port_name, port = edb.source_excitation.create_differential_wave_port(0, [0,0], 1, [0,0.2])
1850
+ >>> port_name, port = edb.source_excitation.create_differential_wave_port(0, [0, 0], 1, [0, 0.2])
1869
1851
  """
1870
1852
  if not port_name:
1871
1853
  port_name = generate_unique_name("diff")
@@ -1939,7 +1921,7 @@ class SourceExcitation:
1939
1921
  --------
1940
1922
  >>> from pyedb import Edb
1941
1923
  >>> edb = Edb()
1942
- >>> port_name, port = edb.source_excitation.create_wave_port(0, [0,0])
1924
+ >>> port_name, port = edb.source_excitation.create_wave_port(0, [0, 0])
1943
1925
  """
1944
1926
  if not port_name:
1945
1927
  port_name = generate_unique_name("Terminal_")
@@ -2007,7 +1989,7 @@ class SourceExcitation:
2007
1989
  --------
2008
1990
  >>> from pyedb import Edb
2009
1991
  >>> edb = Edb()
2010
- >>> term = edb.source_excitation.create_edge_port_vertical(0, [0,0], reference_layer="TopLayer")
1992
+ >>> term = edb.source_excitation.create_edge_port_vertical(0, [0, 0], reference_layer="TopLayer")
2011
1993
  """
2012
1994
  if not port_name:
2013
1995
  port_name = generate_unique_name("Terminal_")
@@ -2079,7 +2061,7 @@ class SourceExcitation:
2079
2061
  --------
2080
2062
  >>> from pyedb import Edb
2081
2063
  >>> edb = Edb()
2082
- >>> edb.source_excitation.create_edge_port_horizontal(0, [0,0], 1, [0,0.1], "EdgePort")
2064
+ >>> edb.source_excitation.create_edge_port_horizontal(0, [0, 0], 1, [0, 0.1], "EdgePort")
2083
2065
  """
2084
2066
  pos_edge_term = self._create_edge_terminal(prim_id, point_on_edge, port_name)
2085
2067
  neg_edge_term = self._create_edge_terminal(ref_prim_id, point_on_ref_edge, port_name + "_ref", is_ref=True)
@@ -2350,7 +2332,7 @@ class SourceExcitation:
2350
2332
  --------
2351
2333
  >>> from pyedb import Edb
2352
2334
  >>> edb = Edb()
2353
- >>> port_name, port = edb.source_excitation.create_bundle_wave_port([0,1], [[0,0],[0,0.2]])
2335
+ >>> port_name, port = edb.source_excitation.create_bundle_wave_port([0, 1], [[0, 0], [0, 0.2]])
2354
2336
  """
2355
2337
  if not port_name:
2356
2338
  port_name = generate_unique_name("bundle_port")
@@ -2453,7 +2435,7 @@ class SourceExcitation:
2453
2435
  --------
2454
2436
  >>> from pyedb import Edb
2455
2437
  >>> edb = Edb()
2456
- >>> term = edb.source_excitation.get_point_terminal("Term1", "Net1", [0,0], "TopLayer")
2438
+ >>> term = edb.source_excitation.get_point_terminal("Term1", "Net1", [0, 0], "TopLayer")
2457
2439
  """
2458
2440
  from pyedb.grpc.database.terminal.point_terminal import PointTerminal
2459
2441
 
@@ -2571,7 +2553,7 @@ class SourceExcitation:
2571
2553
  >>> edb = Edb()
2572
2554
  >>> poly = edb.modeler.primitives[0]
2573
2555
  >>> ref_poly = edb.modeler.primitives[1]
2574
- >>> edb.source_excitation.create_edge_port_on_polygon(poly, ref_poly, [0,0], [0.1,0])
2556
+ >>> edb.source_excitation.create_edge_port_on_polygon(poly, ref_poly, [0, 0], [0.1, 0])
2575
2557
  """
2576
2558
  if not polygon:
2577
2559
  self._logger.error("No polygon provided for port {} creation".format(port_name))
@@ -3081,8 +3063,9 @@ class SourceExcitation:
3081
3063
  --------
3082
3064
  >>> from pyedb import Edb
3083
3065
  >>> edb = Edb()
3084
- >>> probe = edb.source_excitation.place_voltage_probe("Probe1", "Net1", [0,0], "TopLayer",
3085
- ... "GND", [0.1,0], "TopLayer")
3066
+ >>> probe = edb.source_excitation.place_voltage_probe(
3067
+ ... "Probe1", "Net1", [0, 0], "TopLayer", "GND", [0.1, 0], "TopLayer"
3068
+ ... )
3086
3069
  """
3087
3070
  p_terminal = PointTerminal.create(
3088
3071
  layout=self._pedb.active_layout,
@@ -41,13 +41,12 @@ from ansys.edb.core.definition.solder_ball_property import (
41
41
  from ansys.edb.core.geometry.point3d_data import Point3DData as GrpcPoint3DData
42
42
  from ansys.edb.core.hierarchy.cell_instance import CellInstance as GrpcCellInstance
43
43
  from ansys.edb.core.hierarchy.component_group import ComponentType as GrpcComponentType
44
- from ansys.edb.core.layer.layer import LayerType as GrpcLayerType
45
- from ansys.edb.core.layer.layer import TopBottomAssociation as GrpcTopBottomAssociation
44
+ from ansys.edb.core.layer.layer import LayerType as GrpcLayerType, TopBottomAssociation as GrpcTopBottomAssociation
46
45
  from ansys.edb.core.layer.layer_collection import (
46
+ LayerCollection as GrpcLayerCollection,
47
47
  LayerCollectionMode as GrpcLayerCollectionMode,
48
+ LayerTypeSet as GrpcLayerTypeSet,
48
49
  )
49
- from ansys.edb.core.layer.layer_collection import LayerCollection as GrpcLayerCollection
50
- from ansys.edb.core.layer.layer_collection import LayerTypeSet as GrpcLayerTypeSet
51
50
  from ansys.edb.core.layer.stackup_layer import StackupLayer as GrpcStackupLayer
52
51
  from ansys.edb.core.layout.mcad_model import McadModel as GrpcMcadModel
53
52
 
@@ -128,8 +127,9 @@ class LayerCollection(GrpcLayerCollection):
128
127
  --------
129
128
  >>> from pyedb import Edb
130
129
  >>> edb = Edb()
131
- >>> top_layer = edb.stackup.add_layer_top("NewTopLayer", layer_type="signal", thickness="0.1mm",
132
- ... material="copper")
130
+ >>> top_layer = edb.stackup.add_layer_top(
131
+ ... "NewTopLayer", layer_type="signal", thickness="0.1mm", material="copper"
132
+ ... )
133
133
  """
134
134
  thickness = Value(0.0)
135
135
  if "thickness" in kwargs:
@@ -167,8 +167,9 @@ class LayerCollection(GrpcLayerCollection):
167
167
  --------
168
168
  >>> from pyedb import Edb
169
169
  >>> edb = Edb()
170
- >>> bot_layer = edb.stackup.add_layer_bottom("NewBottomLayer", layer_type="signal", thickness="0.1mm",
171
- ... material="copper")
170
+ >>> bot_layer = edb.stackup.add_layer_bottom(
171
+ ... "NewBottomLayer", layer_type="signal", thickness="0.1mm", material="copper"
172
+ ... )
172
173
  """
173
174
  thickness = Value(0.0)
174
175
  layer_type_map = {"dielectric": GrpcLayerType.DIELECTRIC_LAYER, "signal": GrpcLayerType.SIGNAL_LAYER}
@@ -1189,8 +1190,11 @@ class Stackup(LayerCollection):
1189
1190
  sball_prop = cmp_prop.solder_ball_property
1190
1191
  sball_prop.placement = GrpcSolderballPlacement.ABOVE_PADSTACK
1191
1192
  cmp_prop.solder_ball_property = sball_prop
1192
- except:
1193
- pass
1193
+ except Exception as e:
1194
+ self._logger.warning(
1195
+ f"A(n) {type(e).__name__} error occurred while attempting to update "
1196
+ f"solder_ball_property for component {cmp}: {str(e)}"
1197
+ )
1194
1198
  if cmp_type == GrpcComponentType.IC:
1195
1199
  die_prop = cmp_prop.die_property
1196
1200
  chip_orientation = die_prop.die_orientation
@@ -1236,8 +1240,11 @@ class Stackup(LayerCollection):
1236
1240
  try:
1237
1241
  if val.solder_ball_height and val.placement_layer == layer_name:
1238
1242
  height = val.solder_ball_height
1239
- except:
1240
- pass
1243
+ except Exception as e:
1244
+ self._logger.error(
1245
+ f"A(n) {type(e).__name__} error occurred while attempting to retrieve solder_height "
1246
+ f"for layer {layer_name} - Default value of 0.0 is returned: {str(e)}"
1247
+ )
1241
1248
  return height
1242
1249
 
1243
1250
  def _remove_solder_pec(self, layer_name):
@@ -1330,15 +1337,21 @@ class Stackup(LayerCollection):
1330
1337
  >>> mounted_cmp = edb2.components.get_component_by_name("BGA")
1331
1338
 
1332
1339
  >>> vector, rotation, solder_ball_height = edb1.components.get_component_placement_vector(
1333
- ... mounted_component=mounted_cmp,
1334
- ... hosting_component=hosting_cmp,
1335
- ... mounted_component_pin1="A12",
1336
- ... mounted_component_pin2="A14",
1337
- ... hosting_component_pin1="A12",
1338
- ... hosting_component_pin2="A14")
1339
- >>> edb2.stackup.place_in_layout(edb1.active_cell, angle=0.0, offset_x=vector[0],
1340
- ... offset_y=vector[1], flipped_stackup=False, place_on_top=True,
1341
- ... )
1340
+ ... mounted_component=mounted_cmp,
1341
+ ... hosting_component=hosting_cmp,
1342
+ ... mounted_component_pin1="A12",
1343
+ ... mounted_component_pin2="A14",
1344
+ ... hosting_component_pin1="A12",
1345
+ ... hosting_component_pin2="A14",
1346
+ ... )
1347
+ >>> edb2.stackup.place_in_layout(
1348
+ ... edb1.active_cell,
1349
+ ... angle=0.0,
1350
+ ... offset_x=vector[0],
1351
+ ... offset_y=vector[1],
1352
+ ... flipped_stackup=False,
1353
+ ... place_on_top=True,
1354
+ ... )
1342
1355
  """
1343
1356
  # if flipped_stackup and place_on_top or (not flipped_stackup and not place_on_top):
1344
1357
  self.adjust_solder_dielectrics()
@@ -1418,9 +1431,14 @@ class Stackup(LayerCollection):
1418
1431
  >>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2")
1419
1432
  >>> hosting_cmp = edb1.components.get_component_by_name("U100")
1420
1433
  >>> mounted_cmp = edb2.components.get_component_by_name("BGA")
1421
- >>> edb2.stackup.place_in_layout(edb1.active_cell, angle=0.0, offset_x="1mm",
1422
- ... offset_y="2mm", flipped_stackup=False, place_on_top=True,
1423
- ... )
1434
+ >>> edb2.stackup.place_in_layout(
1435
+ ... edb1.active_cell,
1436
+ ... angle=0.0,
1437
+ ... offset_x="1mm",
1438
+ ... offset_y="2mm",
1439
+ ... flipped_stackup=False,
1440
+ ... place_on_top=True,
1441
+ ... )
1424
1442
  """
1425
1443
  _angle = angle * math.pi / 180.0
1426
1444
 
@@ -1678,9 +1696,14 @@ class Stackup(LayerCollection):
1678
1696
  --------
1679
1697
  >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2")
1680
1698
  >>> a3dcomp_path = "connector.a3dcomp"
1681
- >>> edb1.stackup.place_a3dcomp_3d_placement(a3dcomp_path, angle=0.0, offset_x="1mm",
1682
- ... offset_y="2mm", flipped_stackup=False, place_on_top=True,
1683
- ... )
1699
+ >>> edb1.stackup.place_a3dcomp_3d_placement(
1700
+ ... a3dcomp_path,
1701
+ ... angle=0.0,
1702
+ ... offset_x="1mm",
1703
+ ... offset_y="2mm",
1704
+ ... flipped_stackup=False,
1705
+ ... place_on_top=True,
1706
+ ... )
1684
1707
  """
1685
1708
  rotation_axis_from = GrpcPoint3DData(1.0, 0.0, 0.0)
1686
1709
  _angle = angle * math.pi / 180.0
@@ -20,15 +20,20 @@
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 __future__ import annotations
24
+
25
+ from typing import TYPE_CHECKING
26
+
27
+ if TYPE_CHECKING:
28
+ from pyedb.grpc.database.hierarchy.component import Component
29
+ from pyedb.grpc.database.net.net import Net
23
30
  from ansys.edb.core.terminal.bundle_terminal import BundleTerminal as GrpcBundleTerminal
24
31
  from ansys.edb.core.terminal.terminal import (
32
+ HfssPIType as GrpcHfssPIType,
25
33
  SourceTermToGroundType as GrpcSourceTermToGroundType,
26
34
  )
27
- from ansys.edb.core.terminal.terminal import HfssPIType as GrpcHfssPIType
28
35
 
29
- from pyedb.grpc.database.hierarchy.component import Component
30
36
  from pyedb.grpc.database.layers.layer import Layer
31
- from pyedb.grpc.database.net.net import Net
32
37
  from pyedb.grpc.database.terminal.terminal import Terminal
33
38
  from pyedb.grpc.database.utility.rlc import Rlc
34
39
  from pyedb.grpc.database.utility.value import Value
@@ -77,6 +82,7 @@ class BundleTerminal(GrpcBundleTerminal):
77
82
  -------
78
83
  :class:`Component <pyedb.grpc.database.hierarchy.component.Component`
79
84
  """
85
+
80
86
  return Component(self._pedb, self.component)
81
87
 
82
88
  @property
@@ -102,6 +108,7 @@ class BundleTerminal(GrpcBundleTerminal):
102
108
  -------
103
109
  :class:`Net <pyedb.grpc.database.net.net.Net>`
104
110
  """
111
+
105
112
  return Net(self._pedb, self.net)
106
113
 
107
114
  @property
@@ -20,12 +20,17 @@
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 __future__ import annotations
24
+
25
+ from typing import TYPE_CHECKING
26
+
27
+ if TYPE_CHECKING:
28
+ from pyedb.grpc.database.net.net import Net
23
29
  from ansys.edb.core.terminal.pin_group_terminal import (
24
30
  PinGroupTerminal as GrpcPinGroupTerminal,
25
31
  )
26
32
  from ansys.edb.core.terminal.terminal import BoundaryType as GrpcBoundaryType
27
33
 
28
- from pyedb.grpc.database.net.net import Net
29
34
  from pyedb.grpc.database.utility.value import Value
30
35
  from pyedb.misc.decorators import deprecated_property
31
36
 
@@ -151,6 +156,8 @@ class PinGroupTerminal(GrpcPinGroupTerminal):
151
156
  Terminal Net object.
152
157
 
153
158
  """
159
+ from pyedb.grpc.database.net.net import Net
160
+
154
161
  return Net(self._pedb, super().net)
155
162
 
156
163
  @net.setter
@@ -20,14 +20,21 @@
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 __future__ import annotations
24
+
25
+ from typing import TYPE_CHECKING
26
+
27
+ if TYPE_CHECKING:
28
+ from pyedb.grpc.database.primitive.padstack_instance import PadstackInstance
23
29
  import re
24
30
 
25
31
  from ansys.edb.core.terminal.edge_terminal import EdgeType as GrpcEdgeType
26
- from ansys.edb.core.terminal.terminal import BoundaryType as GrpcBoundaryType
27
- from ansys.edb.core.terminal.terminal import Terminal as GrpcTerminal
28
- from ansys.edb.core.terminal.terminal import TerminalType as GrpcTerminalType
32
+ from ansys.edb.core.terminal.terminal import (
33
+ BoundaryType as GrpcBoundaryType,
34
+ Terminal as GrpcTerminal,
35
+ TerminalType as GrpcTerminalType,
36
+ )
29
37
 
30
- from pyedb.grpc.database.primitive.padstack_instance import PadstackInstance
31
38
  from pyedb.grpc.database.primitive.primitive import Primitive
32
39
  from pyedb.grpc.database.utility.value import Value
33
40
 
@@ -364,13 +371,17 @@ class Terminal(GrpcTerminal):
364
371
  return (primitive, self._pedb)
365
372
  return None # pragma: no cover
366
373
 
367
- def get_point_terminal_reference_primitive(self) -> Primitive: # pragma : no cover
368
- """Find and return the primitive reference for the point terminal or the padstack instance.
374
+ def get_point_terminal_reference_primitive(self) -> Primitive:
375
+ """
376
+ Find and return the primitive reference for the point terminal or the padstack instance.
369
377
 
370
378
  Returns
371
379
  -------
372
- :class:`PadstackInstance <pyedb.grpc.database.primitive.padstack_instance.PadstackInstance>` or
373
- :class:`Primitive <pyedb.grpc.database.primitive.primitive.Primitive>`
380
+ Primitive or PadstackInstance
381
+ The primitive reference for the point terminal or the padstack instance.
382
+ Returns an instance of :class:`PadstackInstance
383
+ <pyedb.grpc.database.primitive.padstack_instance.PadstackInstance>`
384
+ or :class:`Primitive <pyedb.grpc.database.primitive.primitive.Primitive>`.
374
385
  """
375
386
 
376
387
  ref_term = self.reference_terminal # return value is type terminal
@@ -27,7 +27,6 @@ from ansys.edb.core.utility.value import Value as GrpcValue
27
27
 
28
28
 
29
29
  class HeatSink:
30
-
31
30
  """Heatsink model description.
32
31
 
33
32
  Parameters
@@ -21,10 +21,10 @@
21
21
  # SOFTWARE.
22
22
 
23
23
  from ansys.edb.core.utility.hfss_extent_info import (
24
+ HfssExtentInfo as GrpcHfssExtentInfo,
24
25
  HFSSExtentInfoType as GrpcHfssExtentInfoType,
26
+ OpenRegionType as GrpcOpenRegionType,
25
27
  )
26
- from ansys.edb.core.utility.hfss_extent_info import HfssExtentInfo as GrpcHfssExtentInfo
27
- from ansys.edb.core.utility.hfss_extent_info import OpenRegionType as GrpcOpenRegionType
28
28
  from ansys.edb.core.utility.value import Value as GrpcValue
29
29
 
30
30
 
@@ -122,7 +122,7 @@ class ControlProperty:
122
122
  float(value)
123
123
  self.type = 0
124
124
  except TypeError:
125
- pass
125
+ self.type = -1
126
126
 
127
127
  def _write_xml(self, root):
128
128
  try:
@@ -132,8 +132,11 @@ class ControlProperty:
132
132
  double.text = str(self.value)
133
133
  else:
134
134
  pass
135
- except:
136
- pass
135
+ except Exception as e:
136
+ settings.logger.error(
137
+ f"A(n) {type(e).__name__} error occurred while attempting to create a new sub-element {self.name} "
138
+ f"for element {root}: {str(e)}"
139
+ )
137
140
 
138
141
 
139
142
  class ControlFileMaterial:
pyedb/grpc/edb.py CHANGED
@@ -658,8 +658,7 @@ class Edb(EdbInit):
658
658
  bool
659
659
  True if successful, False otherwise.
660
660
  """
661
- from ansys.edb.core.layout.cell import Cell as GrpcCell
662
- from ansys.edb.core.layout.cell import CellType as GrpcCellType
661
+ from ansys.edb.core.layout.cell import Cell as GrpcCell, CellType as GrpcCellType
663
662
 
664
663
  self.standalone = self.standalone
665
664
  n_try = 10
@@ -1191,7 +1190,7 @@ class Edb(EdbInit):
1191
1190
  continue
1192
1191
  except:
1193
1192
  self.logger.warning(
1194
- f"Failed to find connected objects on layout_obj " f"{layout_object_instance.layout_obj.id}, skipping."
1193
+ f"Failed to find connected objects on layout_obj {layout_object_instance.layout_obj.id}, skipping."
1195
1194
  )
1196
1195
  pass
1197
1196
  return temp
@@ -1399,7 +1398,7 @@ class Edb(EdbInit):
1399
1398
  command = [
1400
1399
  anstranslator_full_path,
1401
1400
  inputGDS,
1402
- f'-o="{control_file_temp}"' f'-t="{tech_file}"',
1401
+ f'-o="{control_file_temp}"-t="{tech_file}"',
1403
1402
  f'-g="{map_file}"',
1404
1403
  f'-f="{layer_filter}"',
1405
1404
  ]
@@ -1568,8 +1567,11 @@ class Edb(EdbInit):
1568
1567
  voids_poly.append(void_polydata)
1569
1568
  if voids_poly:
1570
1569
  obj_data = obj_data[0].subtract(list(obj_data), voids_poly)
1571
- except:
1572
- pass
1570
+ except Exception as e:
1571
+ self.logger.error(
1572
+ f"A(n) {type(e).__name__} error occurred in method _create_conformal of "
1573
+ f"class Edb at iteration {k} for data {i}: {str(e)}"
1574
+ )
1573
1575
  finally:
1574
1576
  unite_polys.extend(list(obj_data))
1575
1577
  _poly_unite = GrpcPolygonData.unite(unite_polys)
@@ -1734,7 +1736,7 @@ class Edb(EdbInit):
1734
1736
  >>> # Create a basic cutout:
1735
1737
  >>> edb.cutout(signal_list=["Net1"], reference_list=["GND"])
1736
1738
  >>> # Create cutout with custom polygon:
1737
- >>> custom_poly = [[0,0], [10e-3,0], [10e-3,10e-3], [0,10e-3]]
1739
+ >>> custom_poly = [[0, 0], [10e-3, 0], [10e-3, 10e-3], [0, 10e-3]]
1738
1740
  >>> edb.cutout(custom_extent=custom_poly)
1739
1741
  """
1740
1742
  if expansion_factor > 0:
@@ -1940,8 +1942,8 @@ class Edb(EdbInit):
1940
1942
  if os.path.exists(source) and not os.path.exists(target):
1941
1943
  try:
1942
1944
  shutil.copy(source, target)
1943
- except:
1944
- pass
1945
+ except Exception as e:
1946
+ self.logger.error(f"Failed to copy {source} to {target} - {type(e).__name__}: {str(e)}")
1945
1947
  elif open_cutout_at_end:
1946
1948
  self._active_cell = _cutout
1947
1949
  self._init_objects()
@@ -2419,8 +2421,8 @@ class Edb(EdbInit):
2419
2421
  try:
2420
2422
  shutil.copy(source, target)
2421
2423
  self.logger.warning("aedb def file manually created.")
2422
- except:
2423
- pass
2424
+ except Exception as e:
2425
+ self.logger.error(f"Failed to copy {source} to {target} - {type(e).__name__}: {str(e)}")
2424
2426
  return [[Value(pt.x), Value(pt.y)] for pt in polygon_data.without_arcs().points]
2425
2427
 
2426
2428
  @staticmethod
@@ -2599,8 +2601,10 @@ class Edb(EdbInit):
2599
2601
  process = SiwaveSolve(self)
2600
2602
  try:
2601
2603
  self.close()
2602
- except:
2603
- pass
2604
+ except Exception as e:
2605
+ self.logger.warning(
2606
+ f"A(n) {type(e).__name__} error occurred while attempting to close the database {self}: {str(e)}"
2607
+ )
2604
2608
  process.solve()
2605
2609
  return self.edbpath[:-5] + ".siw"
2606
2610
 
@@ -2650,8 +2654,10 @@ class Edb(EdbInit):
2650
2654
  process = SiwaveSolve(self)
2651
2655
  try:
2652
2656
  self.close()
2653
- except:
2654
- pass
2657
+ except Exception as e:
2658
+ self.logger.warning(
2659
+ f"A(n) {type(e).__name__} error occurred while attempting to close the database {self}: {str(e)}"
2660
+ )
2655
2661
  return process.export_dc_report(
2656
2662
  siwave_project,
2657
2663
  solution_name,
@@ -3009,7 +3015,7 @@ class Edb(EdbInit):
3009
3015
  Use :func:`pyedb.grpc.core.hfss.add_setup` instead.
3010
3016
  """
3011
3017
  warnings.warn(
3012
- "`create_hfss_setup` is deprecated and is now located here " "`pyedb.grpc.core.hfss.add_setup` instead.",
3018
+ "`create_hfss_setup` is deprecated and is now located here `pyedb.grpc.core.hfss.add_setup` instead.",
3013
3019
  DeprecationWarning,
3014
3020
  )
3015
3021
  return self._hfss.add_setup(
@@ -3757,8 +3763,7 @@ class Edb(EdbInit):
3757
3763
  ]
3758
3764
  if not polys:
3759
3765
  self.logger.error(
3760
- f"No polygon found with voids on layer {reference_layer} during model creation for "
3761
- f"arbitrary wave ports"
3766
+ f"No polygon found with voids on layer {reference_layer} during model creation for arbitrary wave ports"
3762
3767
  )
3763
3768
  return False
3764
3769
  void_padstacks = []
@@ -3771,7 +3776,7 @@ class Edb(EdbInit):
3771
3776
 
3772
3777
  if not void_padstacks:
3773
3778
  self.logger.error(
3774
- "No padstack instances found inside evaluated voids during model creation for arbitrary" "waveports"
3779
+ "No padstack instances found inside evaluated voids during model creation for arbitrary waveports"
3775
3780
  )
3776
3781
  return False
3777
3782
  cloned_edb = Edb(edbpath=output_edb, edbversion=self.edbversion, restart_rpc_server=True)
pyedb/grpc/edb_init.py CHANGED
@@ -22,6 +22,7 @@
22
22
 
23
23
 
24
24
  """Database."""
25
+
25
26
  import atexit
26
27
  import os
27
28
  import signal