pyedb 0.50.0__py3-none-any.whl → 0.51.2__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 (75) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_ports_sources.py +79 -239
  3. pyedb/configuration/configuration.py +27 -0
  4. pyedb/dotnet/clr_module.py +9 -3
  5. pyedb/dotnet/database/cell/hierarchy/component.py +3 -3
  6. pyedb/dotnet/database/cell/layout.py +10 -1
  7. pyedb/dotnet/database/dotnet/database.py +0 -2
  8. pyedb/dotnet/database/edb_data/padstacks_data.py +13 -0
  9. pyedb/dotnet/database/layout_validation.py +17 -13
  10. pyedb/dotnet/database/modeler.py +0 -1
  11. pyedb/dotnet/edb.py +7 -1
  12. pyedb/generic/design_types.py +183 -62
  13. pyedb/grpc/database/components.py +604 -652
  14. pyedb/grpc/database/control_file.py +597 -155
  15. pyedb/grpc/database/definition/component_def.py +17 -14
  16. pyedb/grpc/database/definition/materials.py +27 -27
  17. pyedb/grpc/database/definition/package_def.py +8 -8
  18. pyedb/grpc/database/definition/padstack_def.py +31 -33
  19. pyedb/grpc/database/definitions.py +36 -2
  20. pyedb/grpc/database/geometry/arc_data.py +5 -5
  21. pyedb/grpc/database/geometry/point_3d_data.py +3 -3
  22. pyedb/grpc/database/geometry/polygon_data.py +5 -5
  23. pyedb/grpc/database/hfss.py +412 -395
  24. pyedb/grpc/database/hierarchy/component.py +67 -58
  25. pyedb/grpc/database/hierarchy/pin_pair_model.py +6 -6
  26. pyedb/grpc/database/hierarchy/pingroup.py +13 -11
  27. pyedb/grpc/database/hierarchy/s_parameter_model.py +1 -1
  28. pyedb/grpc/database/hierarchy/spice_model.py +1 -1
  29. pyedb/grpc/database/layers/layer.py +2 -2
  30. pyedb/grpc/database/layers/stackup_layer.py +26 -23
  31. pyedb/grpc/database/layout/layout.py +12 -12
  32. pyedb/grpc/database/layout/voltage_regulator.py +8 -8
  33. pyedb/grpc/database/layout_validation.py +58 -7
  34. pyedb/grpc/database/modeler.py +248 -245
  35. pyedb/grpc/database/net/differential_pair.py +4 -4
  36. pyedb/grpc/database/net/extended_net.py +7 -8
  37. pyedb/grpc/database/net/net.py +57 -46
  38. pyedb/grpc/database/nets.py +362 -116
  39. pyedb/grpc/database/padstacks.py +259 -178
  40. pyedb/grpc/database/ports/ports.py +23 -17
  41. pyedb/grpc/database/primitive/padstack_instance.py +45 -30
  42. pyedb/grpc/database/primitive/path.py +6 -6
  43. pyedb/grpc/database/primitive/polygon.py +9 -9
  44. pyedb/grpc/database/primitive/primitive.py +21 -21
  45. pyedb/grpc/database/primitive/rectangle.py +1 -1
  46. pyedb/grpc/database/simulation_setup/hfss_advanced_settings.py +1 -1
  47. pyedb/grpc/database/simulation_setup/hfss_general_settings.py +1 -1
  48. pyedb/grpc/database/simulation_setup/hfss_settings_options.py +1 -1
  49. pyedb/grpc/database/simulation_setup/hfss_simulation_settings.py +6 -6
  50. pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +2 -2
  51. pyedb/grpc/database/simulation_setup/raptor_x_simulation_settings.py +2 -2
  52. pyedb/grpc/database/simulation_setup/raptor_x_simulation_setup.py +1 -1
  53. pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +3 -3
  54. pyedb/grpc/database/siwave.py +226 -214
  55. pyedb/grpc/database/source_excitations.py +307 -40
  56. pyedb/grpc/database/stackup.py +461 -283
  57. pyedb/grpc/database/terminal/bundle_terminal.py +12 -12
  58. pyedb/grpc/database/terminal/edge_terminal.py +6 -5
  59. pyedb/grpc/database/terminal/padstack_instance_terminal.py +13 -13
  60. pyedb/grpc/database/terminal/pingroup_terminal.py +12 -12
  61. pyedb/grpc/database/terminal/point_terminal.py +6 -6
  62. pyedb/grpc/database/terminal/terminal.py +26 -26
  63. pyedb/grpc/database/utility/heat_sink.py +5 -5
  64. pyedb/grpc/database/utility/hfss_extent_info.py +21 -21
  65. pyedb/grpc/database/utility/layout_statistics.py +13 -13
  66. pyedb/grpc/database/utility/rlc.py +3 -3
  67. pyedb/grpc/database/utility/sources.py +1 -1
  68. pyedb/grpc/database/utility/sweep_data_distribution.py +1 -1
  69. pyedb/grpc/edb.py +542 -739
  70. pyedb/grpc/edb_init.py +50 -3
  71. {pyedb-0.50.0.dist-info → pyedb-0.51.2.dist-info}/METADATA +1 -1
  72. {pyedb-0.50.0.dist-info → pyedb-0.51.2.dist-info}/RECORD +74 -75
  73. pyedb/grpc/database/utility/simulation_configuration.py +0 -3305
  74. {pyedb-0.50.0.dist-info → pyedb-0.51.2.dist-info}/LICENSE +0 -0
  75. {pyedb-0.50.0.dist-info → pyedb-0.51.2.dist-info}/WHEEL +0 -0
@@ -55,7 +55,7 @@ from pyedb.modeler.geometry_operators import GeometryOperators
55
55
 
56
56
 
57
57
  class Padstacks(object):
58
- """Manages EDB methods for nets management accessible from `Edb.padstacks` property.
58
+ """Manages EDB methods for padstacks accessible from `Edb.padstacks` property.
59
59
 
60
60
  Examples
61
61
  --------
@@ -65,16 +65,18 @@ class Padstacks(object):
65
65
  """
66
66
 
67
67
  def __getitem__(self, name):
68
- """Get a padstack definition or instance from the Edb project.
68
+ """Get a padstack definition or instance from the EDB project.
69
69
 
70
70
  Parameters
71
71
  ----------
72
72
  name : str, int
73
+ Name or ID of the padstack definition or instance.
73
74
 
74
75
  Returns
75
76
  -------
76
- :class:`pyedb.dotnet.database.cell.hierarchy.component.EDBComponent`
77
-
77
+ :class:`pyedb.dotnet.database.definition.padstack_def.PadstackDef` or
78
+ :class:`pyedb.dotnet.database.primitive.padstack_instance.PadstackInstance`
79
+ Requested padstack definition or instance. Returns ``None`` if not found.
78
80
  """
79
81
  if isinstance(name, int) and name in self.instances:
80
82
  return self.instances(name)
@@ -128,6 +130,11 @@ class Padstacks(object):
128
130
  -------
129
131
  object
130
132
  EDB.PadType enumerator value.
133
+
134
+ Examples
135
+ --------
136
+ >>> pad_type = edb_padstacks.int_to_pad_type(0) # Returns REGULAR_PAD
137
+ >>> pad_type = edb_padstacks.int_to_pad_type(1) # Returns ANTI_PAD
131
138
  """
132
139
 
133
140
  if val == 0:
@@ -154,6 +161,11 @@ class Padstacks(object):
154
161
  -------
155
162
  object
156
163
  EDB.PadGeometryType enumerator value.
164
+
165
+ Examples
166
+ --------
167
+ >>> geom_type = edb_padstacks.int_to_geometry_type(1) # Returns CIRCLE
168
+ >>> geom_type = edb_padstacks.int_to_geometry_type(2) # Returns SQUARE
157
169
  """
158
170
  if val == 0:
159
171
  return GrpcPadGeometryType.PADGEOMTYPE_NO_GEOMETRY
@@ -188,9 +200,14 @@ class Padstacks(object):
188
200
 
189
201
  Returns
190
202
  -------
191
- dict[str, :class:`pyedb.dotnet.database.edb_data.padstacks_data.EdbPadstack`]
192
- List of definitions via padstack definitions.
203
+ dict[str, :class:`pyedb.grpc.database.definition.padstack_def.PadstackDef`]
204
+ Dictionary of padstack definitions with definition names as keys.
193
205
 
206
+ Examples
207
+ --------
208
+ >>> all_definitions = edb_padstacks.definitions
209
+ >>> for name, definition in all_definitions.items():
210
+ ... print(f"Padstack: {name}")
194
211
  """
195
212
  if len(self._definitions) == len(self.db.padstack_defs):
196
213
  return self._definitions
@@ -202,13 +219,18 @@ class Padstacks(object):
202
219
 
203
220
  @property
204
221
  def instances(self):
205
- """Dictionary of all padstack instances (vias and pins).
222
+ """All padstack instances (vias and pins) in the layout.
206
223
 
207
224
  Returns
208
225
  -------
209
- dict[int, :class:`dotnet.database.edb_data.padstacks_data.EDBPadstackInstance`]
210
- List of padstack instances.
226
+ dict[int, :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
227
+ Dictionary of padstack instances with database IDs as keys.
211
228
 
229
+ Examples
230
+ --------
231
+ >>> all_instances = edb_padstacks.instances
232
+ >>> for id, instance in all_instances.items():
233
+ ... print(f"Instance {id}: {instance.name}")
212
234
  """
213
235
  pad_stack_inst = self._pedb.layout.padstack_instances
214
236
  if len(self._instances) == len(pad_stack_inst):
@@ -218,13 +240,18 @@ class Padstacks(object):
218
240
 
219
241
  @property
220
242
  def instances_by_name(self):
221
- """Dictionary of all padstack instances (vias and pins) by name.
243
+ """All padstack instances (vias and pins) indexed by name.
222
244
 
223
245
  Returns
224
246
  -------
225
- dict[str, :class:`dotnet.database.edb_data.padstacks_data.EDBPadstackInstance`]
226
- List of padstack instances.
247
+ dict[str, :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
248
+ Dictionary of padstack instances with names as keys.
227
249
 
250
+ Examples
251
+ --------
252
+ >>> named_instances = edb_padstacks.instances_by_name
253
+ >>> for name, instance in named_instances.items():
254
+ ... print(f"Instance named {name}")
228
255
  """
229
256
  padstack_instances = {}
230
257
  for _, edb_padstack_instance in self.instances.items():
@@ -233,28 +260,40 @@ class Padstacks(object):
233
260
  return padstack_instances
234
261
 
235
262
  def find_instance_by_id(self, value: int):
236
- """Find a padstack instance by database id.
263
+ """Find a padstack instance by database ID.
237
264
 
238
265
  Parameters
239
266
  ----------
240
267
  value : int
268
+ Database ID of the padstack instance.
269
+
270
+ Returns
271
+ -------
272
+ :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance` or None
273
+ Padstack instance if found, otherwise ``None``.
274
+
275
+ Examples
276
+ --------
277
+ >>> via = edb_padstacks.find_instance_by_id(123)
278
+ >>> if via:
279
+ ... print(f"Found via: {via.name}")
241
280
  """
242
281
  return self._pedb.modeler.find_object_by_id(value)
243
282
 
244
283
  @property
245
284
  def pins(self):
246
- """Dictionary of all pins instances (belonging to component).
285
+ """All pin instances belonging to components.
247
286
 
248
287
  Returns
249
288
  -------
250
- dic[str, :class:`dotnet.database.edb_data.definitions.EDBPadstackInstance`]
251
- Dictionary of EDBPadstackInstance Components.
252
-
289
+ dict[int, :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
290
+ Dictionary of pin instances with database IDs as keys.
253
291
 
254
292
  Examples
255
293
  --------
256
- >>> edbapp = dotnet.Edb("myproject.aedb")
257
- >>> pin_net_name = edbapp.pins[424968329].netname
294
+ >>> all_pins = edb_padstacks.pins
295
+ >>> for pin_id, pin in all_pins.items():
296
+ ... print(f"Pin {pin_id} belongs to {pin.component.refdes}")
258
297
  """
259
298
  pins = {}
260
299
  for instancename, instance in self.instances.items():
@@ -264,18 +303,18 @@ class Padstacks(object):
264
303
 
265
304
  @property
266
305
  def vias(self):
267
- """Dictionary of all vias instances not belonging to component.
306
+ """All via instances not belonging to components.
268
307
 
269
308
  Returns
270
309
  -------
271
- dic[str, :class:`dotnet.database.edb_data.definitions.EDBPadstackInstance`]
272
- Dictionary of EDBPadstackInstance Components.
273
-
310
+ dict[int, :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
311
+ Dictionary of via instances with database IDs as keys.
274
312
 
275
313
  Examples
276
314
  --------
277
- >>> edbapp = dotnet.Edb("myproject.aedb")
278
- >>> pin_net_name = edbapp.pins[424968329].netname
315
+ >>> all_vias = edb_padstacks.vias
316
+ >>> for via_id, via in all_vias.items():
317
+ ... print(f"Via {via_id} on net {via.net_name}")
279
318
  """
280
319
  pnames = list(self.pins.keys())
281
320
  vias = {i: j for i, j in self.instances.items() if i not in pnames}
@@ -292,6 +331,11 @@ class Padstacks(object):
292
331
  -------
293
332
  list
294
333
  List of all layout pin groups.
334
+
335
+ Examples
336
+ --------
337
+ >>> groups = edb_padstacks.pingroups # Deprecated
338
+ >>> groups = edb_padstacks._layout.pin_groups # New way
295
339
  """
296
340
  warnings.warn(
297
341
  "`pingroups` is deprecated and is now located here " "`pyedb.grpc.core.layout.pin_groups` instead.",
@@ -335,6 +379,15 @@ class Padstacks(object):
335
379
  -------
336
380
  str
337
381
  Name of the padstack if the operation is successful.
382
+
383
+ Examples
384
+ --------
385
+ >>> via_name = edb_padstacks.create_circular_padstack(
386
+ ... padstackname="VIA1",
387
+ ... holediam="200um",
388
+ ... paddiam="400um",
389
+ ... antipaddiam="600um"
390
+ ... )
338
391
  """
339
392
 
340
393
  padstack_def = PadstackDef.create(self._pedb.db, padstackname)
@@ -412,17 +465,17 @@ class Padstacks(object):
412
465
  Parameters
413
466
  ----------
414
467
  net_names : str, list
415
- Names of the nets to delete.
468
+ Names of the nets whose padstack instances should be deleted.
416
469
 
417
470
  Returns
418
471
  -------
419
472
  bool
420
473
  ``True`` when successful, ``False`` when failed.
421
474
 
422
- References
423
- ----------
424
-
425
- >>> Edb.padstacks.delete_padstack_instances(net_names=["GND"])
475
+ Examples
476
+ --------
477
+ >>> success = edb_padstacks.delete_padstack_instances("GND")
478
+ >>> success = edb_padstacks.delete_padstack_instances(["GND", "PWR"])
426
479
  """
427
480
  if not isinstance(net_names, list): # pragma: no cover
428
481
  net_names = [net_names]
@@ -434,23 +487,28 @@ class Padstacks(object):
434
487
  return True
435
488
 
436
489
  def set_solderball(self, padstackInst, sballLayer_name, isTopPlaced=True, ballDiam=100e-6):
437
- """Set solderball for the given PadstackInstance.
490
+ """Set solderball for a padstack instance.
438
491
 
439
492
  Parameters
440
493
  ----------
441
- padstackInst : Edb.Cell.Primitive.PadstackInstance or int
442
- Padstack instance id or object.
443
- sballLayer_name : str,
444
- Name of the layer where the solder ball is placed. No default values.
445
- isTopPlaced : bool, optional.
446
- Bollean triggering is the solder ball is placed on Top or Bottom of the layer stackup.
447
- ballDiam : double, optional,
448
- Solder ball diameter value.
494
+ padstackInst : int or :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`
495
+ Padstack instance ID or object.
496
+ sballLayer_name : str
497
+ Name of the layer where the solder ball is placed.
498
+ isTopPlaced : bool, optional
499
+ Whether the solder ball is placed on top of the layer stackup. Default is ``True``.
500
+ ballDiam : float, optional
501
+ Solder ball diameter in meters. Default is ``100e-6`` (100 um).
449
502
 
450
503
  Returns
451
504
  -------
452
505
  bool
506
+ ``True`` when successful, ``False`` when failed.
453
507
 
508
+ Examples
509
+ --------
510
+ >>> via_id = 123
511
+ >>> success = edb_padstacks.set_solderball(via_id, "SolderBall_Top", True, 150e-6)
454
512
  """
455
513
  if isinstance(padstackInst, int):
456
514
  psdef = self.definitions[self.instances[padstackInst].padstack_definition].edb_padstack
@@ -511,21 +569,24 @@ class Padstacks(object):
511
569
  )
512
570
 
513
571
  def get_pin_from_component_and_net(self, refdes=None, netname=None):
514
- """Retrieve pins given a component's reference designator and net name.
572
+ """Retrieve pins by component reference designator and net name.
515
573
 
516
574
  Parameters
517
575
  ----------
518
576
  refdes : str, optional
519
- Reference designator of the component. The default is ``None``.
520
- netname : str optional
521
- Name of the net. The default is ``None``.
577
+ Component reference designator.
578
+ netname : str, optional
579
+ Net name.
522
580
 
523
581
  Returns
524
582
  -------
525
- dict
526
- Dictionary of pins if the operation is successful.
527
- ``False`` is returned if the net does not belong to the component.
583
+ list[:class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
584
+ List of matching pin instances.
528
585
 
586
+ Examples
587
+ --------
588
+ >>> pins = edb_padstacks.get_pin_from_component_and_net(refdes="U1", netname="VCC")
589
+ >>> pins = edb_padstacks.get_pin_from_component_and_net(netname="GND") # All GND pins
529
590
  """
530
591
  pinlist = []
531
592
  if refdes:
@@ -565,6 +626,10 @@ class Padstacks(object):
565
626
  Dictionary of pins if the operation is successful.
566
627
  ``False`` is returned if the net does not belong to the component.
567
628
 
629
+ Examples
630
+ --------
631
+ >>> pins = edb_padstacks.get_pinlist_from_component_and_net(refdes="U1", netname="CLK") # Deprecated
632
+ >>> pins = edb_padstacks.get_pin_from_component_and_net(refdes="U1", netname="CLK") # New way
568
633
  """
569
634
  warnings.warn(
570
635
  "`get_pinlist_from_component_and_net` is deprecated use `get_pin_from_component_and_net` instead.",
@@ -573,21 +638,31 @@ class Padstacks(object):
573
638
  return self.get_pin_from_component_and_net(refdes=refdes, netname=netname)
574
639
 
575
640
  def get_pad_parameters(self, pin, layername, pad_type="regular_pad"):
576
- """Get Padstack Parameters from Pin or Padstack Definition.
641
+ """Get pad parameters for a pin on a specific layer.
577
642
 
578
643
  Parameters
579
644
  ----------
580
- pin : Edb.definition.PadstackDef or Edb.definition.PadstackInstance
581
- Pin or PadstackDef on which get values.
645
+ pin : :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`
646
+ Padstack instance.
582
647
  layername : str
583
- Layer on which get properties.
584
- pad_type : str
585
- Pad Type, `"pad"`, `"anti_pad"`, `"thermal_pad"`
648
+ Layer name.
649
+ pad_type : str, optional
650
+ Pad type ("regular_pad", "anti_pad", "thermal_pad"). Default is ``"regular_pad"``.
586
651
 
587
652
  Returns
588
653
  -------
589
654
  tuple
590
- Tuple of (GeometryType, ParameterList, OffsetX, OffsetY, Rot).
655
+ (geometry_type, parameters, offset_x, offset_y, rotation) where:
656
+ - geometry_type : str
657
+ - parameters : list[float] or list[list[float]]
658
+ - offset_x : float
659
+ - offset_y : float
660
+ - rotation : float
661
+
662
+ Examples
663
+ --------
664
+ >>> via = edb_padstacks.instances[123]
665
+ >>> geom_type, params, x, y, rot = edb_padstacks.get_pad_parameters(via, "TOP", "regular_pad")
591
666
  """
592
667
  if pad_type == "regular_pad":
593
668
  pad_type = GrpcPadType.REGULAR_PAD
@@ -620,17 +695,21 @@ class Padstacks(object):
620
695
  return 0, [0], 0, 0, 0
621
696
 
622
697
  def set_all_antipad_value(self, value):
623
- """Set all anti-pads from all pad-stack definition to the given value.
698
+ """Set anti-pad value for all padstack definitions.
624
699
 
625
700
  Parameters
626
701
  ----------
627
- value : float, str
628
- Anti-pad value.
702
+ value : float or str
703
+ Anti-pad value with units (e.g., "0.2mm").
629
704
 
630
705
  Returns
631
706
  -------
632
707
  bool
633
- ``True`` when successful, ``False`` if an anti-pad value fails to be assigned.
708
+ ``True`` when successful, ``False`` when failed.
709
+
710
+ Examples
711
+ --------
712
+ >>> success = edb_padstacks.set_all_antipad_value("0.3mm")
634
713
  """
635
714
  if self.definitions:
636
715
  all_succeed = True
@@ -671,21 +750,23 @@ class Padstacks(object):
671
750
  return all_succeed
672
751
 
673
752
  def check_and_fix_via_plating(self, minimum_value_to_replace=0.0, default_plating_ratio=0.2):
674
- """Check for minimum via plating ration value, values found below the minimum one are replaced by default
675
- plating ratio.
753
+ """Check and fix via plating ratios below a minimum value.
676
754
 
677
755
  Parameters
678
756
  ----------
679
- minimum_value_to_replace : float
680
- Plating ratio that is below or equal to this value is to be replaced
681
- with the value specified for the next parameter. Default value ``0.0``.
682
- default_plating_ratio : float
683
- Default value to use for plating ratio. The default value is ``0.2``.
757
+ minimum_value_to_replace : float, optional
758
+ Minimum plating ratio threshold. Default is ``0.0``.
759
+ default_plating_ratio : float, optional
760
+ Default plating ratio to apply. Default is ``0.2``.
684
761
 
685
762
  Returns
686
763
  -------
687
764
  bool
688
- ``True`` when successful, ``False`` if an anti-pad value fails to be assigned.
765
+ ``True`` when successful, ``False`` when failed.
766
+
767
+ Examples
768
+ --------
769
+ >>> success = edb_padstacks.check_and_fix_via_plating(minimum_value_to_replace=0.1)
689
770
  """
690
771
  for padstack_def in list(self.definitions.values()):
691
772
  if padstack_def.hole_plating_ratio <= minimum_value_to_replace:
@@ -696,18 +777,22 @@ class Padstacks(object):
696
777
  return True
697
778
 
698
779
  def get_via_instance_from_net(self, net_list=None):
699
- """Get the list for EDB vias from a net name list.
780
+ """Get via instances by net names.
700
781
 
701
782
  Parameters
702
783
  ----------
703
- net_list : str or list
704
- The list of the net name to be used for filtering vias. If no net is provided the command will
705
- return an all vias list.
784
+ net_list : str or list, optional
785
+ Net name(s) for filtering. Returns all vias if ``None``.
706
786
 
707
787
  Returns
708
788
  -------
709
- list of Edb.Cell.Primitive.PadstackInstance
710
- List of EDB vias.
789
+ list[:class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
790
+ List of via instances.
791
+
792
+ Examples
793
+ --------
794
+ >>> vias = edb_padstacks.get_via_instance_from_net("GND")
795
+ >>> vias = edb_padstacks.get_via_instance_from_net(["GND", "PWR"])
711
796
  """
712
797
  if net_list and not isinstance(net_list, list):
713
798
  net_list = [net_list]
@@ -750,61 +835,66 @@ class Padstacks(object):
750
835
  anti_pad_y_size="600um",
751
836
  hole_range="upper_pad_to_lower_pad",
752
837
  ):
753
- """Create a padstack.
838
+ """Create a padstack definition.
754
839
 
755
840
  Parameters
756
841
  ----------
757
842
  padstackname : str, optional
758
- Name of the padstack. The default is ``None``.
843
+ Name of the padstack definition.
759
844
  holediam : str, optional
760
- Diameter of the hole with units. The default is ``"300um"``.
845
+ Hole diameter with units. Default is ``"300um"``.
761
846
  paddiam : str, optional
762
- Diameter of the pad with units, used with ``"Circle"`` shape. The default is ``"400um"``.
847
+ Pad diameter with units. Default is ``"400um"``.
763
848
  antipaddiam : str, optional
764
- Diameter of the antipad with units. The default is ``"600um"``.
849
+ Anti-pad diameter with units. Default is ``"600um"``.
765
850
  pad_shape : str, optional
766
- Shape of the pad. The default is ``"Circle``. Options are ``"Circle"``, ``"Rectangle"`` and ``"Polygon"``.
851
+ Pad geometry type ("Circle", "Rectangle", "Polygon"). Default is ``"Circle"``.
767
852
  antipad_shape : str, optional
768
- Shape of the antipad. The default is ``"Circle"``. Options are ``"Circle"`` ``"Rectangle"`` and
769
- ``"Bullet"``.
853
+ Anti-pad geometry type ("Circle", "Rectangle", "Bullet", "Polygon"). Default is ``"Circle"``.
770
854
  x_size : str, optional
771
- Only applicable to bullet and rectangle shape. The default is ``"600um"``.
855
+ X-size for rectangular/bullet shapes. Default is ``"600um"``.
772
856
  y_size : str, optional
773
- Only applicable to bullet and rectangle shape. The default is ``"600um"``.
774
- corner_radius :
775
- Only applicable to bullet shape. The default is ``"300um"``.
857
+ Y-size for rectangular/bullet shapes. Default is ``"600um"``.
858
+ corner_radius : str, optional
859
+ Corner radius for bullet shapes. Default is ``"300um"``.
776
860
  offset_x : str, optional
777
- X offset of antipad. The default is ``"0.0"``.
861
+ X-offset for anti-pad. Default is ``"0.0"``.
778
862
  offset_y : str, optional
779
- Y offset of antipad. The default is ``"0.0"``.
863
+ Y-offset for anti-pad. Default is ``"0.0"``.
780
864
  rotation : str, optional
781
- rotation of antipad. The default is ``"0.0"``.
865
+ Rotation for anti-pad in degrees. Default is ``"0.0"``.
782
866
  has_hole : bool, optional
783
- Whether this padstack has a hole.
867
+ Whether the padstack has a hole. Default is ``True``.
784
868
  pad_offset_x : str, optional
785
- Padstack offset in X direction.
869
+ X-offset for pad. Default is ``"0.0"``.
786
870
  pad_offset_y : str, optional
787
- Padstack offset in Y direction.
871
+ Y-offset for pad. Default is ``"0.0"``.
788
872
  pad_rotation : str, optional
789
- Padstack rotation.
873
+ Rotation for pad in degrees. Default is ``"0.0"``.
874
+ pad_polygon : list or :class:`ansys.edb.core.geometry.PolygonData`, optional
875
+ Polygon points for custom pad shape.
876
+ antipad_polygon : list or :class:`ansys.edb.core.geometry.PolygonData`, optional
877
+ Polygon points for custom anti-pad shape.
878
+ polygon_hole : list or :class:`ansys.edb.core.geometry.PolygonData`, optional
879
+ Polygon points for custom hole shape.
790
880
  start_layer : str, optional
791
- Start layer of the padstack definition.
881
+ Starting layer name.
792
882
  stop_layer : str, optional
793
- Stop layer of the padstack definition.
883
+ Ending layer name.
794
884
  add_default_layer : bool, optional
795
- Add ``"Default"`` to padstack definition. Default is ``False``.
885
+ Whether to add "Default" layer. Default is ``False``.
796
886
  anti_pad_x_size : str, optional
797
- Only applicable to bullet and rectangle shape. The default is ``"600um"``.
887
+ Anti-pad X-size. Default is ``"600um"``.
798
888
  anti_pad_y_size : str, optional
799
- Only applicable to bullet and rectangle shape. The default is ``"600um"``.
889
+ Anti-pad Y-size. Default is ``"600um"``.
800
890
  hole_range : str, optional
801
- Define the padstack hole range. Arguments supported, ``"through"``, ``"begin_on_upper_pad"``,
802
- ``"end_on_lower_pad"``, ``"upper_pad_to_lower_pad"``.
891
+ Hole range type ("through", "begin_on_upper_pad", "end_on_lower_pad", "upper_pad_to_lower_pad").
892
+ Default is ``"upper_pad_to_lower_pad"``.
803
893
 
804
894
  Returns
805
895
  -------
806
896
  str
807
- Name of the padstack if the operation is successful.
897
+ Name of the created padstack definition.
808
898
  """
809
899
  holediam = GrpcValue(holediam)
810
900
  paddiam = GrpcValue(paddiam)
@@ -949,19 +1039,19 @@ class Padstacks(object):
949
1039
  return False
950
1040
 
951
1041
  def duplicate(self, target_padstack_name, new_padstack_name=""):
952
- """Duplicate a padstack.
1042
+ """Duplicate a padstack definition.
953
1043
 
954
1044
  Parameters
955
1045
  ----------
956
1046
  target_padstack_name : str
957
- Name of the padstack to be duplicated.
1047
+ Name of the padstack definition to duplicate.
958
1048
  new_padstack_name : str, optional
959
- Name of the new padstack.
1049
+ Name for the new padstack definition.
960
1050
 
961
1051
  Returns
962
1052
  -------
963
1053
  str
964
- Name of the new padstack.
1054
+ Name of the new padstack definition.
965
1055
  """
966
1056
  new_padstack_definition_data = GrpcPadstackDefData(self.definitions[target_padstack_name].data.msg)
967
1057
  if not new_padstack_name:
@@ -982,33 +1072,33 @@ class Padstacks(object):
982
1072
  solderlayer=None,
983
1073
  is_pin=False,
984
1074
  ):
985
- """Place a via.
1075
+ """Place a padstack instance.
986
1076
 
987
1077
  Parameters
988
1078
  ----------
989
- position : list
990
- List of float values for the [x,y] positions where the via is to be placed.
1079
+ position : list[float, float]
1080
+ [x, y] position for placement.
991
1081
  definition_name : str
992
- Name of the padstack definition.
1082
+ Padstack definition name.
993
1083
  net_name : str, optional
994
- Name of the net. The default is ``""``.
1084
+ Net name. Default is ``""``.
995
1085
  via_name : str, optional
996
- The default is ``""``.
1086
+ Instance name. Default is ``""``.
997
1087
  rotation : float, optional
998
- Rotation of the padstack in degrees. The default
999
- is ``0``.
1000
- fromlayer :
1001
- The default is ``None``.
1002
- tolayer :
1003
- The default is ``None``.
1004
- solderlayer :
1005
- The default is ``None``.
1088
+ Rotation in degrees. Default is ``0.0``.
1089
+ fromlayer : str, optional
1090
+ Starting layer name.
1091
+ tolayer : str, optional
1092
+ Ending layer name.
1093
+ solderlayer : str, optional
1094
+ Solder ball layer name.
1006
1095
  is_pin : bool, optional
1007
- Whether if the padstack is a pin or not. Default is `False`.
1096
+ Whether the instance is a pin. Default is ``False``.
1008
1097
 
1009
1098
  Returns
1010
1099
  -------
1011
- :class:`dotnet.database.edb_data.padstacks_data.EDBPadstackInstance`
1100
+ :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance` or bool
1101
+ Created padstack instance or ``False`` if failed.
1012
1102
  """
1013
1103
  padstack_def = None
1014
1104
  for pad in list(self.definitions.keys()):
@@ -1060,19 +1150,19 @@ class Padstacks(object):
1060
1150
  return False
1061
1151
 
1062
1152
  def remove_pads_from_padstack(self, padstack_name, layer_name=None):
1063
- """Remove the Pad from a padstack on a specific layer by setting it as a 0 thickness circle.
1153
+ """Remove pads from a padstack definition on specified layers.
1064
1154
 
1065
1155
  Parameters
1066
1156
  ----------
1067
1157
  padstack_name : str
1068
- padstack name
1069
- layer_name : str, optional
1070
- Layer name on which remove the PadParameters. If None, all layers will be taken.
1158
+ Padstack definition name.
1159
+ layer_name : str or list, optional
1160
+ Layer name(s). Applies to all layers if ``None``.
1071
1161
 
1072
1162
  Returns
1073
1163
  -------
1074
1164
  bool
1075
- ``True`` if successful.
1165
+ ``True`` when successful, ``False`` when failed.
1076
1166
  """
1077
1167
  pad_type = GrpcPadType.REGULAR_PAD
1078
1168
  pad_geo = GrpcPadGeometryType.PADGEOMTYPE_CIRCLE
@@ -1111,40 +1201,39 @@ class Padstacks(object):
1111
1201
  antipad_y_offset=0,
1112
1202
  antipad_rotation=0,
1113
1203
  ):
1114
- """Set pad and antipad properties of the padstack.
1204
+ """Set pad and anti-pad properties for a padstack definition.
1115
1205
 
1116
1206
  Parameters
1117
1207
  ----------
1118
1208
  padstack_name : str
1119
- Name of the padstack.
1120
- layer_name : str, optional
1121
- Name of the layer. If None, all layers will be taken.
1209
+ Padstack definition name.
1210
+ layer_name : str or list, optional
1211
+ Layer name(s). Applies to all layers if ``None``.
1122
1212
  pad_shape : str, optional
1123
- Shape of the pad. The default is ``"Circle"``. Options are ``"Circle"``, ``"Square"``, ``"Rectangle"``,
1124
- ``"Oval"`` and ``"Bullet"``.
1125
- pad_params : str, optional
1126
- Dimension of the pad. The default is ``"0"``.
1127
- pad_x_offset : str, optional
1128
- X offset of the pad. The default is ``"0"``.
1129
- pad_y_offset : str, optional
1130
- Y offset of the pad. The default is ``"0"``.
1131
- pad_rotation : str, optional
1132
- Rotation of the pad. The default is ``"0"``.
1213
+ Pad geometry type ("Circle", "Square", "Rectangle", "Oval", "Bullet"). Default is ``"Circle"``.
1214
+ pad_params : float or list, optional
1215
+ Pad dimension(s). Default is ``0``.
1216
+ pad_x_offset : float, optional
1217
+ Pad X-offset. Default is ``0``.
1218
+ pad_y_offset : float, optional
1219
+ Pad Y-offset. Default is ``0``.
1220
+ pad_rotation : float, optional
1221
+ Pad rotation in degrees. Default is ``0``.
1133
1222
  antipad_shape : str, optional
1134
- Shape of the antipad. The default is ``"0"``.
1135
- antipad_params : str, optional
1136
- Dimension of the antipad. The default is ``"0"``.
1137
- antipad_x_offset : str, optional
1138
- X offset of the antipad. The default is ``"0"``.
1139
- antipad_y_offset : str, optional
1140
- Y offset of the antipad. The default is ``"0"``.
1141
- antipad_rotation : str, optional
1142
- Rotation of the antipad. The default is ``"0"``.
1223
+ Anti-pad geometry type ("Circle", "Square", "Rectangle", "Oval", "Bullet"). Default is ``"Circle"``.
1224
+ antipad_params : float or list, optional
1225
+ Anti-pad dimension(s). Default is ``0``.
1226
+ antipad_x_offset : float, optional
1227
+ Anti-pad X-offset. Default is ``0``.
1228
+ antipad_y_offset : float, optional
1229
+ Anti-pad Y-offset. Default is ``0``.
1230
+ antipad_rotation : float, optional
1231
+ Anti-pad rotation in degrees. Default is ``0``.
1143
1232
 
1144
1233
  Returns
1145
1234
  -------
1146
1235
  bool
1147
- ``True`` if successful.
1236
+ ``True`` when successful, ``False`` when failed.
1148
1237
  """
1149
1238
  shape_dict = {
1150
1239
  "Circle": GrpcPadGeometryType.PADGEOMTYPE_CIRCLE,
@@ -1204,26 +1293,28 @@ class Padstacks(object):
1204
1293
  component_reference_designator=None,
1205
1294
  component_pin=None,
1206
1295
  ):
1207
- """Get padstack instances by conditions.
1296
+ """Get padstack instances by search criteria.
1208
1297
 
1209
1298
  Parameters
1210
1299
  ----------
1211
1300
  name : str, optional
1212
- Name of the padstack.
1301
+ Instance name.
1213
1302
  pid : int, optional
1214
- Id of the padstack.
1215
- definition_name : str, list, optional
1216
- Name of the padstack definition.
1217
- net_name : str, optional
1218
- The net name to be used for filtering padstack instances.
1219
- component_pin: str, optional
1220
- Pin Number of the component.
1303
+ Database ID.
1304
+ definition_name : str or list, optional
1305
+ Padstack definition name(s).
1306
+ net_name : str or list, optional
1307
+ Net name(s).
1308
+ component_reference_designator : str or list, optional
1309
+ Component reference designator(s).
1310
+ component_pin : str or list, optional
1311
+ Component pin number(s).
1312
+
1221
1313
  Returns
1222
1314
  -------
1223
- list
1224
- List of :class:`dotnet.database.edb_data.padstacks_data.EDBPadstackInstance`.
1315
+ list[:class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
1316
+ List of matching padstack instances.
1225
1317
  """
1226
-
1227
1318
  instances_by_id = self.instances
1228
1319
  if pid:
1229
1320
  return instances_by_id[pid]
@@ -1255,35 +1346,25 @@ class Padstacks(object):
1255
1346
  def get_reference_pins(
1256
1347
  self, positive_pin, reference_net="gnd", search_radius=5e-3, max_limit=0, component_only=True
1257
1348
  ):
1258
- """Search for reference pins using given criteria.
1349
+ """Find reference pins near a specified pin.
1259
1350
 
1260
1351
  Parameters
1261
1352
  ----------
1262
- positive_pin : EDBPadstackInstance
1263
- Pin used for evaluating the distance on the reference pins found.
1353
+ positive_pin : :class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`
1354
+ Target pin.
1264
1355
  reference_net : str, optional
1265
- Reference net. The default is ``"gnd"``.
1356
+ Reference net name. Default is ``"gnd"``.
1266
1357
  search_radius : float, optional
1267
- Search radius for finding padstack instances. The default is ``5e-3``.
1358
+ Search radius in meters. Default is ``5e-3`` (5 mm).
1268
1359
  max_limit : int, optional
1269
- Maximum limit for the padstack instances found. The default is ``0``, in which
1270
- case no limit is applied. The maximum limit value occurs on the nearest
1271
- reference pins from the positive one that is found.
1360
+ Maximum number of pins to return. Default is ``0`` (no limit).
1272
1361
  component_only : bool, optional
1273
- Whether to limit the search to component padstack instances only. The
1274
- default is ``True``. When ``False``, the search is extended to the entire layout.
1362
+ Whether to search only in component pins. Default is ``True``.
1275
1363
 
1276
1364
  Returns
1277
1365
  -------
1278
- list
1279
- List of :class:`dotnet.database.edb_data.padstacks_data.EDBPadstackInstance`.
1280
-
1281
- Examples
1282
- --------
1283
- >>> edbapp = Edb("target_path")
1284
- >>> pin = edbapp.components.instances["J5"].pins["19"]
1285
- >>> reference_pins = edbapp.padstacks.get_reference_pins(positive_pin=pin, reference_net="GND",
1286
- >>> search_radius=5e-3, max_limit=0, component_only=True)
1366
+ list[:class:`pyedb.grpc.database.primitive.padstack_instance.PadstackInstance`]
1367
+ List of reference pins.
1287
1368
  """
1288
1369
  pinlist = []
1289
1370
  if not positive_pin: