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
@@ -44,7 +44,7 @@ class ComponentDef(GrpcComponentDef):
44
44
  self._pedb = pedb
45
45
 
46
46
  @property
47
- def part_name(self):
47
+ def part_name(self) -> str:
48
48
  """Component definition name.
49
49
 
50
50
  Returns
@@ -60,7 +60,7 @@ class ComponentDef(GrpcComponentDef):
60
60
  self.name = name
61
61
 
62
62
  @property
63
- def type(self):
63
+ def type(self) -> str:
64
64
  """Component definition type.
65
65
 
66
66
  Returns
@@ -97,28 +97,28 @@ class ComponentDef(GrpcComponentDef):
97
97
  return
98
98
 
99
99
  @property
100
- def components(self):
100
+ def components(self) -> dict[str, Component]:
101
101
  """Component instances belonging to the definition.
102
102
 
103
103
  Returns
104
104
  -------
105
- Dict : [str, :class:`Component <pyedb.grpc.database.hierarchy.component.Component>`]
105
+ dict[str, :class:`Component <pyedb.grpc.database.hierarchy.component.Component>`]
106
106
  """
107
107
  comp_list = [Component(self._pedb, l) for l in Component.find_by_def(self._pedb.active_layout, self.part_name)]
108
108
  return {comp.refdes: comp for comp in comp_list}
109
109
 
110
110
  @property
111
- def component_pins(self):
111
+ def component_pins(self) -> list[ComponentPin]:
112
112
  """Component pins.
113
113
 
114
114
  Returns
115
115
  -------
116
- List[:class:`ComponentPin <pyedb.grpc.database.definition.component_pin.ComponentPin>`]
116
+ list[:class:`ComponentPin <pyedb.grpc.database.definition.component_pin.ComponentPin>`]
117
117
 
118
118
  """
119
119
  return [ComponentPin(self._pedb, pin) for pin in super().component_pins]
120
120
 
121
- def assign_rlc_model(self, res=None, ind=None, cap=None, is_parallel=False):
121
+ def assign_rlc_model(self, res=None, ind=None, cap=None, is_parallel=False) -> bool:
122
122
  """Assign RLC to all components under this part name.
123
123
 
124
124
  Parameters
@@ -142,16 +142,19 @@ class ComponentDef(GrpcComponentDef):
142
142
  comp.assign_rlc_model(res, ind, cap, is_parallel)
143
143
  return True
144
144
 
145
- def assign_s_param_model(self, file_path, model_name=None, reference_net=None):
145
+ def assign_s_param_model(self, file_path, model_name=None, reference_net=None) -> bool:
146
146
  """Assign S-parameter to all components under this part name.
147
147
 
148
148
  Parameters
149
149
  ----------
150
150
  file_path : str
151
151
  File path of the S-parameter model.
152
- name : str, optional
152
+ model_name : str, optional
153
153
  Name of the S-parameter model.
154
154
 
155
+ reference_net : str, optional
156
+ Name of the reference net.
157
+
155
158
  Returns
156
159
  -------
157
160
  bool
@@ -161,31 +164,31 @@ class ComponentDef(GrpcComponentDef):
161
164
  comp.assign_s_param_model(file_path, model_name, reference_net)
162
165
  return True
163
166
 
164
- def assign_spice_model(self, file_path, model_name=None):
167
+ def assign_spice_model(self, file_path, model_name=None) -> bool:
165
168
  """Assign Spice model to all components under this part name.
166
169
 
167
170
  Parameters
168
171
  ----------
169
172
  file_path : str
170
173
  File path of the Spice model.
171
- name : str, optional
174
+ model_name : str, optional
172
175
  Name of the Spice model.
173
176
 
174
177
  Returns
175
178
  -------
176
-
179
+ bool
177
180
  """
178
181
  for comp in list(self.components.values()):
179
182
  comp.assign_spice_model(file_path, model_name)
180
183
  return True
181
184
 
182
185
  @property
183
- def reference_file(self):
186
+ def reference_file(self) -> list[str]:
184
187
  """Model reference file.
185
188
 
186
189
  Returns
187
190
  -------
188
- List[str]
191
+ list[str]
189
192
  List of reference files.
190
193
 
191
194
  """
@@ -128,7 +128,7 @@ class Material(GrpcMaterialDef):
128
128
  self.__dielectric_model = None
129
129
 
130
130
  @property
131
- def name(self):
131
+ def name(self) -> str:
132
132
  """Material name.
133
133
 
134
134
  Returns
@@ -172,7 +172,7 @@ class Material(GrpcMaterialDef):
172
172
  return 0.0
173
173
 
174
174
  @property
175
- def conductivity(self):
175
+ def conductivity(self) -> float:
176
176
  """Get material conductivity.
177
177
 
178
178
  Returns
@@ -238,7 +238,7 @@ class Material(GrpcMaterialDef):
238
238
  self.dielectric_material_model.dc_relative_permitivity = float(value)
239
239
 
240
240
  @property
241
- def loss_tangent_at_frequency(self):
241
+ def loss_tangent_at_frequency(self) -> float:
242
242
  """Material loss tangent at frequency if dielectric model is defined.
243
243
 
244
244
  Returns
@@ -258,7 +258,7 @@ class Material(GrpcMaterialDef):
258
258
  self.dielectric_material_model.loss_tangent_at_frequency = float(value)
259
259
 
260
260
  @property
261
- def dielectric_model_frequency(self):
261
+ def dielectric_model_frequency(self) -> float:
262
262
  """Dielectric model frequency if model is defined.
263
263
 
264
264
  Returns
@@ -278,7 +278,7 @@ class Material(GrpcMaterialDef):
278
278
  self.dielectric_material_model.frequency = float(value)
279
279
 
280
280
  @property
281
- def permittivity_at_frequency(self):
281
+ def permittivity_at_frequency(self) -> float:
282
282
  """Material permittivity at frequency if model is defined.
283
283
 
284
284
 
@@ -299,7 +299,7 @@ class Material(GrpcMaterialDef):
299
299
  self.dielectric_material_model.relative_permitivity_at_frequency = float(value)
300
300
 
301
301
  @property
302
- def permittivity(self):
302
+ def permittivity(self) -> float:
303
303
  """Material permittivity.
304
304
 
305
305
 
@@ -321,7 +321,7 @@ class Material(GrpcMaterialDef):
321
321
  self.set_property(GrpcMaterialProperty.PERMITTIVITY, GrpcValue(value))
322
322
 
323
323
  @property
324
- def permeability(self):
324
+ def permeability(self) -> float:
325
325
  """Material permeability.
326
326
 
327
327
  Returns
@@ -359,7 +359,7 @@ class Material(GrpcMaterialDef):
359
359
  return self.dielectric_loss_tangent
360
360
 
361
361
  @property
362
- def dielectric_loss_tangent(self):
362
+ def dielectric_loss_tangent(self) -> float:
363
363
  """Material loss tangent.
364
364
 
365
365
  Returns
@@ -389,7 +389,7 @@ class Material(GrpcMaterialDef):
389
389
  self.set_property(GrpcMaterialProperty.DIELECTRIC_LOSS_TANGENT, GrpcValue(value))
390
390
 
391
391
  @property
392
- def magnetic_loss_tangent(self):
392
+ def magnetic_loss_tangent(self) -> float:
393
393
  """Material magnetic loss tangent.
394
394
 
395
395
  Returns
@@ -409,7 +409,7 @@ class Material(GrpcMaterialDef):
409
409
  self.set_property(GrpcMaterialProperty.MAGNETIC_LOSS_TANGENT, GrpcValue(value))
410
410
 
411
411
  @property
412
- def thermal_conductivity(self):
412
+ def thermal_conductivity(self) -> float:
413
413
  """Material thermal conductivity.
414
414
 
415
415
  Returns
@@ -430,7 +430,7 @@ class Material(GrpcMaterialDef):
430
430
  self.set_property(GrpcMaterialProperty.THERMAL_CONDUCTIVITY, GrpcValue(value))
431
431
 
432
432
  @property
433
- def mass_density(self):
433
+ def mass_density(self) -> float:
434
434
  """Material mass density.
435
435
 
436
436
  Returns
@@ -451,7 +451,7 @@ class Material(GrpcMaterialDef):
451
451
  self.set_property(GrpcMaterialProperty.MASS_DENSITY, GrpcValue(value))
452
452
 
453
453
  @property
454
- def youngs_modulus(self):
454
+ def youngs_modulus(self) -> float:
455
455
  """Material young modulus.
456
456
 
457
457
  Returns
@@ -472,7 +472,7 @@ class Material(GrpcMaterialDef):
472
472
  self.set_property(GrpcMaterialProperty.YOUNGS_MODULUS, GrpcValue(value))
473
473
 
474
474
  @property
475
- def specific_heat(self):
475
+ def specific_heat(self) -> float:
476
476
  """Material specific heat.
477
477
 
478
478
  Returns
@@ -491,7 +491,7 @@ class Material(GrpcMaterialDef):
491
491
  self.set_property(GrpcMaterialProperty.SPECIFIC_HEAT, GrpcValue(value))
492
492
 
493
493
  @property
494
- def poisson_ratio(self):
494
+ def poisson_ratio(self) -> float:
495
495
  """Material poisson ratio.
496
496
 
497
497
  Returns
@@ -510,7 +510,7 @@ class Material(GrpcMaterialDef):
510
510
  self.set_property(GrpcMaterialProperty.POISSONS_RATIO, GrpcValue(value))
511
511
 
512
512
  @property
513
- def thermal_expansion_coefficient(self):
513
+ def thermal_expansion_coefficient(self) -> float:
514
514
  """Material thermal coefficient.
515
515
 
516
516
  Returns
@@ -639,7 +639,7 @@ class Materials(object):
639
639
  return self.__syslib
640
640
 
641
641
  @property
642
- def materials(self):
642
+ def materials(self) -> dict[str, Material]:
643
643
  """Get materials.
644
644
 
645
645
  Returns
@@ -652,7 +652,7 @@ class Materials(object):
652
652
  }
653
653
  return materials
654
654
 
655
- def add_material(self, name: str, **kwargs):
655
+ def add_material(self, name: str, **kwargs) -> Material:
656
656
  """Add a new material.
657
657
 
658
658
  Parameters
@@ -690,7 +690,7 @@ class Materials(object):
690
690
 
691
691
  return material
692
692
 
693
- def add_conductor_material(self, name, conductivity, **kwargs):
693
+ def add_conductor_material(self, name, conductivity, **kwargs) -> Material:
694
694
  """Add a new conductor material.
695
695
 
696
696
  Parameters
@@ -712,7 +712,7 @@ class Materials(object):
712
712
 
713
713
  return material
714
714
 
715
- def add_dielectric_material(self, name, permittivity, dielectric_loss_tangent, **kwargs):
715
+ def add_dielectric_material(self, name, permittivity, dielectric_loss_tangent, **kwargs) -> Material:
716
716
  """Add a new dielectric material in library.
717
717
 
718
718
  Parameters
@@ -745,7 +745,7 @@ class Materials(object):
745
745
  dc_conductivity=None,
746
746
  dc_permittivity=None,
747
747
  **kwargs,
748
- ):
748
+ ) -> Material:
749
749
  """Add a dielectric using the Djordjevic-Sarkar model.
750
750
 
751
751
  Parameters
@@ -804,7 +804,7 @@ class Materials(object):
804
804
  lower_freqency,
805
805
  higher_frequency,
806
806
  **kwargs,
807
- ):
807
+ ) -> Material:
808
808
  """Add a dielectric with the Debye model.
809
809
 
810
810
  Parameters
@@ -864,7 +864,7 @@ class Materials(object):
864
864
  permittivities,
865
865
  loss_tangents,
866
866
  **kwargs,
867
- ):
867
+ ) -> Material:
868
868
  """Add a dielectric with the Multipole Debye model.
869
869
 
870
870
  Parameters
@@ -938,7 +938,7 @@ class Materials(object):
938
938
  material = Material(self.__edb, material_def)
939
939
  return material
940
940
 
941
- def duplicate(self, material_name, new_material_name):
941
+ def duplicate(self, material_name, new_material_name) -> Material:
942
942
  """Duplicate a material from the database.
943
943
 
944
944
  Parameters
@@ -983,7 +983,7 @@ class Materials(object):
983
983
  )
984
984
  self.delete(material_name)
985
985
 
986
- def delete(self, material_name):
986
+ def delete(self, material_name) -> bool:
987
987
  """Remove a material from the database.
988
988
 
989
989
  Returns
@@ -1077,7 +1077,7 @@ class Materials(object):
1077
1077
  else:
1078
1078
  return property_name_to_id["InvalidProperty"]
1079
1079
 
1080
- def load_amat(self, amat_file):
1080
+ def load_amat(self, amat_file) -> bool:
1081
1081
  """Load materials from an AMAT file.
1082
1082
 
1083
1083
  Parameters
@@ -1184,7 +1184,7 @@ class Materials(object):
1184
1184
  material_description["name"] = match.group(1)
1185
1185
  in_material_def = True
1186
1186
 
1187
- def read_materials(self, amat_file):
1187
+ def read_materials(self, amat_file) -> dict[str, Material]:
1188
1188
  """Read materials from an AMAT file.
1189
1189
 
1190
1190
  Parameters
@@ -1207,7 +1207,7 @@ class Materials(object):
1207
1207
 
1208
1208
  return res
1209
1209
 
1210
- def read_syslib_material(self, material_name):
1210
+ def read_syslib_material(self, material_name) -> dict[str, Material]:
1211
1211
  """Read a specific material from syslib AMAT file.
1212
1212
 
1213
1213
  Parameters
@@ -92,7 +92,7 @@ class PackageDef(GrpcPackageDef):
92
92
  return edb_object
93
93
 
94
94
  @property
95
- def exterior_boundary(self):
95
+ def exterior_boundary(self) -> GrpcPolygonData:
96
96
  """Get the exterior boundary of a package definition.
97
97
 
98
98
  Returns
@@ -107,7 +107,7 @@ class PackageDef(GrpcPackageDef):
107
107
  super(PackageDef, self.__class__).exterior_boundary.__set__(self, value)
108
108
 
109
109
  @property
110
- def maximum_power(self):
110
+ def maximum_power(self) -> float:
111
111
  """Maximum power of the package.
112
112
 
113
113
  Returns
@@ -122,7 +122,7 @@ class PackageDef(GrpcPackageDef):
122
122
  super(PackageDef, self.__class__).maximum_power.__set__(self, GrpcValue(value))
123
123
 
124
124
  @property
125
- def therm_cond(self):
125
+ def therm_cond(self) -> float:
126
126
  """Thermal conductivity of the package.
127
127
 
128
128
  Returns
@@ -138,7 +138,7 @@ class PackageDef(GrpcPackageDef):
138
138
  super(PackageDef, self.__class__).thermal_conductivity.__set__(self, GrpcValue(value))
139
139
 
140
140
  @property
141
- def theta_jb(self):
141
+ def theta_jb(self) -> float:
142
142
  """Theta Junction-to-Board of the package.
143
143
 
144
144
  Returns
@@ -153,7 +153,7 @@ class PackageDef(GrpcPackageDef):
153
153
  super(PackageDef, self.__class__).theta_jb.__set__(self, GrpcValue(value))
154
154
 
155
155
  @property
156
- def theta_jc(self):
156
+ def theta_jc(self) -> float:
157
157
  """Theta Junction-to-Case of the package.
158
158
 
159
159
  Returns
@@ -168,7 +168,7 @@ class PackageDef(GrpcPackageDef):
168
168
  super(PackageDef, self.__class__).theta_jc.__set__(self, GrpcValue(value))
169
169
 
170
170
  @property
171
- def height(self):
171
+ def height(self) -> float:
172
172
  """Height of the package.
173
173
 
174
174
  Returns
@@ -183,7 +183,7 @@ class PackageDef(GrpcPackageDef):
183
183
  super(PackageDef, self.__class__).height.__set__(self, GrpcValue(value))
184
184
 
185
185
  @property
186
- def heat_sink(self):
186
+ def heat_sink(self) -> HeatSink:
187
187
  """Package heat sink.
188
188
 
189
189
  Returns
@@ -206,7 +206,7 @@ class PackageDef(GrpcPackageDef):
206
206
  """
207
207
  return self.heat_sink
208
208
 
209
- def set_heatsink(self, fin_base_height, fin_height, fin_orientation, fin_spacing, fin_thickness):
209
+ def set_heatsink(self, fin_base_height, fin_height, fin_orientation, fin_spacing, fin_thickness) -> HeatSink:
210
210
  """Set Heat sink.
211
211
  Parameters
212
212
  ----------
@@ -84,7 +84,7 @@ class PadProperties:
84
84
  return p_val
85
85
 
86
86
  @property
87
- def geometry_type(self):
87
+ def geometry_type(self) -> float:
88
88
  """Geometry type.
89
89
 
90
90
  Returns
@@ -99,7 +99,7 @@ class PadProperties:
99
99
  return self._pad_parameter_value[0]
100
100
 
101
101
  @property
102
- def shape(self):
102
+ def shape(self) -> str:
103
103
  """Pad shape.
104
104
 
105
105
  Returns
@@ -123,6 +123,12 @@ class PadProperties:
123
123
  except TypeError:
124
124
  return []
125
125
 
126
+ @parameters_values.setter
127
+ def parameters_values(self, value):
128
+ if isinstance(value, (float, str)):
129
+ value = [value]
130
+ self._update_pad_parameters_parameters(params=value)
131
+
126
132
  @property
127
133
  def parameters_values_string(self):
128
134
  """Parameters value in string format."""
@@ -132,7 +138,7 @@ class PadProperties:
132
138
  return []
133
139
 
134
140
  @property
135
- def polygon_data(self):
141
+ def polygon_data(self) -> GrpcPolygonData:
136
142
  """Parameters.
137
143
 
138
144
  Returns
@@ -144,7 +150,7 @@ class PadProperties:
144
150
  return p if isinstance(p, ansys.edb.core.geometry.polygon_data.PolygonData) else None
145
151
 
146
152
  @property
147
- def offset_x(self):
153
+ def offset_x(self) -> float:
148
154
  """Offset for the X axis.
149
155
 
150
156
  Returns
@@ -155,7 +161,7 @@ class PadProperties:
155
161
  return self._pad_parameter_value[2].value
156
162
 
157
163
  @property
158
- def offset_y(self):
164
+ def offset_y(self) -> float:
159
165
  """Offset for the Y axis.
160
166
 
161
167
  Returns
@@ -175,7 +181,7 @@ class PadProperties:
175
181
  self._update_pad_parameters_parameters(offsety=value)
176
182
 
177
183
  @property
178
- def rotation(self):
184
+ def rotation(self) -> float:
179
185
  """Rotation.
180
186
 
181
187
  Returns
@@ -190,16 +196,6 @@ class PadProperties:
190
196
  def rotation(self, value):
191
197
  self._update_pad_parameters_parameters(rotation=value)
192
198
 
193
- @rotation.setter
194
- def rotation(self, value):
195
- self._update_pad_parameters_parameters(rotation=value)
196
-
197
- @parameters_values.setter
198
- def parameters_values(self, value):
199
- if isinstance(value, (float, str)):
200
- value = [value]
201
- self._update_pad_parameters_parameters(params=value)
202
-
203
199
  def _update_pad_parameters_parameters(
204
200
  self,
205
201
  layer_name=None,
@@ -272,7 +268,7 @@ class PadstackDef(GrpcPadstackDef):
272
268
  self._bounding_box = []
273
269
 
274
270
  @property
275
- def instances(self):
271
+ def instances(self) -> list[any]:
276
272
  """Definitions Instances.
277
273
 
278
274
  Returns
@@ -283,7 +279,7 @@ class PadstackDef(GrpcPadstackDef):
283
279
  return [i for i in list(self._pedb.padstacks.instances.values()) if i.padstack_def.name == self.name]
284
280
 
285
281
  @property
286
- def layers(self):
282
+ def layers(self) -> list[str]:
287
283
  """Layers.
288
284
 
289
285
  Returns
@@ -316,7 +312,7 @@ class PadstackDef(GrpcPadstackDef):
316
312
  return self.layers[-1]
317
313
 
318
314
  @property
319
- def hole_diameter(self):
315
+ def hole_diameter(self) -> float:
320
316
  """Hole diameter.
321
317
 
322
318
  Returns
@@ -354,7 +350,7 @@ class PadstackDef(GrpcPadstackDef):
354
350
  )
355
351
 
356
352
  @property
357
- def hole_type(self):
353
+ def hole_type(self) -> float:
358
354
  """Holy type.
359
355
 
360
356
  Returns
@@ -378,7 +374,7 @@ class PadstackDef(GrpcPadstackDef):
378
374
  return self.data.get_hole_parameters()[0]
379
375
 
380
376
  @property
381
- def hole_offset_x(self):
377
+ def hole_offset_x(self) -> float:
382
378
  """Hole offset for the X axis.
383
379
 
384
380
  Returns
@@ -404,7 +400,7 @@ class PadstackDef(GrpcPadstackDef):
404
400
  )
405
401
 
406
402
  @property
407
- def hole_offset_y(self):
403
+ def hole_offset_y(self) -> float:
408
404
  """Hole offset for the Y axis.
409
405
 
410
406
  Returns
@@ -430,7 +426,7 @@ class PadstackDef(GrpcPadstackDef):
430
426
  )
431
427
 
432
428
  @property
433
- def hole_rotation(self):
429
+ def hole_rotation(self) -> float:
434
430
  """Hole rotation.
435
431
 
436
432
  Returns
@@ -456,7 +452,7 @@ class PadstackDef(GrpcPadstackDef):
456
452
  )
457
453
 
458
454
  @property
459
- def pad_by_layer(self):
455
+ def pad_by_layer(self) -> dict[str, PadProperties]:
460
456
  """Pad by layer.
461
457
 
462
458
  Returns
@@ -473,7 +469,7 @@ class PadstackDef(GrpcPadstackDef):
473
469
  return self._pad_by_layer
474
470
 
475
471
  @property
476
- def antipad_by_layer(self):
472
+ def antipad_by_layer(self) -> dict[str, PadProperties]:
477
473
  """Antipad by layer.
478
474
 
479
475
  Returns
@@ -490,7 +486,7 @@ class PadstackDef(GrpcPadstackDef):
490
486
  return self._antipad_by_layer
491
487
 
492
488
  @property
493
- def thermalpad_by_layer(self):
489
+ def thermalpad_by_layer(self) -> dict[str, PadProperties]:
494
490
  """Thermal by layer.
495
491
 
496
492
  Returns
@@ -507,7 +503,7 @@ class PadstackDef(GrpcPadstackDef):
507
503
  return self._thermalpad_by_layer
508
504
 
509
505
  @property
510
- def hole_plating_ratio(self):
506
+ def hole_plating_ratio(self) -> float:
511
507
  """Hole plating ratio.
512
508
 
513
509
  Returns
@@ -522,7 +518,7 @@ class PadstackDef(GrpcPadstackDef):
522
518
  self.data.plating_percentage = GrpcValue(ratio)
523
519
 
524
520
  @property
525
- def hole_plating_thickness(self):
521
+ def hole_plating_thickness(self) -> float:
526
522
  """Hole plating thickness.
527
523
 
528
524
  Returns
@@ -551,7 +547,7 @@ class PadstackDef(GrpcPadstackDef):
551
547
  self.hole_plating_ratio = hr
552
548
 
553
549
  @property
554
- def hole_finished_size(self):
550
+ def hole_finished_size(self) -> float:
555
551
  """Finished hole size.
556
552
 
557
553
  Returns
@@ -568,7 +564,7 @@ class PadstackDef(GrpcPadstackDef):
568
564
  return 0.0
569
565
 
570
566
  @property
571
- def hole_range(self):
567
+ def hole_range(self) -> str:
572
568
  """Get hole range value from padstack definition.
573
569
 
574
570
  Returns
@@ -597,7 +593,7 @@ class PadstackDef(GrpcPadstackDef):
597
593
  self.data.hole_range = GrpcPadstackHoleRange.UNKNOWN_RANGE
598
594
 
599
595
  @property
600
- def material(self):
596
+ def material(self) -> str:
601
597
  """Return hole material name."""
602
598
  return self.data.material.value
603
599
 
@@ -605,7 +601,9 @@ class PadstackDef(GrpcPadstackDef):
605
601
  def material(self, value):
606
602
  self.data.material.value = value
607
603
 
608
- def convert_to_3d_microvias(self, convert_only_signal_vias=True, hole_wall_angle=15, delete_padstack_def=True):
604
+ def convert_to_3d_microvias(
605
+ self, convert_only_signal_vias=True, hole_wall_angle=15, delete_padstack_def=True
606
+ ) -> bool:
609
607
  """Convert actual padstack instance to microvias 3D Objects with a given aspect ratio.
610
608
 
611
609
  Parameters
@@ -738,7 +736,7 @@ class PadstackDef(GrpcPadstackDef):
738
736
  self._pedb.logger.info(f"{i} Converted successfully to 3D Objects.")
739
737
  return True
740
738
 
741
- def split_to_microvias(self):
739
+ def split_to_microvias(self) -> list[any]:
742
740
  """Convert actual padstack definition to multiple microvias definitions.
743
741
 
744
742
  Returns
@@ -34,12 +34,30 @@ class Definitions:
34
34
 
35
35
  @property
36
36
  def component(self) -> dict[str, ComponentDef]:
37
- """Component definitions"""
37
+ """Component definitions
38
+
39
+ Examples
40
+ --------
41
+ >>> from pyedb import Edb
42
+ >>> edb = Edb()
43
+ >>> component_defs = edb.definitions.component
44
+ >>> for name, comp_def in component_defs.items():
45
+ ... print(f"Component: {name}, Part: {comp_def.part}")
46
+ """
38
47
  return {l.name: ComponentDef(self._pedb, l) for l in self._pedb.active_db.component_defs}
39
48
 
40
49
  @property
41
50
  def package(self) -> dict[str, PackageDef]:
42
- """Package definitions."""
51
+ """Package definitions.
52
+
53
+ Examples
54
+ --------
55
+ >>> from pyedb import Edb
56
+ >>> edb = Edb()
57
+ >>> package_defs = edb.definitions.package
58
+ >>> for name, pkg_def in package_defs.items():
59
+ ... print(f"Package: {name}, Boundary: {pkg_def.exterior_boundary}")
60
+ """
43
61
  return {l.name: PackageDef(self._pedb, l) for l in self._pedb.active_db.package_defs}
44
62
 
45
63
  def add_package_def(self, name, component_part_name=None, boundary_points=None) -> Union[PackageDef, bool]:
@@ -57,6 +75,22 @@ class Definitions:
57
75
  Returns
58
76
  -------
59
77
  PackageDef object.
78
+
79
+ Examples
80
+ --------
81
+ >>> from pyedb import Edb
82
+ >>> edb = Edb()
83
+
84
+ Example 1: Create package using component's bounding box
85
+ >>> comp_def = edb.definitions.add_package_def("QFP64", "QFP64_COMPONENT")
86
+ >>> if comp_def: # Check if created successfully
87
+ ... print(f"Created package: {comp_def.name}")
88
+
89
+ Example 2: Create package with custom boundary
90
+ >>> boundary = [[0, 0], [10e-3, 0], [10e-3, 10e-3], [0, 10e-3]]
91
+ >>> custom_pkg = edb.definitions.add_package_def("CustomIC", boundary_points=boundary)
92
+ >>> if custom_pkg:
93
+ ... print(f"Custom package boundary: {custom_pkg.exterior_boundary}")
60
94
  """
61
95
  if not name in self.package:
62
96
  package_def = PackageDef.create(self._pedb.active_db, name=name)