pyedb 0.50.1__py3-none-any.whl → 0.52.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 (37) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_ports_sources.py +79 -239
  3. pyedb/configuration/configuration.py +213 -340
  4. pyedb/dotnet/clr_module.py +9 -3
  5. pyedb/dotnet/database/cell/layout.py +10 -1
  6. pyedb/dotnet/database/dotnet/database.py +0 -2
  7. pyedb/dotnet/database/edb_data/padstacks_data.py +8 -2
  8. pyedb/dotnet/database/layout_validation.py +20 -26
  9. pyedb/dotnet/database/modeler.py +0 -1
  10. pyedb/dotnet/database/stackup.py +4 -3
  11. pyedb/dotnet/edb.py +42 -2
  12. pyedb/generic/design_types.py +183 -62
  13. pyedb/grpc/database/__init__.py +0 -1
  14. pyedb/grpc/database/components.py +110 -0
  15. pyedb/grpc/database/control_file.py +150 -17
  16. pyedb/grpc/database/definition/materials.py +7 -7
  17. pyedb/grpc/database/definitions.py +36 -2
  18. pyedb/grpc/database/hfss.py +15 -0
  19. pyedb/grpc/database/hierarchy/component.py +10 -2
  20. pyedb/grpc/database/hierarchy/pin_pair_model.py +1 -1
  21. pyedb/grpc/database/layout_validation.py +58 -7
  22. pyedb/grpc/database/net/differential_pair.py +2 -1
  23. pyedb/grpc/database/nets.py +233 -4
  24. pyedb/grpc/database/padstacks.py +97 -0
  25. pyedb/grpc/database/primitive/padstack_instance.py +1 -1
  26. pyedb/grpc/database/primitive/polygon.py +1 -1
  27. pyedb/grpc/database/siwave.py +63 -3
  28. pyedb/grpc/database/source_excitations.py +317 -50
  29. pyedb/grpc/database/stackup.py +107 -2
  30. pyedb/grpc/database/terminal/point_terminal.py +2 -2
  31. pyedb/grpc/database/terminal/terminal.py +1 -1
  32. pyedb/grpc/edb.py +190 -224
  33. pyedb/grpc/edb_init.py +54 -5
  34. {pyedb-0.50.1.dist-info → pyedb-0.52.0.dist-info}/METADATA +4 -4
  35. {pyedb-0.50.1.dist-info → pyedb-0.52.0.dist-info}/RECORD +37 -37
  36. {pyedb-0.50.1.dist-info → pyedb-0.52.0.dist-info}/LICENSE +0 -0
  37. {pyedb-0.50.1.dist-info → pyedb-0.52.0.dist-info}/WHEEL +0 -0
@@ -49,6 +49,159 @@ from pyedb.modeler.geometry_operators import GeometryOperators
49
49
 
50
50
 
51
51
  class SourceExcitation:
52
+ """Manage sources and excitations.
53
+
54
+ Examples
55
+ --------
56
+ >>> # Initialize EDB session
57
+ >>> from pyedb import Edb
58
+ >>> edb = Edb(edbpath="path/to/your/edb")
59
+
60
+ >>> # Access SourceExcitation class
61
+ >>> source_excitations = edb.source_excitation
62
+
63
+ >>> # 1. create_source_on_component
64
+ >>> # Create voltage source on component pins
65
+ >>> from pyedb.grpc.database.utility.sources import Source, SourceType
66
+ >>> source = Source(
67
+ >>> source_type=SourceType.Vsource,
68
+ >>> name="V1",
69
+ >>> positive_node=("U1", "VCC"),
70
+ >>> negative_node=("U1", "GND"),
71
+ >>> amplitude="1V",
72
+ >>> phase="0deg",
73
+ >>> impedance="50ohm"
74
+ >>> )
75
+ >>> source_excitations.create_source_on_component([source])
76
+
77
+ >>> # 2. create_port
78
+ >>> # Create port between two terminals
79
+ >>> pos_terminal = edb.terminals["MyTerminal"]
80
+ >>> ref_terminal = edb.terminals["MyRefTerminal"]
81
+ >>> port = source_excitations.create_port(pos_terminal, ref_terminal)
82
+
83
+ >>> # 3. create_port_on_pins
84
+ >>> # Create circuit port between component pins
85
+ >>> port_term = source_excitations.create_port_on_pins(
86
+ >>> refdes="U1",
87
+ >>> pins="Pin1",
88
+ >>> reference_pins=["GND_Pin1", "GND_Pin2"],
89
+ >>> impedance=50,
90
+ >>> port_name="Port1"
91
+ >>> )
92
+
93
+ >>> # 4. create_port_on_component
94
+ >>> # Create coaxial ports on component nets
95
+ >>> source_excitations.create_port_on_component(
96
+ >>> component="U1",
97
+ >>> net_list=["PCIe_RX0", "PCIe_RX1"],
98
+ >>> port_type=SourceType.CoaxPort,
99
+ >>> reference_net="GND"
100
+ >>> )
101
+
102
+ >>> # 5. add_port_on_rlc_component
103
+ >>> # Replace RLC component with circuit port
104
+ >>> source_excitations.add_port_on_rlc_component("R1")
105
+
106
+ >>> # 6. _create_terminal (Internal method - typically not called directly)
107
+
108
+ >>> # 7. _create_pin_group_terminal (Internal method)
109
+
110
+ >>> # 8. create_coax_port
111
+ >>> # Create coaxial port on padstack
112
+ >>> pin = edb.components["U1"].pins["Pin1"]
113
+ >>> port_name = source_excitations.create_coax_port(pin)
114
+
115
+ >>> # 9. create_circuit_port_on_pin
116
+ >>> # Create circuit port between two pins
117
+ >>> pin1 = edb.components["U1"].pins["Pin1"]
118
+ >>> pin2 = edb.components["U1"].pins["Pin2"]
119
+ >>> port_name = source_excitations.create_circuit_port_on_pin(pin1, pin2, 50, "Port1")
120
+
121
+ >>> # 10. create_voltage_source_on_pin
122
+ >>> # Create voltage source between pins
123
+ >>> source_name = source_excitations.create_voltage_source_on_pin(pin1, pin2, 3.3, 0, "V1")
124
+
125
+ >>> # 11. create_current_source_on_pin
126
+ >>> # Create current source between pins
127
+ >>> source_name = source_excitations.create_current_source_on_pin(pin1, pin2, 0.1, 0, "I1")
128
+
129
+ >>> # 12. create_resistor_on_pin
130
+ >>> # Create resistor between pins
131
+ >>> res_name = source_excitations.create_resistor_on_pin(pin1, pin2, 100, "R1")
132
+
133
+ >>> # 13. create_circuit_port_on_net
134
+ >>> # Create port between component nets
135
+ >>> port_name = source_excitations.create_circuit_port_on_net(
136
+ >>> "U1", "SignalNet", "U1", "GND", 50, "Port1"
137
+ >>> )
138
+
139
+ >>> # 14. create_voltage_source_on_net
140
+ >>> # Create voltage source between nets
141
+ >>> source_name = source_excitations.create_voltage_source_on_net(
142
+ >>> "U1", "VCC", "U1", "GND", 5.0, 0, "VCC_Source"
143
+ >>> )
144
+
145
+ >>> # 15. create_current_source_on_net
146
+ >>> # Create current source between nets
147
+ >>> source_name = source_excitations.create_current_source_on_net(
148
+ >>> "U1", "InputNet", "U1", "GND", 0.02, 0, "InputCurrent"
149
+ >>> )
150
+
151
+ >>> # 16. create_coax_port_on_component
152
+ >>> # Create coaxial ports on component
153
+ >>> ports = source_excitations.create_coax_port_on_component(
154
+ >>> ["U1", "U2"],
155
+ >>> ["PCIe_RX0", "PCIe_TX0"],
156
+ >>> delete_existing_terminal=True
157
+ >>> )
158
+
159
+ >>> # 17. create_differential_wave_port
160
+ >>> # Create differential wave port
161
+ >>> pos_prim = edb.modeler.primitives[0]
162
+ >>> neg_prim = edb.modeler.primitives[1]
163
+ >>> port_name, diff_port = source_excitations.create_differential_wave_port(
164
+ >>> pos_prim.id, [0, 0],
165
+ >>> neg_prim.id, [0, 0.2],
166
+ >>> "DiffPort"
167
+ >>> )
168
+
169
+ >>> # 18. create_wave_port
170
+ >>> # Create wave port
171
+ >>> port_name, wave_port = source_excitations.create_wave_port(
172
+ >>> pos_prim.id, [0, 0],
173
+ >>> "WavePort"
174
+ >>> )
175
+
176
+ >>> # 19. create_bundle_wave_port
177
+ >>> # Create bundle wave port
178
+ >>> port_name, bundle_port = source_excitations.create_bundle_wave_port(
179
+ >>> [pos_prim.id, neg_prim.id],
180
+ >>> [[0,0], [0,0.2]],
181
+ >>> "BundlePort"
182
+ >>> )
183
+
184
+ >>> # 20. create_dc_terminal
185
+ >>> # Create DC terminal
186
+ >>> source_excitations.create_dc_terminal("U1", "VCC", "VCC_Terminal")
187
+
188
+ >>> # 21. create_voltage_probe
189
+ >>> # Create voltage probe
190
+ >>> probe = source_excitations.create_voltage_probe(term1, term2)
191
+
192
+ >>> # 22. place_voltage_probe
193
+ >>> # Place voltage probe between points
194
+ >>> source_excitations.place_voltage_probe(
195
+ >>> "Probe1",
196
+ >>> "SignalNet", [0, 0], "TopLayer",
197
+ >>> "GND", [0.1, 0.1], "BottomLayer"
198
+ >>> )
199
+
200
+ >>> # Save and close EDB
201
+ >>> edb.save()
202
+ >>> edb.close()
203
+ """
204
+
52
205
  def __init__(self, pedb):
53
206
  self._pedb = pedb
54
207
 
@@ -84,6 +237,13 @@ class SourceExcitation:
84
237
  bool
85
238
  ``True`` when successful, ``False`` when failed.
86
239
 
240
+ Examples
241
+ --------
242
+ >>> from pyedb import Edb
243
+ >>> from pyedb.grpc.utility.sources import Source, SourceType
244
+ >>> edb = Edb()
245
+ >>> source = Source(source_type=SourceType.Vsource, amplitude="1V", ...)
246
+ >>> edb.source_excitation.create_source_on_component([source])
87
247
  """
88
248
 
89
249
  if not sources: # pragma: no cover
@@ -178,6 +338,14 @@ class SourceExcitation:
178
338
  -------
179
339
  list: [:class:`GapPort <pyedb.grpc.database.ports.ports.GapPort`>,
180
340
  :class:`WavePort <pyedb.grpc.database.ports.ports.WavePort>`].
341
+
342
+ Examples
343
+ --------
344
+ >>> from pyedb import Edb
345
+ >>> edb = Edb()
346
+ >>> term = edb.terminals["MyTerminal"]
347
+ >>> ref_term = edb.terminals["RefTerminal"]
348
+ >>> port = edb.source_excitation.create_port(term, ref_term, name="Port1")
181
349
  """
182
350
 
183
351
  from ansys.edb.core.terminal.terminal import BoundaryType as GrpcBoundaryType
@@ -614,6 +782,12 @@ class SourceExcitation:
614
782
  -------
615
783
  bool
616
784
  ``True`` when successful, ``False`` when failed.
785
+
786
+ Examples
787
+ --------
788
+ >>> from pyedb import Edb
789
+ >>> edb = Edb()
790
+ >>> edb.source_excitation.add_port_on_rlc_component("R1")
617
791
  """
618
792
  from pyedb.grpc.database.components import Component
619
793
 
@@ -813,6 +987,12 @@ class SourceExcitation:
813
987
  str
814
988
  Terminal name.
815
989
 
990
+ Examples
991
+ --------
992
+ >>> from pyedb import Edb
993
+ >>> edb = Edb()
994
+ >>> pin = edb.padstacks.instances[0]
995
+ >>> edb.source_excitation.create_coax_port(pin, name="CoaxPort1")
816
996
  """
817
997
  if isinstance(padstackinstance, int):
818
998
  padstackinstance = self._pedb.padstacks.instances[padstackinstance]
@@ -1063,11 +1243,11 @@ class SourceExcitation:
1063
1243
 
1064
1244
  Examples
1065
1245
  --------
1066
-
1067
1246
  >>> from pyedb import Edb
1068
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
1069
- >>> pins = edbapp.components.get_pin_from_component("U2A5")
1070
- >>> edbapp.excitations.create_voltage_source_on_pin(pins[0], pins[1], 50, "source_name")
1247
+ >>> edb = Edb()
1248
+ >>> pin1 = edb.components["U1"].pins["VCC"]
1249
+ >>> pin2 = edb.components["U1"].pins["GND"]
1250
+ >>> edb.source_excitation.create_voltage_source_on_pin(pin1, pin2, 3.3, name="VSource1")
1071
1251
  """
1072
1252
 
1073
1253
  if not source_name:
@@ -1106,11 +1286,11 @@ class SourceExcitation:
1106
1286
 
1107
1287
  Examples
1108
1288
  --------
1109
-
1110
1289
  >>> from pyedb import Edb
1111
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
1112
- >>> pins = edbapp.components.get_pin_from_component("U2A5")
1113
- >>> edbapp.excitations.create_voltage_source_on_pin(pins[0], pins[1], 50, "source_name")
1290
+ >>> edb = Edb()
1291
+ >>> pin1 = edb.components["U1"].pins["IN"]
1292
+ >>> pin2 = edb.components["U1"].pins["GND"]
1293
+ >>> edb.source_excitation.create_current_source_on_pin(pin1, pin2, 0.1, name="ISource1")
1114
1294
  """
1115
1295
 
1116
1296
  if not source_name:
@@ -1147,11 +1327,11 @@ class SourceExcitation:
1147
1327
 
1148
1328
  Examples
1149
1329
  --------
1150
-
1151
1330
  >>> from pyedb import Edb
1152
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
1153
- >>> pins =edbapp.components.get_pin_from_component("U2A5")
1154
- >>> edbapp.excitation.create_resistor_on_pin(pins[0], pins[1],50,"res_name")
1331
+ >>> edb = Edb()
1332
+ >>> pin1 = edb.components["U1"].pins["R1_p"]
1333
+ >>> pin2 = edb.components["U1"].pins["R1_n"]
1334
+ >>> edb.source_excitation.create_resistor_on_pin(pin1, pin2, 50, "R1")
1155
1335
  """
1156
1336
  if not resistor_name:
1157
1337
  resistor_name = (
@@ -1197,10 +1377,9 @@ class SourceExcitation:
1197
1377
 
1198
1378
  Examples
1199
1379
  --------
1200
-
1201
1380
  >>> from pyedb import Edb
1202
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
1203
- >>> edbapp.excitations.create_circuit_port_on_net("U2A5", "V1P5_S3", "U2A5", "GND", 50, "port_name")
1381
+ >>> edb = Edb()
1382
+ >>> edb.source_excitation.create_circuit_port_on_net("U1", "VCC", "U1", "GND", 50, "PowerPort")
1204
1383
  """
1205
1384
  if not negative_component_name:
1206
1385
  negative_component_name = positive_component_name
@@ -1410,10 +1589,9 @@ class SourceExcitation:
1410
1589
 
1411
1590
  Examples
1412
1591
  --------
1413
-
1414
1592
  >>> from pyedb import Edb
1415
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
1416
- >>> edb.excitations.create_voltage_source_on_net("U2A5","V1P5_S3","U2A5","GND",3.3,0,"source_name")
1593
+ >>> edb = Edb()
1594
+ >>> edb.source_excitation.create_voltage_source_on_net("U1", "VCC", "U1", "GND", 3.3, name="VCC_Source")
1417
1595
  """
1418
1596
  if not negative_component_name:
1419
1597
  negative_component_name = positive_component_name
@@ -1474,10 +1652,10 @@ class SourceExcitation:
1474
1652
 
1475
1653
  Examples
1476
1654
  --------
1477
-
1478
1655
  >>> from pyedb import Edb
1479
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
1480
- >>> edb.excitations.create_voltage_source_on_net("U2A5","V1P5_S3","U2A5","GND",3.3,0,"source_name")
1656
+ >>> edb = Edb()
1657
+ >>> edb.source_excitation.create_current_source_on_net("U1", "INPUT", "U1", "GND", 0.1, name="InputCurrent")
1658
+ "InputCurrent"
1481
1659
  """
1482
1660
  if not negative_component_name:
1483
1661
  negative_component_name = positive_component_name
@@ -1522,6 +1700,11 @@ class SourceExcitation:
1522
1700
  bool
1523
1701
  ``True`` when successful, ``False`` when failed.
1524
1702
 
1703
+ Examples
1704
+ --------
1705
+ >>> from pyedb import Edb
1706
+ >>> edb = Edb()
1707
+ >>> edb.source_excitation.create_coax_port_on_component(["U1"], ["RF1", "RF2"])
1525
1708
  """
1526
1709
  coax = []
1527
1710
  if not isinstance(ref_des_list, list):
@@ -1621,7 +1804,9 @@ class SourceExcitation:
1621
1804
 
1622
1805
  Examples
1623
1806
  --------
1624
- >>> edb.hfss.create_differential_wave_port(0, ["-50mm", "-0mm"], 1, ["-50mm", "-0.2mm"])
1807
+ >>> from pyedb import Edb
1808
+ >>> edb = Edb()
1809
+ >>> port_name, port = edb.source_excitation.create_differential_wave_port(0, [0,0], 1, [0,0.2])
1625
1810
  """
1626
1811
  if not port_name:
1627
1812
  port_name = generate_unique_name("diff")
@@ -1693,7 +1878,9 @@ class SourceExcitation:
1693
1878
 
1694
1879
  Examples
1695
1880
  --------
1696
- >>> edb.excitations.create_wave_port(0, ["-50mm", "-0mm"])
1881
+ >>> from pyedb import Edb
1882
+ >>> edb = Edb()
1883
+ >>> port_name, port = edb.source_excitation.create_wave_port(0, [0,0])
1697
1884
  """
1698
1885
  if not port_name:
1699
1886
  port_name = generate_unique_name("Terminal_")
@@ -1756,6 +1943,12 @@ class SourceExcitation:
1756
1943
  -------
1757
1944
  str
1758
1945
  Port name.
1946
+
1947
+ Examples
1948
+ --------
1949
+ >>> from pyedb import Edb
1950
+ >>> edb = Edb()
1951
+ >>> term = edb.source_excitation.create_edge_port_vertical(0, [0,0], reference_layer="TopLayer")
1759
1952
  """
1760
1953
  if not port_name:
1761
1954
  port_name = generate_unique_name("Terminal_")
@@ -1822,6 +2015,12 @@ class SourceExcitation:
1822
2015
  -------
1823
2016
  str
1824
2017
  Name of the port.
2018
+
2019
+ Examples
2020
+ --------
2021
+ >>> from pyedb import Edb
2022
+ >>> edb = Edb()
2023
+ >>> edb.source_excitation.create_edge_port_horizontal(0, [0,0], 1, [0,0.1], "EdgePort")
1825
2024
  """
1826
2025
  pos_edge_term = self._create_edge_terminal(prim_id, point_on_edge, port_name)
1827
2026
  neg_edge_term = self._create_edge_terminal(ref_prim_id, point_on_ref_edge, port_name + "_ref", is_ref=True)
@@ -1842,7 +2041,7 @@ class SourceExcitation:
1842
2041
 
1843
2042
  def create_lumped_port_on_net(
1844
2043
  self, nets=None, reference_layer=None, return_points_only=False, digit_resolution=6, at_bounding_box=True
1845
- ):
2044
+ ) -> bool:
1846
2045
  """Create an edge port on nets. This command looks for traces and polygons on the
1847
2046
  nets and tries to assign vertical lumped port.
1848
2047
 
@@ -1870,6 +2069,12 @@ class SourceExcitation:
1870
2069
  -------
1871
2070
  bool
1872
2071
  ``True`` when successful, ``False`` when failed.
2072
+
2073
+ Examples
2074
+ --------
2075
+ >>> from pyedb import Edb
2076
+ >>> edb = Edb()
2077
+ >>> points = edb.source_excitation.create_lumped_port_on_net(["Net1"], return_points_only=True)
1873
2078
  """
1874
2079
  if isinstance(nets, str):
1875
2080
  nets = [self._pedb.nets.signal[nets]]
@@ -1946,7 +2151,9 @@ class SourceExcitation:
1946
2151
  return edges_pts
1947
2152
  return port_created
1948
2153
 
1949
- def create_vertical_circuit_port_on_clipped_traces(self, nets=None, reference_net=None, user_defined_extent=None):
2154
+ def create_vertical_circuit_port_on_clipped_traces(
2155
+ self, nets=None, reference_net=None, user_defined_extent=None
2156
+ ) -> list[list[str]]:
1950
2157
  """Create an edge port on clipped signal traces.
1951
2158
 
1952
2159
  Parameters
@@ -1965,6 +2172,12 @@ class SourceExcitation:
1965
2172
  [[str]]
1966
2173
  Nested list of str, with net name as first value, X value for point at border, Y value for point at border,
1967
2174
  and terminal name.
2175
+
2176
+ Examples
2177
+ --------
2178
+ >>> from pyedb import Edb
2179
+ >>> edb = Edb()
2180
+ >>> terminals = edb.source_excitation.create_vertical_circuit_port_on_clipped_traces(["Net1"], "GND")
1968
2181
  """
1969
2182
  if not isinstance(nets, list):
1970
2183
  if isinstance(nets, str):
@@ -2068,7 +2281,9 @@ class SourceExcitation:
2068
2281
 
2069
2282
  Examples
2070
2283
  --------
2071
- >>> edb.excitations.create_bundle_wave_port(0, ["-50mm", "-0mm"], 1, ["-50mm", "-0.2mm"])
2284
+ >>> from pyedb import Edb
2285
+ >>> edb = Edb()
2286
+ >>> port_name, port = edb.source_excitation.create_bundle_wave_port([0,1], [[0,0],[0,0.2]])
2072
2287
  """
2073
2288
  if not port_name:
2074
2289
  port_name = generate_unique_name("bundle_port")
@@ -2108,6 +2323,13 @@ class SourceExcitation:
2108
2323
  -------
2109
2324
  bool
2110
2325
  ``True`` when successful, ``False`` when failed.
2326
+
2327
+ Examples
2328
+ --------
2329
+ >>> from pyedb import Edb
2330
+ >>> edb = Edb()
2331
+ >>> pin = edb.padstacks.instances[0]
2332
+ >>> edb.source_excitation.create_hfss_ports_on_padstack(pin, "Port1")
2111
2333
  """
2112
2334
  top_layer, bottom_layer = pinpos.get_layer_range()
2113
2335
 
@@ -2133,6 +2355,11 @@ class SourceExcitation:
2133
2355
  int
2134
2356
  Number of ports.
2135
2357
 
2358
+ Examples
2359
+ --------
2360
+ >>> from pyedb import Edb
2361
+ >>> edb = Edb()
2362
+ >>> num_ports = edb.source_excitation.get_ports_number()
2136
2363
  """
2137
2364
  terms = [term for term in self._pedb.layout.terminals]
2138
2365
  return len([i for i in terms if not i.is_reference_terminal])
@@ -2154,6 +2381,12 @@ class SourceExcitation:
2154
2381
  Returns
2155
2382
  -------
2156
2383
  :class:`PointTerminal <pyedb.grpc.database.terminal.point_terminal.PointTerminal>`
2384
+
2385
+ Examples
2386
+ --------
2387
+ >>> from pyedb import Edb
2388
+ >>> edb = Edb()
2389
+ >>> term = edb.source_excitation.get_point_terminal("Term1", "Net1", [0,0], "TopLayer")
2157
2390
  """
2158
2391
  from pyedb.grpc.database.terminal.point_terminal import PointTerminal
2159
2392
 
@@ -2183,6 +2416,13 @@ class SourceExcitation:
2183
2416
  bool
2184
2417
  ``True`` when successful, ``False`` when failed.
2185
2418
 
2419
+ Examples
2420
+ --------
2421
+ >>> from pyedb import Edb
2422
+ >>> edb = Edb()
2423
+ >>> pin1 = edb.components["U1"].pins["Pin1"]
2424
+ >>> pin2 = edb.components["U1"].pins["Pin2"]
2425
+ >>> term = edb.source_excitation.create_rlc_boundary_on_pins(pin1, pin2, rvalue=50)
2186
2426
  """
2187
2427
 
2188
2428
  if positive_pin and negative_pin:
@@ -2253,17 +2493,11 @@ class SourceExcitation:
2253
2493
 
2254
2494
  Examples
2255
2495
  --------
2256
-
2257
- >>> edb_path = path_to_edb
2258
- >>> edb = Edb(edb_path)
2259
- >>> poly_list = [poly for poly in list(edb.layout.primitives) if poly.GetPrimitiveType() == 2]
2260
- >>> port_poly = [poly for poly in poly_list if poly.GetId() == 17][0]
2261
- >>> ref_poly = [poly for poly in poly_list if poly.GetId() == 19][0]
2262
- >>> port_location = [-65e-3, -13e-3]
2263
- >>> ref_location = [-63e-3, -13e-3]
2264
- >>> edb.hfss.create_edge_port_on_polygon(polygon=port_poly, reference_polygon=ref_poly,
2265
- >>> terminal_point=port_location, reference_point=ref_location)
2266
-
2496
+ >>> from pyedb import Edb
2497
+ >>> edb = Edb()
2498
+ >>> poly = edb.modeler.primitives[0]
2499
+ >>> ref_poly = edb.modeler.primitives[1]
2500
+ >>> edb.source_excitation.create_edge_port_on_polygon(poly, ref_poly, [0,0], [0.1,0])
2267
2501
  """
2268
2502
  if not polygon:
2269
2503
  self._logger.error("No polygon provided for port {} creation".format(port_name))
@@ -2338,6 +2572,11 @@ class SourceExcitation:
2338
2572
  PadstackInstanceTerminal
2339
2573
  Created terminal.
2340
2574
 
2575
+ Examples
2576
+ --------
2577
+ >>> from pyedb import Edb
2578
+ >>> edb = Edb()
2579
+ >>> terms = edb.source_excitation.create_port_between_pin_and_layer("U1", "Pin1", "GND", "GND")
2341
2580
  """
2342
2581
  if not pins_name:
2343
2582
  pins_name = []
@@ -2396,20 +2635,26 @@ class SourceExcitation:
2396
2635
 
2397
2636
  Parameters
2398
2637
  ----------
2399
- terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`,
2400
- :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PadstackInstanceTerminal>`,
2401
- :class:`PointTerminal <pyedb.grpc.database.terminals.PointTerminal>`,
2402
- :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`,
2403
- Positive terminal of the source.
2404
- ref_terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`,
2405
- :class:`pyedb.grpc.database.terminals.PadstackInstanceTerminal`,
2406
- :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PointTerminal>`,
2407
- :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`,
2408
- Negative terminal of the source.
2638
+ terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>`or
2639
+ :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PadstackInstanceTerminal>` or
2640
+ :class:`PointTerminal <pyedb.grpc.database.terminals.PointTerminal>` or
2641
+ :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`.
2642
+ Positive terminal of the source.
2643
+ ref_terminal : :class:`EdgeTerminal <pyedb.grpc.database.terminals.EdgeTerminal>` or
2644
+ :class:`pyedb.grpc.database.terminals.PadstackInstanceTerminal` or
2645
+ :class:`PadstackInstanceTerminal <pyedb.grpc.database.terminals.PointTerminal>` or
2646
+ :class:`PinGroupTerminal <pyedb.grpc.database.terminals.PinGroupTerminal>`.
2647
+ Negative terminal of the source.
2409
2648
 
2410
2649
  Returns
2411
2650
  -------
2412
2651
  :class:`ExcitationSources <legacy.database.edb_data.ports.ExcitationSources>`
2652
+
2653
+ Examples
2654
+ --------
2655
+ >>> from pyedb import Edb
2656
+ >>> edb = Edb()
2657
+ >>> edb.source_excitation.create_current_source_on_pin_group("PG1", "PG2", 0.1, name="ISource1")
2413
2658
  """
2414
2659
  from pyedb.grpc.database.terminal.terminal import Terminal
2415
2660
 
@@ -2481,6 +2726,12 @@ class SourceExcitation:
2481
2726
  Returns
2482
2727
  -------
2483
2728
  class:`ExcitationSources <legacy.database.edb_data.ports.ExcitationSources>`
2729
+
2730
+ Examples
2731
+ --------
2732
+ >>> from pyedb import Edb
2733
+ >>> edb = Edb()
2734
+ >>> edb.source_excitation.create_voltage_source_on_pin_group("PG1", "PG2", 3.3, name="VSource1")
2484
2735
  """
2485
2736
  from pyedb.grpc.database.terminal.terminal import Terminal
2486
2737
 
@@ -2513,6 +2764,11 @@ class SourceExcitation:
2513
2764
  -------
2514
2765
  bool
2515
2766
 
2767
+ Examples
2768
+ --------
2769
+ >>> from pyedb import Edb
2770
+ >>> edb = Edb()
2771
+ >>> edb.source_excitation.create_voltage_probe_on_pin_group("Probe1", "PG1", "PG2")
2516
2772
  """
2517
2773
  pos_pin_group = next(pg for pg in self._pedb.layout.pin_groups if pg.name == pos_pin_group_name)
2518
2774
  if not pos_pin_group:
@@ -2627,10 +2883,9 @@ class SourceExcitation:
2627
2883
 
2628
2884
  Examples
2629
2885
  --------
2630
-
2631
2886
  >>> from pyedb import Edb
2632
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
2633
- >>> edb.siwave.create_dc_terminal("U2A5", "V1P5_S3", "source_name")
2887
+ >>> edb = Edb()
2888
+ >>> edb.source_excitation.create_dc_terminal("U1", "VCC", "DC_VCC")
2634
2889
  """
2635
2890
 
2636
2891
  node_pin = self._pedb.components.get_pin_from_component(component_name, net_name)
@@ -2660,6 +2915,11 @@ class SourceExcitation:
2660
2915
  -------
2661
2916
  bool
2662
2917
 
2918
+ Examples
2919
+ --------
2920
+ >>> from pyedb import Edb
2921
+ >>> edb = Edb()
2922
+ >>> edb.source_excitation.create_circuit_port_on_pin_group("PG1", "PG2", 50, "Port1")
2663
2923
  """
2664
2924
  pos_pin_group = next(pg for pg in self._pedb.layout.pin_groups if pg.name == pos_pin_group_name)
2665
2925
  if not pos_pin_group:
@@ -2705,6 +2965,13 @@ class SourceExcitation:
2705
2965
  Location of the negative terminal.
2706
2966
  negative_layer : str
2707
2967
  Layer of the negative terminal.
2968
+
2969
+ Examples
2970
+ --------
2971
+ >>> from pyedb import Edb
2972
+ >>> edb = Edb()
2973
+ >>> probe = edb.source_excitation.place_voltage_probe("Probe1", "Net1", [0,0], "TopLayer",
2974
+ ... "GND", [0.1,0], "TopLayer")
2708
2975
  """
2709
2976
  p_terminal = PointTerminal.create(
2710
2977
  layout=self._pedb.active_layout,