pyedb 0.55.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 (107) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_data.py +3 -0
  3. pyedb/configuration/cfg_operations.py +2 -2
  4. pyedb/configuration/cfg_ports_sources.py +1 -1
  5. pyedb/configuration/cfg_terminals.py +232 -0
  6. pyedb/configuration/configuration.py +146 -3
  7. pyedb/dotnet/clr_module.py +1 -2
  8. pyedb/dotnet/database/Variables.py +56 -41
  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 +55 -52
  15. pyedb/dotnet/database/dotnet/database.py +1 -0
  16. pyedb/dotnet/database/edb_data/control_file.py +6 -3
  17. pyedb/dotnet/database/edb_data/nets_data.py +3 -3
  18. pyedb/dotnet/database/edb_data/padstacks_data.py +5 -2
  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/hfss.py +9 -8
  24. pyedb/dotnet/database/layout_validation.py +6 -3
  25. pyedb/dotnet/database/materials.py +1 -3
  26. pyedb/dotnet/database/modeler.py +7 -3
  27. pyedb/dotnet/database/nets.py +27 -19
  28. pyedb/dotnet/database/padstack.py +91 -2
  29. pyedb/dotnet/database/sim_setup_data/io/siwave.py +1 -1
  30. pyedb/dotnet/database/siwave.py +4 -3
  31. pyedb/dotnet/database/stackup.py +50 -26
  32. pyedb/dotnet/database/utilities/heatsink.py +0 -1
  33. pyedb/dotnet/database/utilities/simulation_setup.py +7 -5
  34. pyedb/dotnet/database/utilities/siwave_cpa_simulation_setup.py +1 -0
  35. pyedb/dotnet/database/utilities/siwave_simulation_setup.py +5 -2
  36. pyedb/dotnet/edb.py +41 -36
  37. pyedb/exceptions.py +1 -2
  38. pyedb/extensions/create_cell_array.py +408 -0
  39. pyedb/generic/data_handlers.py +17 -28
  40. pyedb/generic/design_types.py +25 -38
  41. pyedb/generic/filesystem.py +9 -4
  42. pyedb/generic/general_methods.py +6 -7
  43. pyedb/generic/plot.py +2 -2
  44. pyedb/generic/settings.py +4 -0
  45. pyedb/grpc/database/_typing.py +0 -0
  46. pyedb/grpc/database/components.py +30 -11
  47. pyedb/grpc/database/control_file.py +14 -35
  48. pyedb/grpc/database/definition/materials.py +1 -1
  49. pyedb/grpc/database/definition/package_def.py +6 -3
  50. pyedb/grpc/database/definition/padstack_def.py +4 -7
  51. pyedb/grpc/database/hfss.py +1 -4
  52. pyedb/grpc/database/hierarchy/component.py +3 -4
  53. pyedb/grpc/database/hierarchy/pingroup.py +16 -3
  54. pyedb/grpc/database/layers/layer.py +1 -2
  55. pyedb/grpc/database/layers/stackup_layer.py +42 -19
  56. pyedb/grpc/database/layout/layout.py +117 -28
  57. pyedb/grpc/database/layout/voltage_regulator.py +6 -1
  58. pyedb/grpc/database/layout_validation.py +7 -4
  59. pyedb/grpc/database/modeler.py +241 -256
  60. pyedb/grpc/database/net/differential_pair.py +9 -2
  61. pyedb/grpc/database/net/extended_net.py +24 -9
  62. pyedb/grpc/database/net/net.py +14 -5
  63. pyedb/grpc/database/net/net_class.py +24 -7
  64. pyedb/grpc/database/nets.py +11 -43
  65. pyedb/grpc/database/padstacks.py +92 -16
  66. pyedb/grpc/database/primitive/bondwire.py +3 -67
  67. pyedb/grpc/database/primitive/circle.py +42 -3
  68. pyedb/grpc/database/primitive/padstack_instance.py +17 -19
  69. pyedb/grpc/database/primitive/path.py +154 -5
  70. pyedb/grpc/database/primitive/polygon.py +75 -9
  71. pyedb/grpc/database/primitive/primitive.py +2 -2
  72. pyedb/grpc/database/primitive/rectangle.py +105 -4
  73. pyedb/grpc/database/simulation_setup/hfss_general_settings.py +0 -2
  74. pyedb/grpc/database/simulation_setup/hfss_settings_options.py +0 -4
  75. pyedb/grpc/database/simulation_setup/siwave_cpa_simulation_setup.py +4 -2
  76. pyedb/grpc/database/simulation_setup/sweep_data.py +1 -3
  77. pyedb/grpc/database/siwave.py +6 -13
  78. pyedb/grpc/database/source_excitations.py +49 -57
  79. pyedb/grpc/database/stackup.py +50 -27
  80. pyedb/grpc/database/terminal/bundle_terminal.py +10 -3
  81. pyedb/grpc/database/terminal/pingroup_terminal.py +8 -1
  82. pyedb/grpc/database/terminal/terminal.py +19 -8
  83. pyedb/grpc/database/utility/heat_sink.py +0 -1
  84. pyedb/grpc/database/utility/hfss_extent_info.py +2 -2
  85. pyedb/grpc/database/utility/value.py +1 -0
  86. pyedb/grpc/database/utility/xml_control_file.py +6 -3
  87. pyedb/grpc/edb.py +33 -24
  88. pyedb/grpc/edb_init.py +1 -0
  89. pyedb/grpc/rpc_session.py +4 -3
  90. pyedb/ipc2581/ecad/cad_data/layer_feature.py +6 -2
  91. pyedb/ipc2581/ecad/cad_data/step.py +1 -1
  92. pyedb/ipc2581/ipc2581.py +8 -7
  93. pyedb/libraries/common.py +3 -4
  94. pyedb/libraries/rf_libraries/base_functions.py +7 -16
  95. pyedb/libraries/rf_libraries/planar_antennas.py +3 -21
  96. pyedb/misc/downloads.py +1 -0
  97. pyedb/misc/misc.py +5 -2
  98. pyedb/misc/siw_feature_config/emc_rule_checker_settings.py +1 -1
  99. pyedb/misc/utilities.py +0 -1
  100. pyedb/modeler/geometry_operators.py +9 -8
  101. pyedb/siwave.py +4 -6
  102. pyedb/siwave_core/__init__.py +0 -0
  103. pyedb/siwave_core/cpa/__init__.py +0 -0
  104. {pyedb-0.55.0.dist-info → pyedb-0.57.0.dist-info}/METADATA +3 -3
  105. {pyedb-0.55.0.dist-info → pyedb-0.57.0.dist-info}/RECORD +107 -102
  106. {pyedb-0.55.0.dist-info → pyedb-0.57.0.dist-info}/WHEEL +0 -0
  107. {pyedb-0.55.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))
@@ -2799,11 +2781,15 @@ class SourceExcitation:
2799
2781
  self,
2800
2782
  terminal: Union[PadstackInstanceTerminal, EdgeTerminal],
2801
2783
  ref_terminal: Union[PadstackInstanceTerminal, EdgeTerminal],
2784
+ magnitude: Union[int, float] = 1,
2785
+ phase: Union[int, float] = 0,
2802
2786
  ) -> bool:
2803
2787
  """Create a voltage source.
2804
2788
 
2805
2789
  Parameters
2806
2790
  ----------
2791
+ name : str, optional
2792
+ Voltage source name
2807
2793
  terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`,
2808
2794
  :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PadstackInstanceTerminal>`,
2809
2795
  :class:`PointTerminal <pyedb.grpc.database.terminals.PointTerminal>`,
@@ -2814,6 +2800,10 @@ class SourceExcitation:
2814
2800
  :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PointTerminal>`,
2815
2801
  :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`,
2816
2802
  Negative terminal of the source.
2803
+ magnitude : int, float, optional
2804
+ Magnitude of the source.
2805
+ phase : int, float, optional
2806
+ Phase of the source
2817
2807
 
2818
2808
  Returns
2819
2809
  -------
@@ -2832,7 +2822,8 @@ class SourceExcitation:
2832
2822
 
2833
2823
  ref_term = Terminal(self._pedb, ref_terminal)
2834
2824
  ref_term.boundary_type = "voltage_source"
2835
-
2825
+ term.magnitude = self._pedb.value(magnitude)
2826
+ term.phase = self._pedb.value(phase)
2836
2827
  term.ref_terminal = ref_terminal
2837
2828
  return term
2838
2829
 
@@ -3072,8 +3063,9 @@ class SourceExcitation:
3072
3063
  --------
3073
3064
  >>> from pyedb import Edb
3074
3065
  >>> edb = Edb()
3075
- >>> probe = edb.source_excitation.place_voltage_probe("Probe1", "Net1", [0,0], "TopLayer",
3076
- ... "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
+ ... )
3077
3069
  """
3078
3070
  p_terminal = PointTerminal.create(
3079
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
 
@@ -19,6 +19,7 @@
19
19
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  # SOFTWARE.
22
+
22
23
  import ansys.edb.core.utility.value
23
24
  from ansys.edb.core.utility.value import Value as GrpcValue
24
25
 
@@ -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: