pyedb 0.49.0__py3-none-any.whl → 0.50.1__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 (79) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_modeler.py +42 -11
  3. pyedb/configuration/cfg_ports_sources.py +9 -1
  4. pyedb/dotnet/database/cell/hierarchy/component.py +6 -6
  5. pyedb/dotnet/database/components.py +3 -3
  6. pyedb/dotnet/database/edb_data/padstacks_data.py +13 -0
  7. pyedb/dotnet/database/edb_data/primitives_data.py +3 -3
  8. pyedb/dotnet/database/edb_data/variables.py +3 -3
  9. pyedb/dotnet/database/materials.py +16 -16
  10. pyedb/dotnet/database/modeler.py +38 -4
  11. pyedb/dotnet/database/sim_setup_data/data/settings.py +28 -0
  12. pyedb/dotnet/database/stackup.py +1 -0
  13. pyedb/dotnet/database/utilities/hfss_simulation_setup.py +5 -6
  14. pyedb/dotnet/edb.py +22 -20
  15. pyedb/extensions/__init__.py +0 -0
  16. pyedb/extensions/via_design_backend.py +681 -0
  17. pyedb/grpc/database/components.py +537 -686
  18. pyedb/grpc/database/control_file.py +458 -149
  19. pyedb/grpc/database/definition/component_def.py +17 -14
  20. pyedb/grpc/database/definition/materials.py +60 -60
  21. pyedb/grpc/database/definition/package_def.py +8 -8
  22. pyedb/grpc/database/definition/padstack_def.py +31 -33
  23. pyedb/grpc/database/definitions.py +6 -4
  24. pyedb/grpc/database/geometry/arc_data.py +5 -5
  25. pyedb/grpc/database/geometry/point_3d_data.py +3 -3
  26. pyedb/grpc/database/geometry/polygon_data.py +5 -5
  27. pyedb/grpc/database/hfss.py +399 -397
  28. pyedb/grpc/database/hierarchy/component.py +60 -58
  29. pyedb/grpc/database/hierarchy/pin_pair_model.py +6 -6
  30. pyedb/grpc/database/hierarchy/pingroup.py +13 -11
  31. pyedb/grpc/database/hierarchy/s_parameter_model.py +1 -1
  32. pyedb/grpc/database/hierarchy/spice_model.py +1 -1
  33. pyedb/grpc/database/layers/layer.py +2 -2
  34. pyedb/grpc/database/layers/stackup_layer.py +144 -44
  35. pyedb/grpc/database/layout/layout.py +12 -12
  36. pyedb/grpc/database/layout/voltage_regulator.py +8 -8
  37. pyedb/grpc/database/layout_validation.py +5 -5
  38. pyedb/grpc/database/modeler.py +248 -245
  39. pyedb/grpc/database/net/differential_pair.py +4 -4
  40. pyedb/grpc/database/net/extended_net.py +7 -8
  41. pyedb/grpc/database/net/net.py +57 -46
  42. pyedb/grpc/database/nets.py +139 -122
  43. pyedb/grpc/database/padstacks.py +174 -190
  44. pyedb/grpc/database/ports/ports.py +23 -17
  45. pyedb/grpc/database/primitive/padstack_instance.py +45 -30
  46. pyedb/grpc/database/primitive/path.py +7 -7
  47. pyedb/grpc/database/primitive/polygon.py +9 -9
  48. pyedb/grpc/database/primitive/primitive.py +21 -21
  49. pyedb/grpc/database/primitive/rectangle.py +1 -1
  50. pyedb/grpc/database/simulation_setup/hfss_advanced_settings.py +1 -1
  51. pyedb/grpc/database/simulation_setup/hfss_general_settings.py +1 -1
  52. pyedb/grpc/database/simulation_setup/hfss_settings_options.py +1 -1
  53. pyedb/grpc/database/simulation_setup/hfss_simulation_settings.py +6 -6
  54. pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +2 -2
  55. pyedb/grpc/database/simulation_setup/raptor_x_simulation_settings.py +2 -2
  56. pyedb/grpc/database/simulation_setup/raptor_x_simulation_setup.py +1 -1
  57. pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +3 -3
  58. pyedb/grpc/database/siwave.py +166 -214
  59. pyedb/grpc/database/source_excitations.py +156 -0
  60. pyedb/grpc/database/stackup.py +415 -316
  61. pyedb/grpc/database/terminal/bundle_terminal.py +12 -12
  62. pyedb/grpc/database/terminal/edge_terminal.py +6 -5
  63. pyedb/grpc/database/terminal/padstack_instance_terminal.py +13 -13
  64. pyedb/grpc/database/terminal/pingroup_terminal.py +12 -12
  65. pyedb/grpc/database/terminal/point_terminal.py +6 -6
  66. pyedb/grpc/database/terminal/terminal.py +26 -26
  67. pyedb/grpc/database/utility/heat_sink.py +5 -5
  68. pyedb/grpc/database/utility/hfss_extent_info.py +21 -21
  69. pyedb/grpc/database/utility/layout_statistics.py +13 -13
  70. pyedb/grpc/database/utility/rlc.py +3 -3
  71. pyedb/grpc/database/utility/sources.py +1 -1
  72. pyedb/grpc/database/utility/sweep_data_distribution.py +1 -1
  73. pyedb/grpc/edb.py +524 -764
  74. {pyedb-0.49.0.dist-info → pyedb-0.50.1.dist-info}/METADATA +1 -1
  75. {pyedb-0.49.0.dist-info → pyedb-0.50.1.dist-info}/RECORD +77 -77
  76. pyedb/extensions/pre_layout_design_toolkit/via_design.py +0 -1151
  77. pyedb/grpc/database/utility/simulation_configuration.py +0 -3305
  78. {pyedb-0.49.0.dist-info → pyedb-0.50.1.dist-info}/LICENSE +0 -0
  79. {pyedb-0.49.0.dist-info → pyedb-0.50.1.dist-info}/WHEEL +0 -0
@@ -28,6 +28,7 @@ import json
28
28
  import math
29
29
  import os
30
30
  import re
31
+ from typing import Union
31
32
  import warnings
32
33
 
33
34
  from ansys.edb.core.definition.die_property import DieOrientation as GrpDieOrientation
@@ -59,19 +60,18 @@ from pyedb.grpc.database.utility.sources import SourceType
59
60
  from pyedb.modeler.geometry_operators import GeometryOperators
60
61
 
61
62
 
62
- def resistor_value_parser(r_value):
63
- """Convert a resistor value.
63
+ def resistor_value_parser(r_value) -> float:
64
+ """Convert a resistor value to float.
64
65
 
65
66
  Parameters
66
67
  ----------
67
- r_value : float
68
- Resistor value.
68
+ r_value : float or str
69
+ Resistor value to convert.
69
70
 
70
71
  Returns
71
72
  -------
72
73
  float
73
- Resistor value.
74
-
74
+ Converted resistor value.
75
75
  """
76
76
  if isinstance(r_value, str):
77
77
  r_value = r_value.replace(" ", "")
@@ -86,11 +86,12 @@ def resistor_value_parser(r_value):
86
86
 
87
87
 
88
88
  class Components(object):
89
- """Manages EDB components and related method accessible from `Edb.components` property.
89
+ """Manages EDB components and related methods accessible from `Edb.components`.
90
90
 
91
91
  Parameters
92
92
  ----------
93
- edb_class : :class:`pyedb.grpc.edb.Edb`
93
+ p_edb : :class:`pyedb.grpc.edb.Edb`
94
+ EDB object.
94
95
 
95
96
  Examples
96
97
  --------
@@ -100,16 +101,22 @@ class Components(object):
100
101
  """
101
102
 
102
103
  def __getitem__(self, name):
103
- """Get a component or component definition from the Edb project.
104
+ """Get a component or component definition by name.
104
105
 
105
106
  Parameters
106
107
  ----------
107
108
  name : str
109
+ Name of the component or definition.
108
110
 
109
111
  Returns
110
112
  -------
111
- :class:`pyedb.dotnet.database.cell.hierarchy.component.EDBComponent`
113
+ :class:`pyedb.grpc.database.hierarchy.component.Component` or
114
+ :class:`pyedb.grpc.database.definition.component_def.ComponentDef` or None
115
+ Component instance if found, component definition if found by name, otherwise None.
112
116
 
117
+ Examples
118
+ --------
119
+ >>> component = edbapp.components["R1"]
113
120
  """
114
121
  if name in self.instances:
115
122
  return self.instances[name]
@@ -124,69 +131,119 @@ class Components(object):
124
131
  self._pins = {}
125
132
  self._comps_by_part = {}
126
133
  self._padstack = Padstacks(self._pedb)
127
- # self._excitations = self._pedb.excitations
128
134
 
129
135
  @property
130
136
  def _logger(self):
131
- """Logger."""
137
+ """Logger instance for the component manager.
138
+
139
+ Returns
140
+ -------
141
+ :class:`logging.Logger`
142
+ Logger instance.
143
+ """
132
144
  return self._pedb.logger
133
145
 
134
146
  @property
135
147
  def _active_layout(self):
148
+ """Active layout of the EDB database.
149
+
150
+ Returns
151
+ -------
152
+ :class:`ansys.edb.core.layout.Layout`
153
+ Active layout object.
154
+ """
136
155
  return self._pedb.active_layout
137
156
 
138
157
  @property
139
158
  def _layout(self):
159
+ """Layout of the EDB database.
160
+
161
+ Returns
162
+ -------
163
+ :class:`ansys.edb.core.layout.Layout`
164
+ Layout object.
165
+ """
140
166
  return self._pedb.layout
141
167
 
142
168
  @property
143
169
  def _cell(self):
170
+ """Cell of the EDB database.
171
+
172
+ Returns
173
+ -------
174
+ :class:`ansys.edb.core.layout.Cell`
175
+ Cell object.
176
+ """
144
177
  return self._pedb.cell
145
178
 
146
179
  @property
147
180
  def _db(self):
181
+ """Active database.
182
+
183
+ Returns
184
+ -------
185
+ :class:`ansys.edb.core.database.Database`
186
+ Active database object.
187
+ """
148
188
  return self._pedb.active_db
149
189
 
150
190
  @property
151
- def instances(self):
152
- """All Cell components objects.
191
+ def instances(self) -> dict[str, Component]:
192
+ """Dictionary of all component instances in the layout.
153
193
 
154
194
  Returns
155
195
  -------
156
- Dict[str, :class:`pyedb.grpc.database.cell.hierarchy.component.Component`]
157
- Default dictionary for the EDB component.
196
+ dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
197
+ Dictionary of component instances keyed by name.
158
198
 
159
199
  Examples
160
200
  --------
161
-
162
- >>> from pyedb import Edb
163
- >>> edbapp = Edb("myaedbfolder")
164
201
  >>> edbapp.components.instances
165
-
166
202
  """
167
203
  return self._cmp
168
204
 
169
205
  @property
170
- def definitions(self):
171
- """Retrieve component definition list.
206
+ def definitions(self) -> dict[str, ComponentDef]:
207
+ """Dictionary of all component definitions.
172
208
 
173
209
  Returns
174
210
  -------
175
- dict of :class:`EDBComponentDef`"""
211
+ dict[str, :class:`pyedb.grpc.database.definition.component_def.ComponentDef`]
212
+ Dictionary of component definitions keyed by name.
213
+
214
+ Examples
215
+ --------
216
+ >>> edbapp.components.definitions
217
+ """
176
218
  return {l.name: ComponentDef(self._pedb, l) for l in self._pedb.component_defs}
177
219
 
178
220
  @property
179
- def nport_comp_definition(self):
180
- """Retrieve Nport component definition list."""
221
+ def nport_comp_definition(self) -> dict[str, Component]:
222
+ """Dictionary of N-port component definitions.
223
+
224
+ Returns
225
+ -------
226
+ dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
227
+ Dictionary of N-port component definitions keyed by name.
228
+ """
181
229
  return {name: l for name, l in self.definitions.items() if l.reference_file}
182
230
 
183
- def import_definition(self, file_path):
184
- """Import component definition from json file.
231
+ def import_definition(self, file_path) -> bool:
232
+ """Import component definitions from a JSON file.
185
233
 
186
234
  Parameters
187
235
  ----------
188
236
  file_path : str
189
- File path of json file.
237
+ Path to the JSON file.
238
+
239
+ Returns
240
+ -------
241
+ bool
242
+ True if successful, False otherwise.
243
+
244
+ Examples
245
+ --------
246
+ >>> edbapp.components.import_definition("definitions.json")
190
247
  """
191
248
  with codecs.open(file_path, "r", encoding="utf-8") as f:
192
249
  data = json.load(f)
@@ -214,17 +271,22 @@ class Components(object):
214
271
  pass
215
272
  return True
216
273
 
217
- def export_definition(self, file_path):
218
- """Export component definitions to json file.
274
+ def export_definition(self, file_path) -> bool:
275
+ """Export component definitions to a JSON file.
219
276
 
220
277
  Parameters
221
278
  ----------
222
279
  file_path : str
223
- File path of json file.
280
+ Path to the output JSON file.
224
281
 
225
282
  Returns
226
283
  -------
284
+ bool
285
+ True if successful, False otherwise.
227
286
 
287
+ Examples
288
+ --------
289
+ >>> edbapp.components.export_definition("exported_definitions.json")
228
290
  """
229
291
  data = {
230
292
  "SParameterModel": {},
@@ -262,10 +324,20 @@ class Components(object):
262
324
 
263
325
  with codecs.open(file_path, "w", encoding="utf-8") as f:
264
326
  json.dump(data, f, ensure_ascii=False, indent=4)
265
- return file_path
327
+ return True
266
328
 
267
- def refresh_components(self):
268
- """Refresh the component dictionary."""
329
+ def refresh_components(self) -> bool:
330
+ """Refresh the component dictionary.
331
+
332
+ Returns
333
+ -------
334
+ bool
335
+ True if successful, False otherwise.
336
+
337
+ Examples
338
+ --------
339
+ >>> edbapp.components.refresh_components()
340
+ """
269
341
  self._logger.info("Refreshing the Components dictionary.")
270
342
  self._cmp = {}
271
343
  self._res = {}
@@ -299,133 +371,107 @@ class Components(object):
299
371
  return True
300
372
 
301
373
  @property
302
- def resistors(self):
303
- """Resistors.
374
+ def resistors(self) -> dict[str, Component]:
375
+ """Dictionary of resistor components.
304
376
 
305
377
  Returns
306
378
  -------
307
- dict[str, .:class:`pyedb.dotnet.database.cell.hierarchy.component.EDBComponent`]
308
- Dictionary of resistors.
379
+ dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
380
+ Dictionary of resistor components keyed by name.
309
381
 
310
382
  Examples
311
383
  --------
312
-
313
- >>> from pyedb import Edb
314
- >>> edbapp = Edb("myaedbfolder")
315
384
  >>> edbapp.components.resistors
316
385
  """
317
386
  return self._res
318
387
 
319
388
  @property
320
- def capacitors(self):
321
- """Capacitors.
389
+ def capacitors(self) -> dict[str, Component]:
390
+ """Dictionary of capacitor components.
322
391
 
323
392
  Returns
324
393
  -------
325
- dict[str, .:class:`pyedb.dotnet.database.cell.hierarchy.component.EDBComponent`]
326
- Dictionary of capacitors.
394
+ dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
395
+ Dictionary of capacitor components keyed by name.
327
396
 
328
397
  Examples
329
398
  --------
330
-
331
- >>> from pyedb import Edb
332
- >>> edbapp = Edb("myaedbfolder")
333
399
  >>> edbapp.components.capacitors
334
400
  """
335
401
  return self._cap
336
402
 
337
403
  @property
338
- def inductors(self):
339
- """Inductors.
404
+ def inductors(self) -> dict[str, Component]:
405
+ """Dictionary of inductor components.
340
406
 
341
407
  Returns
342
408
  -------
343
- dict[str, .:class:`pyedb.dotnet.database.cell.hierarchy.component.EDBComponent`]
344
- Dictionary of inductors.
409
+ dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
410
+ Dictionary of inductor components keyed by name.
345
411
 
346
412
  Examples
347
413
  --------
348
-
349
- >>> from pyedb import Edb
350
- >>> edbapp = Edb("myaedbfolder")
351
414
  >>> edbapp.components.inductors
352
-
353
415
  """
354
416
  return self._ind
355
417
 
356
418
  @property
357
- def ICs(self):
358
- """Integrated circuits.
419
+ def ICs(self) -> dict[str, Component]:
420
+ """Dictionary of integrated circuit components.
359
421
 
360
422
  Returns
361
423
  -------
362
- dict[str, .:class:`pyedb.dotnet.database.cell.hierarchy.component.EDBComponent`]
363
- Dictionary of integrated circuits.
424
+ dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
425
+ Dictionary of IC components keyed by name.
364
426
 
365
427
  Examples
366
428
  --------
367
-
368
- >>> from pyedb import Edb
369
- >>> edbapp = Edb("myaedbfolder")
370
429
  >>> edbapp.components.ICs
371
-
372
430
  """
373
431
  return self._ics
374
432
 
375
433
  @property
376
- def IOs(self):
377
- """Circuit inupts and outputs.
434
+ def IOs(self) -> dict[str, Component]:
435
+ """Dictionary of I/O components.
378
436
 
379
437
  Returns
380
438
  -------
381
- dict[str, .:class:`pyedb.dotnet.database.cell.hierarchy.component.EDBComponent`]
382
- Dictionary of circuit inputs and outputs.
439
+ dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
440
+ Dictionary of I/O components keyed by name.
383
441
 
384
442
  Examples
385
443
  --------
386
-
387
- >>> from pyedb import Edb
388
- >>> edbapp = Edb("myaedbfolder")
389
444
  >>> edbapp.components.IOs
390
-
391
445
  """
392
446
  return self._ios
393
447
 
394
448
  @property
395
- def Others(self):
396
- """Other core components.
449
+ def Others(self) -> dict[str, Component]:
450
+ """Dictionary of other components.
397
451
 
398
452
  Returns
399
453
  -------
400
- dict[str, .:class:`pyedb.dotnet.database.cell.hierarchy.component.EDBComponent`]
401
- Dictionary of other core components.
454
+ dict[str, :class:`pyedb.grpc.database.hierarchy.component.Component`]
455
+ Dictionary of other components keyed by name.
402
456
 
403
457
  Examples
404
458
  --------
405
-
406
- >>> from pyedb import Edb
407
- >>> edbapp = Edb("myaedbfolder")
408
- >>> edbapp.components.others
409
-
459
+ >>> edbapp.components.Others
410
460
  """
411
461
  return self._others
412
462
 
413
463
  @property
414
- def components_by_partname(self):
415
- """Components by part name.
464
+ def components_by_partname(self) -> dict[str, list[Component]]:
465
+ """Dictionary of components grouped by part name.
416
466
 
417
467
  Returns
418
468
  -------
419
- dict
420
- Dictionary of components by part name.
469
+ dict[str, list[:class:`pyedb.grpc.database.hierarchy.component.Component`]]
470
+ Dictionary of components lists keyed by part name.
421
471
 
422
472
  Examples
423
473
  --------
424
-
425
- >>> from pyedb import Edb
426
- >>> edbapp = Edb("myaedbfolder")
427
474
  >>> edbapp.components.components_by_partname
428
-
429
475
  """
430
476
  self._comps_by_part = {}
431
477
  for el, val in self.instances.items():
@@ -435,7 +481,7 @@ class Components(object):
435
481
  self._comps_by_part[val.partname] = [val]
436
482
  return self._comps_by_part
437
483
 
438
- def get_component_by_name(self, name):
484
+ def get_component_by_name(self, name) -> Component:
439
485
  """Retrieve a component by name.
440
486
 
441
487
  Parameters
@@ -445,28 +491,35 @@ class Components(object):
445
491
 
446
492
  Returns
447
493
  -------
448
- bool
449
- Component object.
494
+ :class:`pyedb.grpc.database.hierarchy.component.Component`
495
+ Component instance.
450
496
 
497
+ Examples
498
+ --------
499
+ >>> comp = edbapp.components.get_component_by_name("R1")
451
500
  """
452
501
  return self.instances[name]
453
502
 
454
- def get_pin_from_component(self, component, net_name=None, pin_name=None):
455
- """Return component pins.
503
+ def get_pin_from_component(self, component, net_name=None, pin_name=None) -> list:
504
+ """Get pins from a component with optional filtering.
505
+
456
506
  Parameters
457
507
  ----------
458
- component: .:class: `Component` or str.
459
- Component object or component name.
460
- net_name : str, List[str], optional
461
- Apply filter on net name.
508
+ component : str or :class:`pyedb.grpc.database.hierarchy.component.Component`
509
+ Component name or instance.
510
+ net_name : str or list[str], optional
511
+ Net name(s) to filter by.
462
512
  pin_name : str, optional
463
- Apply filter on specific pin name.
464
- Return
465
- ------
466
- List[:clas: `PadstackInstance`]
467
-
513
+ Pin name to filter by.
468
514
 
515
+ Returns
516
+ -------
517
+ list[:class:`pyedb.grpc.database.padstacks.PadstackInstance`]
518
+ List of pin instances.
469
519
 
520
+ Examples
521
+ --------
522
+ >>> pins = edbapp.components.get_pin_from_component("R1", net_name="GND")
470
523
  """
471
524
  if isinstance(component, Component):
472
525
  component = component.name
@@ -479,19 +532,22 @@ class Components(object):
479
532
  pins = [pin for pin in pins if pin.name == pin_name]
480
533
  return pins
481
534
 
482
- def get_components_from_nets(self, netlist=None):
483
- """Retrieve components from a net list.
535
+ def get_components_from_nets(self, netlist=None) -> list[str]:
536
+ """Get components connected to specified nets.
484
537
 
485
538
  Parameters
486
539
  ----------
487
- netlist : str, optional
488
- Name of the net list. The default is ``None``.
540
+ netlist : str or list[str], optional
541
+ Net name(s) to filter by.
489
542
 
490
543
  Returns
491
544
  -------
492
- list
493
- List of components that belong to the signal nets.
545
+ list[str]
546
+ List of component names.
494
547
 
548
+ Examples
549
+ --------
550
+ >>> comps = edbapp.components.get_components_from_nets(["GND", "VCC"])
495
551
  """
496
552
  cmp_list = []
497
553
  if isinstance(netlist, str):
@@ -503,7 +559,21 @@ class Components(object):
503
559
  cmp_list.append(refdes)
504
560
  return cmp_list
505
561
 
506
- def _get_edb_pin_from_pin_name(self, cmp, pin):
562
+ def _get_edb_pin_from_pin_name(self, cmp, pin) -> Union[ComponentPin, bool]:
563
+ """Get EDB pin from pin name.
564
+
565
+ Parameters
566
+ ----------
567
+ cmp : :class:`pyedb.grpc.database.hierarchy.component.Component`
568
+ Component instance.
569
+ pin : str
570
+ Pin name.
571
+
572
+ Returns
573
+ -------
574
+ :class:`pyedb.grpc.database.definition.component_pin.ComponentPin` or bool
575
+ Pin instance if found, False otherwise.
576
+ """
507
577
  if not isinstance(cmp, Component):
508
578
  return False
509
579
  if not isinstance(pin, str):
@@ -521,53 +591,44 @@ class Components(object):
521
591
  hosting_component_pin1,
522
592
  hosting_component_pin2,
523
593
  flipped=False,
524
- ):
525
- """Get the placement vector between 2 components.
594
+ ) -> tuple:
595
+ """Get placement vector between two components.
526
596
 
527
597
  Parameters
528
598
  ----------
529
- mounted_component : `edb.cell.hierarchy._hierarchy.Component`
530
- Mounted component name.
531
- hosting_component : `edb.cell.hierarchy._hierarchy.Component`
532
- Hosting component name.
599
+ mounted_component : :class:`pyedb.grpc.database.hierarchy.component.Component`
600
+ Mounted component.
601
+ hosting_component : :class:`pyedb.grpc.database.hierarchy.component.Component`
602
+ Hosting component.
533
603
  mounted_component_pin1 : str
534
- Mounted component Pin 1 name.
604
+ Pin name on mounted component.
535
605
  mounted_component_pin2 : str
536
- Mounted component Pin 2 name.
606
+ Pin name on mounted component.
537
607
  hosting_component_pin1 : str
538
- Hosted component Pin 1 name.
608
+ Pin name on hosting component.
539
609
  hosting_component_pin2 : str
540
- Hosted component Pin 2 name.
610
+ Pin name on hosting component.
541
611
  flipped : bool, optional
542
- Either if the mounted component will be flipped or not.
612
+ Whether the component is flipped.
543
613
 
544
614
  Returns
545
615
  -------
546
616
  tuple
547
- Tuple of Vector offset, rotation and solder height.
617
+ (success, vector, rotation, solder_ball_height)
548
618
 
549
619
  Examples
550
620
  --------
551
- >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2")
552
- >>> hosting_cmp = edb1.components.get_component_by_name("U100")
553
- >>> mounted_cmp = edb2.components.get_component_by_name("BGA")
554
- >>> vector, rotation, solder_ball_height = edb1.components.get_component_placement_vector(
555
- ... mounted_component=mounted_cmp,
556
- ... hosting_component=hosting_cmp,
557
- ... mounted_component_pin1="A12",
558
- ... mounted_component_pin2="A14",
559
- ... hosting_component_pin1="A12",
560
- ... hosting_component_pin2="A14")
621
+ >>> vec, rot, height = edbapp.components.get_component_placement_vector(...)
561
622
  """
562
- m_pin1_pos = [0.0, 0.0]
563
- m_pin2_pos = [0.0, 0.0]
564
- h_pin1_pos = [0.0, 0.0]
565
- h_pin2_pos = [0.0, 0.0]
566
623
  if not isinstance(mounted_component, Component):
567
624
  return False
568
625
  if not isinstance(hosting_component, Component):
569
626
  return False
570
627
 
628
+ m_pin1_pos = [0.0, 0.0]
629
+ m_pin2_pos = [0.0, 0.0]
630
+ h_pin1_pos = [0.0, 0.0]
631
+ h_pin2_pos = [0.0, 0.0]
571
632
  if mounted_component_pin1:
572
633
  m_pin1 = self._get_edb_pin_from_pin_name(mounted_component, mounted_component_pin1)
573
634
  m_pin1_pos = self.get_pin_position(m_pin1)
@@ -609,39 +670,38 @@ class Components(object):
609
670
  self._logger.warning("Failed to compute vector.")
610
671
  return False, [0, 0], 0, 0
611
672
 
612
- def get_solder_ball_height(self, cmp):
613
- """Get component solder ball height.
673
+ def get_solder_ball_height(self, cmp) -> float:
674
+ """Get solder ball height of a component.
614
675
 
615
676
  Parameters
616
677
  ----------
617
- cmp : str or `Component` object.
618
- EDB component or str component name.
678
+ cmp : str or :class:`pyedb.grpc.database.hierarchy.component.Component`
679
+ Component name or instance.
619
680
 
620
681
  Returns
621
682
  -------
622
- double, bool
623
- Salder ball height vale, ``False`` when failed.
683
+ float
684
+ Solder ball height in meters.
624
685
 
686
+ Examples
687
+ --------
688
+ >>> height = edbapp.components.get_solder_ball_height("U1")
625
689
  """
626
690
  if isinstance(cmp, str):
627
691
  cmp = self.get_component_by_name(cmp)
628
692
  return cmp.solder_ball_height
629
693
 
630
- def get_vendor_libraries(self):
631
- """Retrieve all capacitors and inductors libraries from ANSYS installation (used by Siwave).
694
+ def get_vendor_libraries(self) -> ComponentLib:
695
+ """Get vendor component libraries.
632
696
 
633
697
  Returns
634
698
  -------
635
- ComponentLib object contains nested dictionaries to navigate through [component type][vendors][series]
636
- :class: `pyedb.component_libraries.ansys_components.ComponentPart`
699
+ :class:`pyedb.component_libraries.ansys_components.ComponentLib`
700
+ Component library object.
637
701
 
638
702
  Examples
639
703
  --------
640
- >>> edbapp = Edb()
641
- >>> comp_lib = edbapp.components.get_vendor_libraries()
642
- >>> network = comp_lib.capacitors["AVX"]["AccuP01005"]["C005YJ0R1ABSTR"].s_parameters
643
- >>> network.write_touchstone(os.path.join(edbapp.directory, "test_export.s2p"))
644
-
704
+ >>> lib = edbapp.components.get_vendor_libraries()
645
705
  """
646
706
  comp_lib_path = os.path.join(self._pedb.base_path, "complib", "Locked")
647
707
  comp_types = ["Capacitors", "Inductors"]
@@ -671,22 +731,21 @@ class Components(object):
671
731
  comp_lib.inductors = vendors
672
732
  return comp_lib
673
733
 
674
- def create_source_on_component(self, sources=None):
675
- """Create voltage, current source, or resistor on component.
734
+ def create_source_on_component(self, sources=None): # pragma: no cover
735
+ """Create sources on components.
676
736
 
677
- . deprecated:: pyedb 0.28.0
678
- Use .:func:`pyedb.grpc.core.excitations.create_source_on_component` instead.
737
+ .. deprecated:: 0.28.0
738
+ Use :func:`pyedb.grpc.core.excitations.create_source_on_component` instead.
679
739
 
680
740
  Parameters
681
741
  ----------
682
- sources : list[Source]
683
- List of ``edb_data.sources.Source`` objects.
742
+ sources : list, optional
743
+ List of sources.
684
744
 
685
745
  Returns
686
746
  -------
687
747
  bool
688
- ``True`` when successful, ``False`` when failed.
689
-
748
+ True if successful, False otherwise.
690
749
  """
691
750
  warnings.warn(
692
751
  "`create_source_on_component` is deprecated and is now located here "
@@ -704,42 +763,33 @@ class Components(object):
704
763
  port_name=None,
705
764
  pec_boundary=False,
706
765
  pingroup_on_single_pin=False,
707
- ):
708
- """Create circuit port between pins and reference ones.
766
+ ): # pragma: no cover
767
+ """Create port on pins.
709
768
 
710
- . deprecated:: pyedb 0.28.0
711
- Use :func:`pyedb.grpc.core.excitations.create_port_on_pins` instead.
769
+ .. deprecated:: 0.28.0
770
+ Use :func:`pyedb.grpc.core.excitations.create_port_on_pins` instead.
712
771
 
713
772
  Parameters
714
773
  ----------
715
- refdes : Component reference designator
716
- str or EDBComponent object.
717
- pins : pin name where the terminal has to be created. Single pin or several ones can be provided.If several
718
- pins are provided a pin group will is created. Pin names can be the EDB name or the EDBPadstackInstance one.
719
- For instance the pin called ``Pin1`` located on component ``U1``, ``U1-Pin1`` or ``Pin1`` can be provided and
720
- will be handled.
721
- str, [str], EDBPadstackInstance, [EDBPadstackInstance]
722
- reference_pins : reference pin name used for terminal reference. Single pin or several ones can be provided.
723
- If several pins are provided a pin group will is created. Pin names can be the EDB name or the
724
- EDBPadstackInstance one. For instance the pin called ``Pin1`` located on component ``U1``, ``U1-Pin1``
725
- or ``Pin1`` can be provided and will be handled.
726
- str, [str], EDBPadstackInstance, [EDBPadstackInstance]
727
- impedance : Port impedance
728
- str, float
774
+ refdes : str
775
+ Reference designator.
776
+ pins : list
777
+ List of pins.
778
+ reference_pins : list
779
+ List of reference pins.
780
+ impedance : float, optional
781
+ Port impedance.
729
782
  port_name : str, optional
730
- Port name. The default is ``None``, in which case a name is automatically assigned.
783
+ Port name.
731
784
  pec_boundary : bool, optional
732
- Whether to define the PEC boundary, The default is ``False``. If set to ``True``,
733
- a perfect short is created between the pin and impedance is ignored. This
734
- parameter is only supported on a port created between two pins, such as
735
- when there is no pin group.
736
- pingroup_on_single_pin : bool
737
- If ``True`` force using pingroup definition on single pin to have the port created at the pad center. If
738
- ``False`` the port is created at the pad edge. Default value is ``False``.
785
+ Use PEC boundary.
786
+ pingroup_on_single_pin : bool, optional
787
+ Use pin group on single pin.
739
788
 
740
789
  Returns
741
790
  -------
742
- EDB terminal created, or False if failed to create.
791
+ bool
792
+ True if successful, False otherwise.
743
793
  """
744
794
  warnings.warn(
745
795
  "`create_port_on_pins` is deprecated and is now located here "
@@ -768,50 +818,39 @@ class Components(object):
768
818
  solder_balls_size=None,
769
819
  solder_balls_mid_size=None,
770
820
  extend_reference_pins_outside_component=False,
771
- ):
821
+ ): # pragma: no cover
772
822
  """Create ports on a component.
773
823
 
774
- . deprecated:: pyedb 0.28.0
775
- Use :func:`pyedb.grpc.core.excitations.create_port_on_component` instead.
824
+ .. deprecated:: 0.28.0
825
+ Use :func:`pyedb.grpc.core.excitations.create_port_on_component` instead.
776
826
 
777
827
  Parameters
778
828
  ----------
779
- component : str or self._pedb.component
780
- EDB component or str component name.
781
- net_list : str or list of string.
782
- List of nets where ports must be created on the component.
783
- If the net is not part of the component, this parameter is skipped.
784
- port_type : SourceType enumerator, CoaxPort or CircuitPort
785
- Type of port to create. ``CoaxPort`` generates solder balls.
786
- ``CircuitPort`` generates circuit ports on pins belonging to the net list.
787
- do_pingroup : bool
788
- True activate pingroup during port creation (only used with combination of CircPort),
789
- False will take the closest reference pin and generate one port per signal pin.
790
- refnet : string or list of string.
791
- list of the reference net.
792
- port_name : str
793
- Port name for overwriting the default port-naming convention,
794
- which is ``[component][net][pin]``. The port name must be unique.
795
- If a port with the specified name already exists, the
796
- default naming convention is used so that port creation does
797
- not fail.
829
+ component : str
830
+ Component name.
831
+ net_list : list
832
+ List of nets.
833
+ port_type : SourceType, optional
834
+ Port type.
835
+ do_pingroup : bool, optional
836
+ Use pin groups.
837
+ reference_net : str, optional
838
+ Reference net.
839
+ port_name : str, optional
840
+ Port name.
798
841
  solder_balls_height : float, optional
799
- Solder balls height used for the component. When provided default value is overwritten and must be
800
- provided in meter.
842
+ Solder ball height.
801
843
  solder_balls_size : float, optional
802
- Solder balls diameter. When provided auto evaluation based on padstack size will be disabled.
844
+ Solder ball size.
803
845
  solder_balls_mid_size : float, optional
804
- Solder balls mid-diameter. When provided if value is different than solder balls size, spheroid shape will
805
- be switched.
806
- extend_reference_pins_outside_component : bool
807
- When no reference pins are found on the component extend the pins search with taking the closest one. If
808
- `do_pingroup` is `True` will be set to `False`. Default value is `False`.
846
+ Solder ball mid size.
847
+ extend_reference_pins_outside_component : bool, optional
848
+ Extend reference pins outside component.
809
849
 
810
850
  Returns
811
851
  -------
812
- double, bool
813
- Salder ball height vale, ``False`` when failed.
814
-
852
+ bool
853
+ True if successful, False otherwise.
815
854
  """
816
855
  warnings.warn(
817
856
  "`create_port_on_component` is deprecated and is now located here "
@@ -831,22 +870,23 @@ class Components(object):
831
870
  extend_reference_pins_outside_component=extend_reference_pins_outside_component,
832
871
  )
833
872
 
834
- def _create_terminal(self, pin, term_name=None):
835
- """Create terminal on component pin.
873
+ def _create_terminal(self, pin, term_name=None): # pragma: no cover
874
+ """Create terminal on pin.
836
875
 
837
- . deprecated:: pyedb 0.28.0
838
- Use :func:`pyedb.grpc.core.excitations._create_terminal` instead.
876
+ .. deprecated:: 0.28.0
877
+ Use :func:`pyedb.grpc.core.excitations._create_terminal` instead.
839
878
 
840
879
  Parameters
841
880
  ----------
842
- pin : Edb padstack instance.
843
-
844
- term_name : Terminal name (Optional).
845
- str.
881
+ pin : :class:`pyedb.grpc.database.padstacks.PadstackInstance`
882
+ Pin instance.
883
+ term_name : str, optional
884
+ Terminal name.
846
885
 
847
886
  Returns
848
887
  -------
849
- EDB terminal.
888
+ bool
889
+ True if successful, False otherwise.
850
890
  """
851
891
  warnings.warn(
852
892
  "`_create_terminal` is deprecated and is now located here "
@@ -856,18 +896,19 @@ class Components(object):
856
896
  self._pedb.excitations._create_terminal(pin, term_name=term_name)
857
897
 
858
898
  def _get_closest_pin_from(self, pin, ref_pinlist):
859
- """Returns the closest pin from given pin among the list of reference pins.
899
+ """Get closest pin from a list of pins.
860
900
 
861
901
  Parameters
862
902
  ----------
863
- pin : Edb padstack instance.
864
-
865
- ref_pinlist : list of reference edb pins.
903
+ pin : :class:`pyedb.grpc.database.padstacks.PadstackInstance`
904
+ Source pin.
905
+ ref_pinlist : list[:class:`pyedb.grpc.database.padstacks.PadstackInstance`]
906
+ List of reference pins.
866
907
 
867
908
  Returns
868
909
  -------
869
- Edb pin.
870
-
910
+ :class:`pyedb.grpc.database.padstacks.PadstackInstance`
911
+ Closest pin.
871
912
  """
872
913
  distance = 1e3
873
914
  pin_position = pin.position
@@ -879,173 +920,29 @@ class Components(object):
879
920
  closest_pin = ref_pin
880
921
  return closest_pin
881
922
 
882
- def replace_rlc_by_gap_boundaries(self, component=None):
883
- """Replace RLC component by RLC gap boundaries. These boundary types are compatible with 3D modeler export.
884
- Only 2 pins RLC components are supported in this command.
885
-
886
- Parameters
887
- ----------
888
- component : str
889
- Reference designator of the RLC component.
890
-
891
- Returns
892
- -------
893
- bool
894
- ``True`` when succeed, ``False`` if it failed.
895
-
896
- Examples
897
- --------
898
- >>> from pyedb import Edb
899
- >>> edb = Edb(edb_file)
900
- >>> for refdes, cmp in edb.components.capacitors.items():
901
- >>> edb.components.replace_rlc_by_gap_boundaries(refdes)
902
- >>> edb.save_edb()
903
- >>> edb.close_edb()
904
- """
905
- if not component:
906
- return False
907
- if isinstance(component, str):
908
- component = self.instances[component]
909
- if not component:
910
- self._logger.error("component %s not found.", component)
911
- return False
912
- if component.type in ["other", "ic", "io"]:
913
- self._logger.info(f"Component {component.refdes} skipped to deactivate is not an RLC.")
914
- return False
915
- component.enabled = False
916
- return self._pedb.source_excitation.add_rlc_boundary(component.refdes, False)
917
-
918
- def deactivate_rlc_component(self, component=None, create_circuit_port=False, pec_boundary=False):
919
- """Deactivate RLC component with a possibility to convert it to a circuit port.
920
-
921
- Parameters
922
- ----------
923
- component : str
924
- Reference designator of the RLC component.
925
-
926
- create_circuit_port : bool, optional
927
- Whether to replace the deactivated RLC component with a circuit port. The default
928
- is ``False``.
929
- pec_boundary : bool, optional
930
- Whether to define the PEC boundary, The default is ``False``. If set to ``True``,
931
- a perfect short is created between the pin and impedance is ignored. This
932
- parameter is only supported on a port created between two pins, such as
933
- when there is no pin group.
934
-
935
- Returns
936
- -------
937
- bool
938
- ``True`` when successful, ``False`` when failed.
939
-
940
- Examples
941
- --------
942
- >>> from pyedb import Edb
943
- >>> edb_file = r'C:\my_edb_file.aedb'
944
- >>> edb = Edb(edb_file)
945
- >>> for cmp in list(edb.components.instances.keys()):
946
- >>> edb.components.deactivate_rlc_component(component=cmp, create_circuit_port=False)
947
- >>> edb.save_edb()
948
- >>> edb.close_edb()
949
- """
950
- if not component:
951
- return False
952
- if isinstance(component, str):
953
- component = self.instances[component]
954
- if not component:
955
- self._logger.error("component %s not found.", component)
956
- return False
957
- if component.type in ["other", "ic", "io"]:
958
- self._logger.info(f"Component {component.refdes} passed to deactivate is not an RLC.")
959
- return False
960
- component.is_enabled = False
961
- return self._pedb.source_excitation.add_port_on_rlc_component(
962
- component=component.refdes, circuit_ports=create_circuit_port, pec_boundary=pec_boundary
963
- )
964
-
965
- def add_port_on_rlc_component(self, component=None, circuit_ports=True, pec_boundary=False):
966
- """Deactivate RLC component and replace it with a circuit port.
967
- The circuit port supports only two-pin components.
968
-
969
- . deprecated:: pyedb 0.28.0
970
- Use :func:`pyedb.grpc.core.excitations.add_port_on_rlc_component` instead.
971
-
972
- Parameters
973
- ----------
974
- component : str
975
- Reference designator of the RLC component.
976
-
977
- circuit_ports : bool
978
- ``True`` will replace RLC component by circuit ports, ``False`` gap ports compatible with HFSS 3D modeler
979
- export.
980
-
981
- pec_boundary : bool, optional
982
- Whether to define the PEC boundary, The default is ``False``. If set to ``True``,
983
- a perfect short is created between the pin and impedance is ignored. This
984
- parameter is only supported on a port created between two pins, such as
985
- when there is no pin group.
986
-
987
- Returns
988
- -------
989
- bool
990
- ``True`` when successful, ``False`` when failed.
991
- """
992
- warnings.warn(
993
- "`add_port_on_rlc_component` is deprecated and is now located here "
994
- "`pyedb.grpc.core.excitations.add_port_on_rlc_component` instead.",
995
- DeprecationWarning,
996
- )
997
- return self._pedb.source_excitation.add_port_on_rlc_component(
998
- component=component, circuit_ports=circuit_ports, pec_boundary=pec_boundary
999
- )
1000
-
1001
- def add_rlc_boundary(self, component=None, circuit_type=True):
1002
- """Add RLC gap boundary on component and replace it with a circuit port.
1003
- The circuit port supports only 2-pin components.
923
+ def _create_pin_group_terminal(
924
+ self, pingroup, isref=False, term_name=None, term_type="circuit"
925
+ ): # pragma: no cover
926
+ """Create pin group terminal.
1004
927
 
1005
- . deprecated:: pyedb 0.28.0
1006
- Use :func:`pyedb.grpc.core.excitations.add_rlc_boundary` instead.
928
+ .. deprecated:: 0.28.0
929
+ Use :func:`pyedb.grpc.core.excitations._create_pin_group_terminal` instead.
1007
930
 
1008
931
  Parameters
1009
932
  ----------
1010
- component : str
1011
- Reference designator of the RLC component.
1012
- circuit_type : bool
1013
- When ``True`` circuit type are defined, if ``False`` gap type will be used instead (compatible with HFSS 3D
1014
- modeler). Default value is ``True``.
933
+ pingroup : :class:`pyedb.grpc.database.hierarchy.pingroup.PinGroup`
934
+ Pin group.
935
+ isref : bool, optional
936
+ Is reference terminal.
937
+ term_name : str, optional
938
+ Terminal name.
939
+ term_type : str, optional
940
+ Terminal type.
1015
941
 
1016
942
  Returns
1017
943
  -------
1018
944
  bool
1019
- ``True`` when successful, ``False`` when failed.
1020
- """
1021
- warnings.warn(
1022
- "`add_rlc_boundary` is deprecated and is now located here "
1023
- "`pyedb.grpc.core.excitations.add_rlc_boundary` instead.",
1024
- DeprecationWarning,
1025
- )
1026
- return self._pedb.source_excitation.add_rlc_boundary(self, component=component, circuit_type=circuit_type)
1027
-
1028
- def _create_pin_group_terminal(self, pingroup, isref=False, term_name=None, term_type="circuit"):
1029
- """Creates an EDB pin group terminal from a given EDB pin group.
1030
-
1031
- . deprecated:: pyedb 0.28.0
1032
- Use :func:`pyedb.grpc.core.excitations._create_pin_group_terminal` instead.
1033
-
1034
- Parameters
1035
- ----------
1036
- pingroup : Edb pin group.
1037
-
1038
- isref : bool
1039
- Specify if this terminal a reference terminal.
1040
-
1041
- term_name : Terminal name (Optional). If not provided default name is Component name, Pin name, Net name.
1042
- str.
1043
-
1044
- term_type: Type of terminal, gap, circuit or auto.
1045
- str.
1046
- Returns
1047
- -------
1048
- Edb pin group terminal.
945
+ True if successful, False otherwise.
1049
946
  """
1050
947
  warnings.warn(
1051
948
  "`_create_pin_group_terminal` is deprecated and is now located here "
@@ -1056,20 +953,18 @@ class Components(object):
1056
953
  pingroup=pingroup, term_name=term_name, term_type=term_type, isref=isref
1057
954
  )
1058
955
 
1059
- def _is_top_component(self, cmp):
1060
- """Test the component placement layer.
956
+ def _is_top_component(self, cmp) -> bool:
957
+ """Check if component is on top layer.
1061
958
 
1062
959
  Parameters
1063
960
  ----------
1064
- cmp : self._pedb.component
1065
- Edb component.
961
+ cmp : :class:`pyedb.grpc.database.hierarchy.component.Component`
962
+ Component instance.
1066
963
 
1067
964
  Returns
1068
965
  -------
1069
966
  bool
1070
- ``True`` when component placed on top layer, ``False`` on bottom layer.
1071
-
1072
-
967
+ True if on top layer, False otherwise.
1073
968
  """
1074
969
  top_layer = self._pedb.stackup.signal[0].name
1075
970
  if cmp.placement_layer == top_layer:
@@ -1077,7 +972,21 @@ class Components(object):
1077
972
  else:
1078
973
  return False
1079
974
 
1080
- def _get_component_definition(self, name, pins):
975
+ def _get_component_definition(self, name, pins) -> Union[ComponentDef, None]:
976
+ """Get or create component definition.
977
+
978
+ Parameters
979
+ ----------
980
+ name : str
981
+ Definition name.
982
+ pins : list
983
+ List of pins.
984
+
985
+ Returns
986
+ -------
987
+ :class:`pyedb.grpc.database.definition.component_def.ComponentDef` or None
988
+ Component definition if successful, None otherwise.
989
+ """
1081
990
  component_definition = ComponentDef.find(self._db, name)
1082
991
  if component_definition.is_null:
1083
992
  from ansys.edb.core.layout.cell import Cell as GrpcCell
@@ -1087,7 +996,7 @@ class Components(object):
1087
996
  component_definition = ComponentDef.create(self._db, name, fp=foot_print_cell)
1088
997
  if component_definition.is_null:
1089
998
  self._logger.error(f"Failed to create component definition {name}")
1090
- return False
999
+ return None
1091
1000
  ind = 1
1092
1001
  for pin in pins:
1093
1002
  if not pin.name:
@@ -1112,43 +1021,38 @@ class Components(object):
1112
1021
  c_value=None,
1113
1022
  l_value=None,
1114
1023
  is_parallel=False,
1115
- ):
1116
- """Create a component from pins.
1024
+ ) -> Union[Component, bool]:
1025
+ """Create a new component.
1117
1026
 
1118
1027
  Parameters
1119
1028
  ----------
1120
- pins : list
1121
- List of EDB core pins.
1122
- component_name : str
1123
- Name of the reference designator for the component.
1029
+ pins : list[:class:`pyedb.grpc.database.padstacks.PadstackInstance`]
1030
+ List of pins.
1031
+ component_name : str, optional
1032
+ Component name.
1124
1033
  placement_layer : str, optional
1125
- Name of the layer used for placing the component.
1034
+ Placement layer name.
1126
1035
  component_part_name : str, optional
1127
- Part name of the component.
1036
+ Part name.
1128
1037
  is_rlc : bool, optional
1129
- Whether if the new component will be an RLC or not.
1130
- r_value : float
1131
- Resistor value.
1132
- c_value : float
1038
+ Whether the component is RLC.
1039
+ r_value : float, optional
1040
+ Resistance value.
1041
+ c_value : float, optional
1133
1042
  Capacitance value.
1134
- l_value : float
1135
- Inductor value.
1136
- is_parallel : bool
1137
- Using parallel model when ``True``, series when ``False``.
1043
+ l_value : float, optional
1044
+ Inductance value.
1045
+ is_parallel : bool, optional
1046
+ Whether RLC is parallel.
1138
1047
 
1139
1048
  Returns
1140
1049
  -------
1141
- bool
1142
- ``True`` when successful, ``False`` when failed.
1050
+ :class:`pyedb.grpc.database.hierarchy.component.Component` or bool
1051
+ New component instance if successful, False otherwise.
1143
1052
 
1144
1053
  Examples
1145
1054
  --------
1146
-
1147
- >>> from pyedb import Edb
1148
- >>> edbapp = Edb("myaedbfolder")
1149
- >>> pins = edbapp.components.get_pin_from_component("A1")
1150
- >>> edbapp.components.create(pins, "A1New")
1151
-
1055
+ >>> new_comp = edbapp.components.create(pins, "R1")
1152
1056
  """
1153
1057
  from ansys.edb.core.hierarchy.component_group import (
1154
1058
  ComponentGroup as GrpcComponentGroup,
@@ -1221,36 +1125,27 @@ class Components(object):
1221
1125
 
1222
1126
  def create_component_from_pins(
1223
1127
  self, pins, component_name, placement_layer=None, component_part_name=None
1224
- ): # pragma: no cover
1225
- """Create a component from pins.
1128
+ ) -> Union[Component, bool]: # pragma: no cover
1129
+ """Create component from pins.
1226
1130
 
1227
1131
  .. deprecated:: 0.6.62
1228
- Use :func:`create` method instead.
1132
+ Use :func:`create` instead.
1229
1133
 
1230
1134
  Parameters
1231
1135
  ----------
1232
1136
  pins : list
1233
- List of EDB core pins.
1137
+ List of pins.
1234
1138
  component_name : str
1235
- Name of the reference designator for the component.
1139
+ Component name.
1236
1140
  placement_layer : str, optional
1237
- Name of the layer used for placing the component.
1141
+ Placement layer.
1238
1142
  component_part_name : str, optional
1239
- Part name of the component. It's created a new definition if doesn't exists.
1143
+ Part name.
1240
1144
 
1241
1145
  Returns
1242
1146
  -------
1243
- bool
1244
- ``True`` when successful, ``False`` when failed.
1245
-
1246
- Examples
1247
- --------
1248
-
1249
- >>> from pyedb import Edb
1250
- >>> edbapp = Edb("myaedbfolder")
1251
- >>> pins = edbapp.components.get_pin_from_component("A1")
1252
- >>> edbapp.components.create(pins, "A1New")
1253
-
1147
+ :class:`pyedb.grpc.database.hierarchy.component.Component` or bool
1148
+ Component instance if successful, False otherwise.
1254
1149
  """
1255
1150
  warnings.warn("`create_component_from_pins` is deprecated use `create` instead..", DeprecationWarning)
1256
1151
  return self.create(
@@ -1261,35 +1156,28 @@ class Components(object):
1261
1156
  is_rlc=False,
1262
1157
  )
1263
1158
 
1264
- def set_component_model(self, componentname, model_type="Spice", modelpath=None, modelname=None):
1265
- """Assign a Spice or Touchstone model to a component.
1159
+ def set_component_model(self, componentname, model_type="Spice", modelpath=None, modelname=None) -> bool:
1160
+ """Set component model.
1266
1161
 
1267
1162
  Parameters
1268
1163
  ----------
1269
1164
  componentname : str
1270
- Name of the component.
1165
+ Component name.
1271
1166
  model_type : str, optional
1272
- Type of the model. Options are ``"Spice"`` and
1273
- ``"Touchstone"``. The default is ``"Spice"``.
1167
+ Model type ("Spice" or "Touchstone").
1274
1168
  modelpath : str, optional
1275
- Full path to the model file. The default is ``None``.
1169
+ Model file path.
1276
1170
  modelname : str, optional
1277
- Name of the model. The default is ``None``.
1171
+ Model name.
1278
1172
 
1279
1173
  Returns
1280
1174
  -------
1281
1175
  bool
1282
- ``True`` when successful, ``False`` when failed.
1176
+ True if successful, False otherwise.
1283
1177
 
1284
1178
  Examples
1285
1179
  --------
1286
-
1287
- >>> from pyedb import Edb
1288
- >>> edbapp = Edb("myaedbfolder")
1289
- >>> edbapp.components.set_component_model("A1", model_type="Spice",
1290
- ... modelpath="pathtospfile",
1291
- ... modelname="spicemodelname")
1292
-
1180
+ >>> edbapp.components.set_component_model("U1", "Spice", "path/to/model.sp")
1293
1181
  """
1294
1182
  if not modelname:
1295
1183
  modelname = get_filename_without_extension(modelpath)
@@ -1340,32 +1228,28 @@ class Components(object):
1340
1228
  component.component_property.model = s_parameter_mod
1341
1229
  return True
1342
1230
 
1343
- def create_pingroup_from_pins(self, pins, group_name=None):
1344
- """Create a pin group on a component.
1231
+ def create_pingroup_from_pins(self, pins, group_name=None) -> Union[PinGroup, bool]:
1232
+ """Create pin group from pins.
1345
1233
 
1346
1234
  Parameters
1347
1235
  ----------
1348
- pins : list
1349
- List of EDB pins.
1236
+ pins : list[:class:`pyedb.grpc.database.padstacks.PadstackInstance`]
1237
+ List of pins.
1350
1238
  group_name : str, optional
1351
- Name for the group. The default is ``None``, in which case
1352
- a default name is assigned as follows: ``[component Name] [NetName]``.
1239
+ Group name.
1353
1240
 
1354
1241
  Returns
1355
1242
  -------
1356
- tuple
1357
- The tuple is structured as: (bool, pingroup).
1243
+ :class:`pyedb.grpc.database.hierarchy.pingroup.PinGroup` or bool
1244
+ Pin group instance if successful, False otherwise.
1358
1245
 
1359
1246
  Examples
1360
1247
  --------
1361
- >>> from pyedb import Edb
1362
- >>> edbapp = Edb("myaedbfolder")
1363
- >>> edbapp.components.create_pingroup_from_pins(gndpinlist, "MyGNDPingroup")
1364
-
1248
+ >>> pingroup = edbapp.components.create_pingroup_from_pins(pins, "GND_pins")
1365
1249
  """
1366
1250
  if len(pins) < 1:
1367
1251
  self._logger.error("No pins specified for pin group %s", group_name)
1368
- return (False, None)
1252
+ return False
1369
1253
  if group_name is None:
1370
1254
  group_name = PinGroup.unique_name(self._active_layout, "pin_group")
1371
1255
  for pin in pins:
@@ -1395,31 +1279,22 @@ class Components(object):
1395
1279
  pin_group.net = pins[0].net
1396
1280
  return pin_group
1397
1281
 
1398
- def delete_single_pin_rlc(self, deactivate_only=False):
1399
- # type: (bool) -> list
1400
- """Delete all RLC components with a single pin.
1401
- Single pin component model type will be reverted to ``"RLC"``.
1282
+ def delete_single_pin_rlc(self, deactivate_only=False) -> list[str]:
1283
+ """Delete or deactivate single-pin RLC components.
1402
1284
 
1403
1285
  Parameters
1404
1286
  ----------
1405
1287
  deactivate_only : bool, optional
1406
- Whether to only deactivate RLC components with a single point rather than
1407
- delete them. The default is ``False``, in which case they are deleted.
1288
+ Whether to only deactivate instead of deleting.
1408
1289
 
1409
1290
  Returns
1410
1291
  -------
1411
- list
1412
- List of deleted RLC components.
1413
-
1292
+ list[str]
1293
+ List of affected components.
1414
1294
 
1415
1295
  Examples
1416
1296
  --------
1417
-
1418
- >>> from pyedb import Edb
1419
- >>> edbapp = Edb("myaedbfolder")
1420
- >>> list_of_deleted_rlcs = edbapp.components.delete_single_pin_rlc()
1421
- >>> print(list_of_deleted_rlcs)
1422
-
1297
+ >>> deleted = edbapp.components.delete_single_pin_rlc()
1423
1298
  """
1424
1299
  deleted_comps = []
1425
1300
  for comp, val in self.instances.items():
@@ -1435,26 +1310,22 @@ class Components(object):
1435
1310
  self._pedb.logger.info("Deleted {} components".format(len(deleted_comps)))
1436
1311
  return deleted_comps
1437
1312
 
1438
- def delete(self, component_name):
1313
+ def delete(self, component_name) -> bool:
1439
1314
  """Delete a component.
1440
1315
 
1441
1316
  Parameters
1442
1317
  ----------
1443
1318
  component_name : str
1444
- Name of the component.
1319
+ Component name.
1445
1320
 
1446
1321
  Returns
1447
1322
  -------
1448
1323
  bool
1449
- ``True`` when successful, ``False`` when failed.
1324
+ True if successful, False otherwise.
1450
1325
 
1451
1326
  Examples
1452
1327
  --------
1453
-
1454
- >>> from pyedb import Edb
1455
- >>> edbapp = Edb("myaedbfolder")
1456
- >>> edbapp.components.delete("A1")
1457
-
1328
+ >>> edbapp.components.delete("R1")
1458
1329
  """
1459
1330
  edb_cmp = self.get_component_by_name(component_name)
1460
1331
  if edb_cmp is not None:
@@ -1464,26 +1335,22 @@ class Components(object):
1464
1335
  return True
1465
1336
  return False
1466
1337
 
1467
- def disable_rlc_component(self, component_name):
1468
- """Disable a RLC component.
1338
+ def disable_rlc_component(self, component_name) -> bool:
1339
+ """Disable RLC component.
1469
1340
 
1470
1341
  Parameters
1471
1342
  ----------
1472
1343
  component_name : str
1473
- Name of the RLC component.
1344
+ Component name.
1474
1345
 
1475
1346
  Returns
1476
1347
  -------
1477
1348
  bool
1478
- ``True`` when successful, ``False`` when failed.
1349
+ True if successful, False otherwise.
1479
1350
 
1480
1351
  Examples
1481
1352
  --------
1482
-
1483
- >>> from pyedb import Edb
1484
- >>> edbapp = Edb("myaedbfolder")
1485
- >>> edbapp.components.disable_rlc_component("A1")
1486
-
1353
+ >>> edbapp.components.disable_rlc_component("R1")
1487
1354
  """
1488
1355
  cmp = self.get_component_by_name(component_name)
1489
1356
  if cmp is not None:
@@ -1512,46 +1379,40 @@ class Components(object):
1512
1379
  reference_size_x=0,
1513
1380
  reference_size_y=0,
1514
1381
  reference_height=0,
1515
- ):
1516
- """Set cylindrical solder balls on a given component.
1382
+ ) -> bool:
1383
+ """Set solder ball properties for a component.
1517
1384
 
1518
1385
  Parameters
1519
1386
  ----------
1520
- component : str or EDB component, optional
1521
- Name of the discrete component.
1522
- sball_diam : str, float, optional
1523
- Diameter of the solder ball.
1524
- sball_height : str, float, optional
1525
- Height of the solder ball.
1387
+ component : str or :class:`pyedb.grpc.database.hierarchy.component.Component`, optional
1388
+ Component name or instance.
1389
+ sball_diam : float, optional
1390
+ Solder ball diameter.
1391
+ sball_height : float, optional
1392
+ Solder ball height.
1526
1393
  shape : str, optional
1527
- Shape of solder ball. Options are ``"Cylinder"``,
1528
- ``"Spheroid"``. The default is ``"Cylinder"``.
1529
- sball_mid_diam : str, float, optional
1530
- Mid diameter of the solder ball.
1394
+ Solder ball shape ("Cylinder" or "Spheroid").
1395
+ sball_mid_diam : float, optional
1396
+ Solder ball mid diameter.
1531
1397
  chip_orientation : str, optional
1532
- Give the chip orientation, ``"chip_down"`` or ``"chip_up"``. Default is ``"chip_down"``. Only applicable on
1533
- IC model.
1398
+ Chip orientation ("chip_down" or "chip_up").
1534
1399
  auto_reference_size : bool, optional
1535
- Whether to automatically set reference size.
1536
- reference_size_x : int, str, float, optional
1537
- X size of the reference. Applicable when auto_reference_size is False.
1538
- reference_size_y : int, str, float, optional
1539
- Y size of the reference. Applicable when auto_reference_size is False.
1540
- reference_height : int, str, float, optional
1541
- Height of the reference. Applicable when auto_reference_size is False.
1400
+ Use auto reference size.
1401
+ reference_size_x : float, optional
1402
+ Reference size X.
1403
+ reference_size_y : float, optional
1404
+ Reference size Y.
1405
+ reference_height : float, optional
1406
+ Reference height.
1542
1407
 
1543
1408
  Returns
1544
1409
  -------
1545
1410
  bool
1546
- ``True`` when successful, ``False`` when failed.
1411
+ True if successful, False otherwise.
1547
1412
 
1548
1413
  Examples
1549
1414
  --------
1550
-
1551
- >>> from pyedb import Edb
1552
- >>> edbapp = Edb("myaedbfolder")
1553
- >>> edbapp.components.set_solder_ball("A1")
1554
-
1415
+ >>> edbapp.components.set_solder_ball("U1", sball_diam=0.5e-3)
1555
1416
  """
1556
1417
  if isinstance(component, str):
1557
1418
  if component in self.instances:
@@ -1610,36 +1471,30 @@ class Components(object):
1610
1471
  ind_value=None,
1611
1472
  cap_value=None,
1612
1473
  isparallel=False,
1613
- ):
1614
- """Update values for an RLC component.
1474
+ ) -> bool:
1475
+ """Set RLC values for a component.
1615
1476
 
1616
1477
  Parameters
1617
1478
  ----------
1618
- componentname :
1619
- Name of the RLC component.
1479
+ componentname : str
1480
+ Component name.
1620
1481
  res_value : float, optional
1621
- Resistance value. The default is ``None``.
1482
+ Resistance value.
1622
1483
  ind_value : float, optional
1623
- Inductor value. The default is ``None``.
1624
- cap_value : float optional
1625
- Capacitor value. The default is ``None``.
1484
+ Inductance value.
1485
+ cap_value : float, optional
1486
+ Capacitance value.
1626
1487
  isparallel : bool, optional
1627
- Whether the RLC component is parallel. The default is ``False``.
1488
+ Whether RLC is parallel.
1628
1489
 
1629
1490
  Returns
1630
1491
  -------
1631
1492
  bool
1632
- ``True`` when successful, ``False`` when failed.
1493
+ True if successful, False otherwise.
1633
1494
 
1634
1495
  Examples
1635
1496
  --------
1636
-
1637
- >>> from pyedb import Edb
1638
- >>> edbapp = Edb("myaedbfolder")
1639
- >>> edbapp.components.set_component_rlc(
1640
- ... "R1", res_value=50, ind_value=1e-9, cap_value=1e-12, isparallel=False
1641
- ... )
1642
-
1497
+ >>> edbapp.components.set_component_rlc("R1", res_value=50)
1643
1498
  """
1644
1499
  if res_value is None and ind_value is None and cap_value is None:
1645
1500
  self.instances[componentname].enabled = False
@@ -1689,34 +1544,30 @@ class Components(object):
1689
1544
  valuefield="Func des",
1690
1545
  comptype="Prod name",
1691
1546
  refdes="Pos / Place",
1692
- ):
1693
- """Update the EDC core component values (RLCs) with values coming from a BOM file.
1547
+ ) -> bool:
1548
+ """Update RLC values from BOM file.
1694
1549
 
1695
1550
  Parameters
1696
1551
  ----------
1697
1552
  bom_file : str
1698
- Full path to the BOM file, which is a delimited text file.
1699
- Header values needed inside the BOM reader must
1700
- be explicitly set if different from the defaults.
1553
+ BOM file path.
1701
1554
  delimiter : str, optional
1702
- Value to use for the delimiter. The default is ``";"``.
1555
+ Delimiter character.
1703
1556
  valuefield : str, optional
1704
- Field header containing the value of the component. The default is ``"Func des"``.
1705
- The value for this parameter must being with the value of the component
1706
- followed by a space and then the rest of the value. For example, ``"22pF"``.
1557
+ Value field name.
1707
1558
  comptype : str, optional
1708
- Field header containing the type of component. The default is ``"Prod name"``. For
1709
- example, you might enter ``"Inductor"``.
1559
+ Component type field name.
1710
1560
  refdes : str, optional
1711
- Field header containing the reference designator of the component. The default is
1712
- ``"Pos / Place"``. For example, you might enter ``"C100"``.
1561
+ Reference designator field name.
1713
1562
 
1714
1563
  Returns
1715
1564
  -------
1716
1565
  bool
1717
- ``True`` if the file contains the header and it is correctly parsed. ``True`` is
1718
- returned even if no values are assigned.
1566
+ True if successful, False otherwise.
1719
1567
 
1568
+ Examples
1569
+ --------
1570
+ >>> edbapp.components.update_rlc_from_bom("bom.csv")
1720
1571
  """
1721
1572
  with open(bom_file, "r") as f:
1722
1573
  Lines = f.readlines()
@@ -1759,29 +1610,32 @@ class Components(object):
1759
1610
  part_name_col=1,
1760
1611
  comp_type_col=2,
1761
1612
  value_col=3,
1762
- ):
1763
- """Load external BOM file.
1613
+ ) -> bool:
1614
+ """Import BOM file.
1764
1615
 
1765
1616
  Parameters
1766
1617
  ----------
1767
1618
  bom_file : str
1768
- Full path to the BOM file, which is a delimited text file.
1619
+ BOM file path.
1769
1620
  delimiter : str, optional
1770
- Value to use for the delimiter. The default is ``","``.
1621
+ Delimiter character.
1771
1622
  refdes_col : int, optional
1772
- Column index of reference designator. The default is ``"0"``.
1623
+ Reference designator column index.
1773
1624
  part_name_col : int, optional
1774
- Column index of part name. The default is ``"1"``. Set to ``None`` if
1775
- the column does not exist.
1625
+ Part name column index.
1776
1626
  comp_type_col : int, optional
1777
- Column index of component type. The default is ``"2"``.
1627
+ Component type column index.
1778
1628
  value_col : int, optional
1779
- Column index of value. The default is ``"3"``. Set to ``None``
1780
- if the column does not exist.
1629
+ Value column index.
1781
1630
 
1782
1631
  Returns
1783
1632
  -------
1784
1633
  bool
1634
+ True if successful, False otherwise.
1635
+
1636
+ Examples
1637
+ --------
1638
+ >>> edbapp.components.import_bom("bom.csv")
1785
1639
  """
1786
1640
  with open(bom_file, "r") as f:
1787
1641
  lines = f.readlines()
@@ -1839,15 +1693,24 @@ class Components(object):
1839
1693
  self.instances[comp].enabled = False
1840
1694
  return True
1841
1695
 
1842
- def export_bom(self, bom_file, delimiter=","):
1843
- """Export Bom file from layout.
1696
+ def export_bom(self, bom_file, delimiter=",") -> bool:
1697
+ """Export BOM file.
1844
1698
 
1845
1699
  Parameters
1846
1700
  ----------
1847
1701
  bom_file : str
1848
- Full path to the BOM file, which is a delimited text file.
1702
+ Output file path.
1849
1703
  delimiter : str, optional
1850
- Value to use for the delimiter. The default is ``","``.
1704
+ Delimiter character.
1705
+
1706
+ Returns
1707
+ -------
1708
+ bool
1709
+ True if successful, False otherwise.
1710
+
1711
+ Examples
1712
+ --------
1713
+ >>> edbapp.components.export_bom("exported_bom.csv")
1851
1714
  """
1852
1715
  with open(bom_file, "w") as f:
1853
1716
  f.writelines([delimiter.join(["RefDes", "Part name", "Type", "Value\n"])])
@@ -1869,57 +1732,64 @@ class Components(object):
1869
1732
  f.writelines([delimiter.join([refdes, part_name, comp_type, value + "\n"])])
1870
1733
  return True
1871
1734
 
1872
- def find_by_reference_designator(self, reference_designator):
1873
- """Find a component.
1735
+ def find_by_reference_designator(self, reference_designator) -> Component:
1736
+ """Find component by reference designator.
1874
1737
 
1875
1738
  Parameters
1876
1739
  ----------
1877
1740
  reference_designator : str
1878
- Reference designator of the component.
1741
+ Reference designator.
1742
+
1743
+ Returns
1744
+ -------
1745
+ :class:`pyedb.grpc.database.hierarchy.component.Component`
1746
+ Component instance.
1747
+
1748
+ Examples
1749
+ --------
1750
+ >>> comp = edbapp.components.find_by_reference_designator("R1")
1879
1751
  """
1880
1752
  return self.instances[reference_designator]
1881
1753
 
1882
- def get_aedt_pin_name(self, pin):
1883
- """Retrieve the pin name that is shown in AEDT.
1884
-
1885
- .. note::
1886
- To obtain the EDB core pin name, use `pin.GetName()`.
1754
+ def get_aedt_pin_name(self, pin) -> str:
1755
+ """Get AEDT pin name.
1887
1756
 
1888
1757
  Parameters
1889
1758
  ----------
1890
- pin : str
1891
- Name of the pin in EDB core.
1759
+ pin : :class:`pyedb.grpc.database.padstacks.PadstackInstance`
1760
+ Pin instance.
1892
1761
 
1893
1762
  Returns
1894
1763
  -------
1895
1764
  str
1896
- Name of the pin in AEDT.
1765
+ AEDT pin name.
1897
1766
 
1898
1767
  Examples
1899
1768
  --------
1900
-
1901
- >>> from pyedb import Edb
1902
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
1903
- >>> edbapp.components.get_aedt_pin_name(pin)
1904
-
1769
+ >>> name = edbapp.components.get_aedt_pin_name(pin)
1905
1770
  """
1906
1771
  return pin.aedt_name
1907
1772
 
1908
- def get_pins(self, reference_designator, net_name=None, pin_name=None):
1909
- """Get component pins.
1773
+ def get_pins(self, reference_designator, net_name=None, pin_name=None) -> dict:
1774
+ """Get pins of a component.
1910
1775
 
1911
1776
  Parameters
1912
1777
  ----------
1913
1778
  reference_designator : str
1914
- Reference designator of the component.
1779
+ Reference designator.
1915
1780
  net_name : str, optional
1916
- Name of the net.
1781
+ Net name filter.
1917
1782
  pin_name : str, optional
1918
- Name of the pin.
1783
+ Pin name filter.
1919
1784
 
1920
1785
  Returns
1921
1786
  -------
1787
+ dict
1788
+ Dictionary of pins.
1922
1789
 
1790
+ Examples
1791
+ --------
1792
+ >>> pins = edbapp.components.get_pins("U1", net_name="GND")
1923
1793
  """
1924
1794
  comp = self.find_by_reference_designator(reference_designator)
1925
1795
 
@@ -1932,26 +1802,22 @@ class Components(object):
1932
1802
 
1933
1803
  return pins
1934
1804
 
1935
- def get_pin_position(self, pin):
1936
- """Retrieve the pin position in meters.
1805
+ def get_pin_position(self, pin) -> list[float]:
1806
+ """Get pin position.
1937
1807
 
1938
1808
  Parameters
1939
1809
  ----------
1940
- pin : str
1941
- Name of the pin.
1810
+ pin : :class:`pyedb.grpc.database.padstacks.PadstackInstance`
1811
+ Pin instance.
1942
1812
 
1943
1813
  Returns
1944
1814
  -------
1945
- list
1946
- Pin position as a list of float values in the form ``[x, y]``.
1815
+ list[float]
1816
+ [x, y] position in meters.
1947
1817
 
1948
1818
  Examples
1949
1819
  --------
1950
-
1951
- >>> from pyedb import Edb
1952
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
1953
- >>> edbapp.components.get_pin_position(pin)
1954
-
1820
+ >>> pos = edbapp.components.get_pin_position(pin)
1955
1821
  """
1956
1822
 
1957
1823
  pt_pos = pin.position
@@ -1961,28 +1827,24 @@ class Components(object):
1961
1827
  transformed_pt_pos = pin.component.transform.transform_point(pt_pos)
1962
1828
  return [transformed_pt_pos[0].value, transformed_pt_pos[1].value]
1963
1829
 
1964
- def get_pins_name_from_net(self, net_name, pin_list=None):
1965
- """Retrieve pins belonging to a net.
1830
+ def get_pins_name_from_net(self, net_name, pin_list=None) -> list[str]:
1831
+ """Get pin names from net.
1966
1832
 
1967
1833
  Parameters
1968
1834
  ----------
1969
- pin_list : list of EDBPadstackInstance, optional
1970
- List of pins to check. The default is ``None``, in which case all pins are checked
1971
1835
  net_name : str
1972
- Name of the net.
1836
+ Net name.
1837
+ pin_list : list, optional
1838
+ List of pins to search.
1973
1839
 
1974
1840
  Returns
1975
1841
  -------
1976
- list of str names:
1977
- Pins belonging to the net.
1842
+ list[str]
1843
+ List of pin names.
1978
1844
 
1979
1845
  Examples
1980
1846
  --------
1981
-
1982
- >>> from pyedb import Edb
1983
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
1984
- >>> edbapp.components.get_pins_name_from_net(pin_list, net_name)
1985
-
1847
+ >>> pins = edbapp.components.get_pins_name_from_net("GND")
1986
1848
  """
1987
1849
  pin_names = []
1988
1850
  if not pin_list:
@@ -1996,49 +1858,41 @@ class Components(object):
1996
1858
  pin_names.append(self.get_aedt_pin_name(pin))
1997
1859
  return pin_names
1998
1860
 
1999
- def get_nets_from_pin_list(self, pins):
2000
- """Retrieve nets with one or more pins.
1861
+ def get_nets_from_pin_list(self, pins) -> list[str]:
1862
+ """Get nets from pin list.
2001
1863
 
2002
1864
  Parameters
2003
1865
  ----------
2004
- PinList : list
1866
+ pins : list
2005
1867
  List of pins.
2006
1868
 
2007
1869
  Returns
2008
1870
  -------
2009
- list
2010
- List of nets with one or more pins.
1871
+ list[str]
1872
+ List of net names.
2011
1873
 
2012
1874
  Examples
2013
1875
  --------
2014
-
2015
- >>> from pyedb import Edb
2016
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
2017
- >>> edbapp.components.get_nets_from_pin_list(pins)
2018
-
1876
+ >>> nets = edbapp.components.get_nets_from_pin_list(pins)
2019
1877
  """
2020
1878
  return list(set([pin.net.name for pin in pins]))
2021
1879
 
2022
- def get_component_net_connection_info(self, refdes):
2023
- """Retrieve net connection information.
1880
+ def get_component_net_connection_info(self, refdes) -> dict:
1881
+ """Get net connection info for a component.
2024
1882
 
2025
1883
  Parameters
2026
1884
  ----------
2027
- refdes :
2028
- Reference designator for the net.
1885
+ refdes : str
1886
+ Reference designator.
2029
1887
 
2030
1888
  Returns
2031
1889
  -------
2032
1890
  dict
2033
- Dictionary of the net connection information for the reference designator.
1891
+ Dictionary with refdes, pin_name, and net_name.
2034
1892
 
2035
1893
  Examples
2036
1894
  --------
2037
-
2038
- >>> from pyedb import Edb
2039
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
2040
- >>> edbapp.components.get_component_net_connection_info(refdes)
2041
-
1895
+ >>> info = edbapp.components.get_component_net_connection_info("U1")
2042
1896
  """
2043
1897
  data = {"refdes": [], "pin_name": [], "net_name": []}
2044
1898
  for _, pin_obj in self.instances[refdes].pins.items():
@@ -2051,22 +1905,17 @@ class Components(object):
2051
1905
  data["net_name"].append(net_name)
2052
1906
  return data
2053
1907
 
2054
- def get_rats(self):
2055
- """Retrieve a list of dictionaries of the reference designator, pin names, and net names.
1908
+ def get_rats(self) -> list[dict]:
1909
+ """Get RATS (Reference Designator, Pin, Net) information.
2056
1910
 
2057
1911
  Returns
2058
1912
  -------
2059
- list
2060
- List of dictionaries of the reference designator, pin names,
2061
- and net names.
1913
+ list[dict]
1914
+ List of dictionaries with refdes, pin_name, and net_name.
2062
1915
 
2063
1916
  Examples
2064
1917
  --------
2065
-
2066
- >>> from pyedb import Edb
2067
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
2068
- >>> edbapp.components.get_rats()
2069
-
1918
+ >>> rats = edbapp.components.get_rats()
2070
1919
  """
2071
1920
  df_list = []
2072
1921
  for refdes in self.instances.keys():
@@ -2074,26 +1923,22 @@ class Components(object):
2074
1923
  df_list.append(df)
2075
1924
  return df_list
2076
1925
 
2077
- def get_through_resistor_list(self, threshold=1):
2078
- """Retrieve through resistors.
1926
+ def get_through_resistor_list(self, threshold=1) -> list[str]:
1927
+ """Get through resistors below threshold.
2079
1928
 
2080
1929
  Parameters
2081
1930
  ----------
2082
- threshold : int, optional
2083
- Threshold value. The default is ``1``.
1931
+ threshold : float, optional
1932
+ Resistance threshold.
2084
1933
 
2085
1934
  Returns
2086
1935
  -------
2087
- list
2088
- List of through resistors.
1936
+ list[str]
1937
+ List of component names.
2089
1938
 
2090
1939
  Examples
2091
1940
  --------
2092
-
2093
- >>> from pyedb import Edb
2094
- >>> edbapp = Edb("myaedbfolder", "project name", "release version")
2095
- >>> edbapp.components.get_through_resistor_list()
2096
-
1941
+ >>> resistors = edbapp.components.get_through_resistor_list(1)
2097
1942
  """
2098
1943
  through_comp_list = []
2099
1944
  for refdes, comp_obj in self.resistors.items():
@@ -2108,30 +1953,26 @@ class Components(object):
2108
1953
 
2109
1954
  return through_comp_list
2110
1955
 
2111
- def short_component_pins(self, component_name, pins_to_short=None, width=1e-3):
2112
- """Short pins of component with a trace.
1956
+ def short_component_pins(self, component_name, pins_to_short=None, width=1e-3) -> bool:
1957
+ """Short component pins with traces.
2113
1958
 
2114
1959
  Parameters
2115
1960
  ----------
2116
1961
  component_name : str
2117
- Name of the component.
2118
- pins_to_short : list, optional
2119
- List of pins to short. If `None`, all pins will be shorted.
1962
+ Component name.
1963
+ pins_to_short : list[str], optional
1964
+ List of pin names to short.
2120
1965
  width : float, optional
2121
- Short Trace width. It will be used in trace computation algorithm
1966
+ Trace width.
2122
1967
 
2123
1968
  Returns
2124
1969
  -------
2125
1970
  bool
2126
- ``True`` when successful, ``False`` when failed.
1971
+ True if successful, False otherwise.
2127
1972
 
2128
1973
  Examples
2129
1974
  --------
2130
-
2131
- >>> from pyedb import Edb
2132
- >>> edbapp = Edb("myaedbfolder")
2133
1975
  >>> edbapp.components.short_component_pins("J4A2", ["G4", "9", "3"])
2134
-
2135
1976
  """
2136
1977
  component = self.instances[component_name]
2137
1978
  pins = component.pins
@@ -2248,21 +2089,26 @@ class Components(object):
2248
2089
  i += 1
2249
2090
  return True
2250
2091
 
2251
- def create_pin_group(self, reference_designator, pin_numbers, group_name=None):
2252
- """Create pin group on the component.
2092
+ def create_pin_group(self, reference_designator, pin_numbers, group_name=None) -> Union[tuple[str, PinGroup], bool]:
2093
+ """Create pin group on a component.
2253
2094
 
2254
2095
  Parameters
2255
2096
  ----------
2256
2097
  reference_designator : str
2257
- References designator of the component.
2258
- pin_numbers : int, str, list[str] or list[:class: `PadstackInstance]`
2259
- List of pins.
2098
+ Reference designator.
2099
+ pin_numbers : list[str]
2100
+ List of pin names.
2260
2101
  group_name : str, optional
2261
- Name of the pin group.
2102
+ Group name.
2262
2103
 
2263
2104
  Returns
2264
2105
  -------
2265
- PinGroup
2106
+ tuple[str, :class:`pyedb.grpc.database.hierarchy.pingroup.PinGroup`] or bool
2107
+ (group_name, PinGroup) if successful, False otherwise.
2108
+
2109
+ Examples
2110
+ --------
2111
+ >>> name, group = edbapp.components.create_pin_group("U1", ["1", "2"])
2266
2112
  """
2267
2113
  if not isinstance(pin_numbers, list):
2268
2114
  pin_numbers = [pin_numbers]
@@ -2288,21 +2134,26 @@ class Components(object):
2288
2134
  return group_name, PinGroup(self._pedb, pingroup)
2289
2135
  return False
2290
2136
 
2291
- def create_pin_group_on_net(self, reference_designator, net_name, group_name=None):
2292
- """Create pin group on component by net name.
2137
+ def create_pin_group_on_net(self, reference_designator, net_name, group_name=None) -> PinGroup:
2138
+ """Create pin group by net name.
2293
2139
 
2294
2140
  Parameters
2295
2141
  ----------
2296
2142
  reference_designator : str
2297
- References designator of the component.
2143
+ Reference designator.
2298
2144
  net_name : str
2299
- Name of the net.
2145
+ Net name.
2300
2146
  group_name : str, optional
2301
- Name of the pin group. The default value is ``None``.
2147
+ Group name.
2302
2148
 
2303
2149
  Returns
2304
2150
  -------
2305
- PinGroup
2151
+ :class:`pyedb.grpc.database.hierarchy.pingroup.PinGroup`
2152
+ Pin group instance.
2153
+
2154
+ Examples
2155
+ --------
2156
+ >>> group = edbapp.components.create_pin_group_on_net("U1", "GND")
2306
2157
  """
2307
2158
  pins = [
2308
2159
  pin.name for pin in list(self.instances[reference_designator].pins.values()) if pin.net_name == net_name