pyedb 0.48.0__py3-none-any.whl → 0.50.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyedb might be problematic. Click here for more details.
- pyedb/__init__.py +1 -1
- pyedb/configuration/cfg_modeler.py +42 -11
- pyedb/configuration/cfg_ports_sources.py +9 -1
- pyedb/configuration/cfg_stackup.py +4 -4
- pyedb/dotnet/database/cell/hierarchy/component.py +64 -8
- pyedb/dotnet/database/cell/hierarchy/s_parameter_model.py +7 -0
- pyedb/dotnet/database/cell/terminal/terminal.py +3 -3
- pyedb/dotnet/database/components.py +68 -46
- pyedb/dotnet/database/definition/package_def.py +29 -5
- pyedb/dotnet/database/edb_data/padstacks_data.py +5 -5
- pyedb/dotnet/database/edb_data/primitives_data.py +3 -3
- pyedb/dotnet/database/edb_data/variables.py +3 -3
- pyedb/dotnet/database/geometry/polygon_data.py +14 -1
- pyedb/dotnet/database/materials.py +16 -16
- pyedb/dotnet/database/modeler.py +50 -9
- pyedb/dotnet/database/padstack.py +7 -5
- pyedb/dotnet/database/sim_setup_data/data/settings.py +28 -0
- pyedb/dotnet/database/siwave.py +36 -32
- pyedb/dotnet/database/stackup.py +1 -0
- pyedb/dotnet/database/utilities/hfss_simulation_setup.py +5 -6
- pyedb/dotnet/database/utilities/siwave_simulation_setup.py +3 -1
- pyedb/dotnet/edb.py +22 -20
- pyedb/extensions/__init__.py +0 -0
- pyedb/extensions/via_design_backend.py +681 -0
- pyedb/grpc/database/components.py +57 -48
- pyedb/grpc/database/definition/materials.py +33 -33
- pyedb/grpc/database/definitions.py +6 -4
- pyedb/grpc/database/hfss.py +2 -2
- pyedb/grpc/database/hierarchy/component.py +3 -2
- pyedb/grpc/database/layers/stackup_layer.py +119 -22
- pyedb/grpc/database/layout_validation.py +5 -5
- pyedb/grpc/database/primitive/path.py +1 -1
- pyedb/grpc/database/source_excitations.py +156 -0
- pyedb/grpc/database/stackup.py +50 -24
- pyedb/grpc/edb.py +115 -105
- {pyedb-0.48.0.dist-info → pyedb-0.50.0.dist-info}/METADATA +1 -1
- {pyedb-0.48.0.dist-info → pyedb-0.50.0.dist-info}/RECORD +39 -38
- pyedb/extensions/pre_layout_design_toolkit/via_design.py +0 -1151
- {pyedb-0.48.0.dist-info → pyedb-0.50.0.dist-info}/LICENSE +0 -0
- {pyedb-0.48.0.dist-info → pyedb-0.50.0.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,7 +60,7 @@ 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
|
+
def resistor_value_parser(r_value) -> float:
|
|
63
64
|
"""Convert a resistor value.
|
|
64
65
|
|
|
65
66
|
Parameters
|
|
@@ -148,7 +149,7 @@ class Components(object):
|
|
|
148
149
|
return self._pedb.active_db
|
|
149
150
|
|
|
150
151
|
@property
|
|
151
|
-
def instances(self):
|
|
152
|
+
def instances(self) -> dict[str, Component]:
|
|
152
153
|
"""All Cell components objects.
|
|
153
154
|
|
|
154
155
|
Returns
|
|
@@ -167,7 +168,7 @@ class Components(object):
|
|
|
167
168
|
return self._cmp
|
|
168
169
|
|
|
169
170
|
@property
|
|
170
|
-
def definitions(self):
|
|
171
|
+
def definitions(self) -> dict[str, ComponentDef]:
|
|
171
172
|
"""Retrieve component definition list.
|
|
172
173
|
|
|
173
174
|
Returns
|
|
@@ -176,11 +177,11 @@ class Components(object):
|
|
|
176
177
|
return {l.name: ComponentDef(self._pedb, l) for l in self._pedb.component_defs}
|
|
177
178
|
|
|
178
179
|
@property
|
|
179
|
-
def nport_comp_definition(self):
|
|
180
|
+
def nport_comp_definition(self) -> dict[str, Component]:
|
|
180
181
|
"""Retrieve Nport component definition list."""
|
|
181
182
|
return {name: l for name, l in self.definitions.items() if l.reference_file}
|
|
182
183
|
|
|
183
|
-
def import_definition(self, file_path):
|
|
184
|
+
def import_definition(self, file_path) -> bool:
|
|
184
185
|
"""Import component definition from json file.
|
|
185
186
|
|
|
186
187
|
Parameters
|
|
@@ -214,7 +215,7 @@ class Components(object):
|
|
|
214
215
|
pass
|
|
215
216
|
return True
|
|
216
217
|
|
|
217
|
-
def export_definition(self, file_path):
|
|
218
|
+
def export_definition(self, file_path) -> bool:
|
|
218
219
|
"""Export component definitions to json file.
|
|
219
220
|
|
|
220
221
|
Parameters
|
|
@@ -224,6 +225,7 @@ class Components(object):
|
|
|
224
225
|
|
|
225
226
|
Returns
|
|
226
227
|
-------
|
|
228
|
+
bool
|
|
227
229
|
|
|
228
230
|
"""
|
|
229
231
|
data = {
|
|
@@ -262,9 +264,9 @@ class Components(object):
|
|
|
262
264
|
|
|
263
265
|
with codecs.open(file_path, "w", encoding="utf-8") as f:
|
|
264
266
|
json.dump(data, f, ensure_ascii=False, indent=4)
|
|
265
|
-
return
|
|
267
|
+
return True
|
|
266
268
|
|
|
267
|
-
def refresh_components(self):
|
|
269
|
+
def refresh_components(self) -> bool:
|
|
268
270
|
"""Refresh the component dictionary."""
|
|
269
271
|
self._logger.info("Refreshing the Components dictionary.")
|
|
270
272
|
self._cmp = {}
|
|
@@ -299,7 +301,7 @@ class Components(object):
|
|
|
299
301
|
return True
|
|
300
302
|
|
|
301
303
|
@property
|
|
302
|
-
def resistors(self):
|
|
304
|
+
def resistors(self) -> dict[str, Component]:
|
|
303
305
|
"""Resistors.
|
|
304
306
|
|
|
305
307
|
Returns
|
|
@@ -317,7 +319,7 @@ class Components(object):
|
|
|
317
319
|
return self._res
|
|
318
320
|
|
|
319
321
|
@property
|
|
320
|
-
def capacitors(self):
|
|
322
|
+
def capacitors(self) -> dict[str, Component]:
|
|
321
323
|
"""Capacitors.
|
|
322
324
|
|
|
323
325
|
Returns
|
|
@@ -335,7 +337,7 @@ class Components(object):
|
|
|
335
337
|
return self._cap
|
|
336
338
|
|
|
337
339
|
@property
|
|
338
|
-
def inductors(self):
|
|
340
|
+
def inductors(self) -> dict[str, Component]:
|
|
339
341
|
"""Inductors.
|
|
340
342
|
|
|
341
343
|
Returns
|
|
@@ -354,7 +356,7 @@ class Components(object):
|
|
|
354
356
|
return self._ind
|
|
355
357
|
|
|
356
358
|
@property
|
|
357
|
-
def ICs(self):
|
|
359
|
+
def ICs(self) -> dict[str, Component]:
|
|
358
360
|
"""Integrated circuits.
|
|
359
361
|
|
|
360
362
|
Returns
|
|
@@ -373,7 +375,7 @@ class Components(object):
|
|
|
373
375
|
return self._ics
|
|
374
376
|
|
|
375
377
|
@property
|
|
376
|
-
def IOs(self):
|
|
378
|
+
def IOs(self) -> dict[str, Component]:
|
|
377
379
|
"""Circuit inupts and outputs.
|
|
378
380
|
|
|
379
381
|
Returns
|
|
@@ -392,7 +394,7 @@ class Components(object):
|
|
|
392
394
|
return self._ios
|
|
393
395
|
|
|
394
396
|
@property
|
|
395
|
-
def Others(self):
|
|
397
|
+
def Others(self) -> dict[str, Component]:
|
|
396
398
|
"""Other core components.
|
|
397
399
|
|
|
398
400
|
Returns
|
|
@@ -411,7 +413,7 @@ class Components(object):
|
|
|
411
413
|
return self._others
|
|
412
414
|
|
|
413
415
|
@property
|
|
414
|
-
def components_by_partname(self):
|
|
416
|
+
def components_by_partname(self) -> dict[str, Component]:
|
|
415
417
|
"""Components by part name.
|
|
416
418
|
|
|
417
419
|
Returns
|
|
@@ -435,7 +437,7 @@ class Components(object):
|
|
|
435
437
|
self._comps_by_part[val.partname] = [val]
|
|
436
438
|
return self._comps_by_part
|
|
437
439
|
|
|
438
|
-
def get_component_by_name(self, name):
|
|
440
|
+
def get_component_by_name(self, name) -> Component:
|
|
439
441
|
"""Retrieve a component by name.
|
|
440
442
|
|
|
441
443
|
Parameters
|
|
@@ -451,7 +453,7 @@ class Components(object):
|
|
|
451
453
|
"""
|
|
452
454
|
return self.instances[name]
|
|
453
455
|
|
|
454
|
-
def get_pin_from_component(self, component, net_name=None, pin_name=None):
|
|
456
|
+
def get_pin_from_component(self, component, net_name=None, pin_name=None) -> list:
|
|
455
457
|
"""Return component pins.
|
|
456
458
|
Parameters
|
|
457
459
|
----------
|
|
@@ -479,7 +481,7 @@ class Components(object):
|
|
|
479
481
|
pins = [pin for pin in pins if pin.name == pin_name]
|
|
480
482
|
return pins
|
|
481
483
|
|
|
482
|
-
def get_components_from_nets(self, netlist=None):
|
|
484
|
+
def get_components_from_nets(self, netlist=None) -> list[Component]:
|
|
483
485
|
"""Retrieve components from a net list.
|
|
484
486
|
|
|
485
487
|
Parameters
|
|
@@ -609,7 +611,7 @@ class Components(object):
|
|
|
609
611
|
self._logger.warning("Failed to compute vector.")
|
|
610
612
|
return False, [0, 0], 0, 0
|
|
611
613
|
|
|
612
|
-
def get_solder_ball_height(self, cmp):
|
|
614
|
+
def get_solder_ball_height(self, cmp) -> float:
|
|
613
615
|
"""Get component solder ball height.
|
|
614
616
|
|
|
615
617
|
Parameters
|
|
@@ -627,7 +629,7 @@ class Components(object):
|
|
|
627
629
|
cmp = self.get_component_by_name(cmp)
|
|
628
630
|
return cmp.solder_ball_height
|
|
629
631
|
|
|
630
|
-
def get_vendor_libraries(self):
|
|
632
|
+
def get_vendor_libraries(self) -> ComponentLib:
|
|
631
633
|
"""Retrieve all capacitors and inductors libraries from ANSYS installation (used by Siwave).
|
|
632
634
|
|
|
633
635
|
Returns
|
|
@@ -915,7 +917,7 @@ class Components(object):
|
|
|
915
917
|
component.enabled = False
|
|
916
918
|
return self._pedb.source_excitation.add_rlc_boundary(component.refdes, False)
|
|
917
919
|
|
|
918
|
-
def deactivate_rlc_component(self, component=None, create_circuit_port=False, pec_boundary=False):
|
|
920
|
+
def deactivate_rlc_component(self, component=None, create_circuit_port=False, pec_boundary=False) -> bool:
|
|
919
921
|
"""Deactivate RLC component with a possibility to convert it to a circuit port.
|
|
920
922
|
|
|
921
923
|
Parameters
|
|
@@ -1056,7 +1058,7 @@ class Components(object):
|
|
|
1056
1058
|
pingroup=pingroup, term_name=term_name, term_type=term_type, isref=isref
|
|
1057
1059
|
)
|
|
1058
1060
|
|
|
1059
|
-
def _is_top_component(self, cmp):
|
|
1061
|
+
def _is_top_component(self, cmp) -> bool:
|
|
1060
1062
|
"""Test the component placement layer.
|
|
1061
1063
|
|
|
1062
1064
|
Parameters
|
|
@@ -1112,7 +1114,7 @@ class Components(object):
|
|
|
1112
1114
|
c_value=None,
|
|
1113
1115
|
l_value=None,
|
|
1114
1116
|
is_parallel=False,
|
|
1115
|
-
):
|
|
1117
|
+
) -> bool:
|
|
1116
1118
|
"""Create a component from pins.
|
|
1117
1119
|
|
|
1118
1120
|
Parameters
|
|
@@ -1221,7 +1223,7 @@ class Components(object):
|
|
|
1221
1223
|
|
|
1222
1224
|
def create_component_from_pins(
|
|
1223
1225
|
self, pins, component_name, placement_layer=None, component_part_name=None
|
|
1224
|
-
): # pragma: no cover
|
|
1226
|
+
) -> bool: # pragma: no cover
|
|
1225
1227
|
"""Create a component from pins.
|
|
1226
1228
|
|
|
1227
1229
|
.. deprecated:: 0.6.62
|
|
@@ -1261,7 +1263,7 @@ class Components(object):
|
|
|
1261
1263
|
is_rlc=False,
|
|
1262
1264
|
)
|
|
1263
1265
|
|
|
1264
|
-
def set_component_model(self, componentname, model_type="Spice", modelpath=None, modelname=None):
|
|
1266
|
+
def set_component_model(self, componentname, model_type="Spice", modelpath=None, modelname=None) -> bool:
|
|
1265
1267
|
"""Assign a Spice or Touchstone model to a component.
|
|
1266
1268
|
|
|
1267
1269
|
Parameters
|
|
@@ -1340,7 +1342,7 @@ class Components(object):
|
|
|
1340
1342
|
component.component_property.model = s_parameter_mod
|
|
1341
1343
|
return True
|
|
1342
1344
|
|
|
1343
|
-
def create_pingroup_from_pins(self, pins, group_name=None):
|
|
1345
|
+
def create_pingroup_from_pins(self, pins, group_name=None) -> Union[PinGroup, bool]:
|
|
1344
1346
|
"""Create a pin group on a component.
|
|
1345
1347
|
|
|
1346
1348
|
Parameters
|
|
@@ -1353,8 +1355,7 @@ class Components(object):
|
|
|
1353
1355
|
|
|
1354
1356
|
Returns
|
|
1355
1357
|
-------
|
|
1356
|
-
|
|
1357
|
-
The tuple is structured as: (bool, pingroup).
|
|
1358
|
+
pingroup object.
|
|
1358
1359
|
|
|
1359
1360
|
Examples
|
|
1360
1361
|
--------
|
|
@@ -1395,7 +1396,7 @@ class Components(object):
|
|
|
1395
1396
|
pin_group.net = pins[0].net
|
|
1396
1397
|
return pin_group
|
|
1397
1398
|
|
|
1398
|
-
def delete_single_pin_rlc(self, deactivate_only=False):
|
|
1399
|
+
def delete_single_pin_rlc(self, deactivate_only=False) -> list[Component]:
|
|
1399
1400
|
# type: (bool) -> list
|
|
1400
1401
|
"""Delete all RLC components with a single pin.
|
|
1401
1402
|
Single pin component model type will be reverted to ``"RLC"``.
|
|
@@ -1435,7 +1436,7 @@ class Components(object):
|
|
|
1435
1436
|
self._pedb.logger.info("Deleted {} components".format(len(deleted_comps)))
|
|
1436
1437
|
return deleted_comps
|
|
1437
1438
|
|
|
1438
|
-
def delete(self, component_name):
|
|
1439
|
+
def delete(self, component_name) -> bool:
|
|
1439
1440
|
"""Delete a component.
|
|
1440
1441
|
|
|
1441
1442
|
Parameters
|
|
@@ -1464,7 +1465,7 @@ class Components(object):
|
|
|
1464
1465
|
return True
|
|
1465
1466
|
return False
|
|
1466
1467
|
|
|
1467
|
-
def disable_rlc_component(self, component_name):
|
|
1468
|
+
def disable_rlc_component(self, component_name) -> bool:
|
|
1468
1469
|
"""Disable a RLC component.
|
|
1469
1470
|
|
|
1470
1471
|
Parameters
|
|
@@ -1512,7 +1513,7 @@ class Components(object):
|
|
|
1512
1513
|
reference_size_x=0,
|
|
1513
1514
|
reference_size_y=0,
|
|
1514
1515
|
reference_height=0,
|
|
1515
|
-
):
|
|
1516
|
+
) -> bool:
|
|
1516
1517
|
"""Set cylindrical solder balls on a given component.
|
|
1517
1518
|
|
|
1518
1519
|
Parameters
|
|
@@ -1610,7 +1611,7 @@ class Components(object):
|
|
|
1610
1611
|
ind_value=None,
|
|
1611
1612
|
cap_value=None,
|
|
1612
1613
|
isparallel=False,
|
|
1613
|
-
):
|
|
1614
|
+
) -> bool:
|
|
1614
1615
|
"""Update values for an RLC component.
|
|
1615
1616
|
|
|
1616
1617
|
Parameters
|
|
@@ -1689,7 +1690,7 @@ class Components(object):
|
|
|
1689
1690
|
valuefield="Func des",
|
|
1690
1691
|
comptype="Prod name",
|
|
1691
1692
|
refdes="Pos / Place",
|
|
1692
|
-
):
|
|
1693
|
+
) -> bool:
|
|
1693
1694
|
"""Update the EDC core component values (RLCs) with values coming from a BOM file.
|
|
1694
1695
|
|
|
1695
1696
|
Parameters
|
|
@@ -1759,7 +1760,7 @@ class Components(object):
|
|
|
1759
1760
|
part_name_col=1,
|
|
1760
1761
|
comp_type_col=2,
|
|
1761
1762
|
value_col=3,
|
|
1762
|
-
):
|
|
1763
|
+
) -> bool:
|
|
1763
1764
|
"""Load external BOM file.
|
|
1764
1765
|
|
|
1765
1766
|
Parameters
|
|
@@ -1839,7 +1840,7 @@ class Components(object):
|
|
|
1839
1840
|
self.instances[comp].enabled = False
|
|
1840
1841
|
return True
|
|
1841
1842
|
|
|
1842
|
-
def export_bom(self, bom_file, delimiter=","):
|
|
1843
|
+
def export_bom(self, bom_file, delimiter=",") -> bool:
|
|
1843
1844
|
"""Export Bom file from layout.
|
|
1844
1845
|
|
|
1845
1846
|
Parameters
|
|
@@ -1848,6 +1849,10 @@ class Components(object):
|
|
|
1848
1849
|
Full path to the BOM file, which is a delimited text file.
|
|
1849
1850
|
delimiter : str, optional
|
|
1850
1851
|
Value to use for the delimiter. The default is ``","``.
|
|
1852
|
+
|
|
1853
|
+
Returns
|
|
1854
|
+
-------
|
|
1855
|
+
bool
|
|
1851
1856
|
"""
|
|
1852
1857
|
with open(bom_file, "w") as f:
|
|
1853
1858
|
f.writelines([delimiter.join(["RefDes", "Part name", "Type", "Value\n"])])
|
|
@@ -1869,17 +1874,21 @@ class Components(object):
|
|
|
1869
1874
|
f.writelines([delimiter.join([refdes, part_name, comp_type, value + "\n"])])
|
|
1870
1875
|
return True
|
|
1871
1876
|
|
|
1872
|
-
def find_by_reference_designator(self, reference_designator):
|
|
1877
|
+
def find_by_reference_designator(self, reference_designator) -> Component:
|
|
1873
1878
|
"""Find a component.
|
|
1874
1879
|
|
|
1875
1880
|
Parameters
|
|
1876
1881
|
----------
|
|
1877
1882
|
reference_designator : str
|
|
1878
1883
|
Reference designator of the component.
|
|
1884
|
+
|
|
1885
|
+
Returns
|
|
1886
|
+
-------
|
|
1887
|
+
Component object.
|
|
1879
1888
|
"""
|
|
1880
1889
|
return self.instances[reference_designator]
|
|
1881
1890
|
|
|
1882
|
-
def get_aedt_pin_name(self, pin):
|
|
1891
|
+
def get_aedt_pin_name(self, pin) -> str:
|
|
1883
1892
|
"""Retrieve the pin name that is shown in AEDT.
|
|
1884
1893
|
|
|
1885
1894
|
.. note::
|
|
@@ -1919,7 +1928,7 @@ class Components(object):
|
|
|
1919
1928
|
|
|
1920
1929
|
Returns
|
|
1921
1930
|
-------
|
|
1922
|
-
|
|
1931
|
+
list of PadstackInstance object.
|
|
1923
1932
|
"""
|
|
1924
1933
|
comp = self.find_by_reference_designator(reference_designator)
|
|
1925
1934
|
|
|
@@ -1932,7 +1941,7 @@ class Components(object):
|
|
|
1932
1941
|
|
|
1933
1942
|
return pins
|
|
1934
1943
|
|
|
1935
|
-
def get_pin_position(self, pin):
|
|
1944
|
+
def get_pin_position(self, pin) -> list[float, float]:
|
|
1936
1945
|
"""Retrieve the pin position in meters.
|
|
1937
1946
|
|
|
1938
1947
|
Parameters
|
|
@@ -1961,7 +1970,7 @@ class Components(object):
|
|
|
1961
1970
|
transformed_pt_pos = pin.component.transform.transform_point(pt_pos)
|
|
1962
1971
|
return [transformed_pt_pos[0].value, transformed_pt_pos[1].value]
|
|
1963
1972
|
|
|
1964
|
-
def get_pins_name_from_net(self, net_name, pin_list=None):
|
|
1973
|
+
def get_pins_name_from_net(self, net_name, pin_list=None) -> list[str]:
|
|
1965
1974
|
"""Retrieve pins belonging to a net.
|
|
1966
1975
|
|
|
1967
1976
|
Parameters
|
|
@@ -1996,7 +2005,7 @@ class Components(object):
|
|
|
1996
2005
|
pin_names.append(self.get_aedt_pin_name(pin))
|
|
1997
2006
|
return pin_names
|
|
1998
2007
|
|
|
1999
|
-
def get_nets_from_pin_list(self, pins):
|
|
2008
|
+
def get_nets_from_pin_list(self, pins) -> list[str]:
|
|
2000
2009
|
"""Retrieve nets with one or more pins.
|
|
2001
2010
|
|
|
2002
2011
|
Parameters
|
|
@@ -2019,7 +2028,7 @@ class Components(object):
|
|
|
2019
2028
|
"""
|
|
2020
2029
|
return list(set([pin.net.name for pin in pins]))
|
|
2021
2030
|
|
|
2022
|
-
def get_component_net_connection_info(self, refdes):
|
|
2031
|
+
def get_component_net_connection_info(self, refdes) -> Component:
|
|
2023
2032
|
"""Retrieve net connection information.
|
|
2024
2033
|
|
|
2025
2034
|
Parameters
|
|
@@ -2051,7 +2060,7 @@ class Components(object):
|
|
|
2051
2060
|
data["net_name"].append(net_name)
|
|
2052
2061
|
return data
|
|
2053
2062
|
|
|
2054
|
-
def get_rats(self):
|
|
2063
|
+
def get_rats(self) -> list[dict[str, str]]:
|
|
2055
2064
|
"""Retrieve a list of dictionaries of the reference designator, pin names, and net names.
|
|
2056
2065
|
|
|
2057
2066
|
Returns
|
|
@@ -2074,7 +2083,7 @@ class Components(object):
|
|
|
2074
2083
|
df_list.append(df)
|
|
2075
2084
|
return df_list
|
|
2076
2085
|
|
|
2077
|
-
def get_through_resistor_list(self, threshold=1):
|
|
2086
|
+
def get_through_resistor_list(self, threshold=1) -> list[Component]:
|
|
2078
2087
|
"""Retrieve through resistors.
|
|
2079
2088
|
|
|
2080
2089
|
Parameters
|
|
@@ -2108,7 +2117,7 @@ class Components(object):
|
|
|
2108
2117
|
|
|
2109
2118
|
return through_comp_list
|
|
2110
2119
|
|
|
2111
|
-
def short_component_pins(self, component_name, pins_to_short=None, width=1e-3):
|
|
2120
|
+
def short_component_pins(self, component_name, pins_to_short=None, width=1e-3) -> bool:
|
|
2112
2121
|
"""Short pins of component with a trace.
|
|
2113
2122
|
|
|
2114
2123
|
Parameters
|
|
@@ -2248,7 +2257,7 @@ class Components(object):
|
|
|
2248
2257
|
i += 1
|
|
2249
2258
|
return True
|
|
2250
2259
|
|
|
2251
|
-
def create_pin_group(self, reference_designator, pin_numbers, group_name=None):
|
|
2260
|
+
def create_pin_group(self, reference_designator, pin_numbers, group_name=None) -> Union[tuple[str, PinGroup], bool]:
|
|
2252
2261
|
"""Create pin group on the component.
|
|
2253
2262
|
|
|
2254
2263
|
Parameters
|
|
@@ -2288,7 +2297,7 @@ class Components(object):
|
|
|
2288
2297
|
return group_name, PinGroup(self._pedb, pingroup)
|
|
2289
2298
|
return False
|
|
2290
2299
|
|
|
2291
|
-
def create_pin_group_on_net(self, reference_designator, net_name, group_name=None):
|
|
2300
|
+
def create_pin_group_on_net(self, reference_designator, net_name, group_name=None) -> PinGroup:
|
|
2292
2301
|
"""Create pin group on component by net name.
|
|
2293
2302
|
|
|
2294
2303
|
Parameters
|
|
@@ -99,22 +99,22 @@ def get_line_float_value(line):
|
|
|
99
99
|
class MaterialProperties(BaseModel):
|
|
100
100
|
"""Store material properties."""
|
|
101
101
|
|
|
102
|
-
conductivity: Optional[PositiveFloat] =
|
|
103
|
-
dielectric_loss_tangent: Optional[PositiveFloat] =
|
|
104
|
-
magnetic_loss_tangent: Optional[PositiveFloat] =
|
|
105
|
-
mass_density: Optional[PositiveFloat] =
|
|
106
|
-
permittivity: Optional[PositiveFloat] =
|
|
107
|
-
permeability: Optional[PositiveFloat] =
|
|
108
|
-
poisson_ratio: Optional[PositiveFloat] =
|
|
109
|
-
specific_heat: Optional[PositiveFloat] =
|
|
110
|
-
thermal_conductivity: Optional[PositiveFloat] =
|
|
111
|
-
youngs_modulus: Optional[PositiveFloat] =
|
|
112
|
-
thermal_expansion_coefficient: Optional[PositiveFloat] =
|
|
113
|
-
dc_conductivity: Optional[PositiveFloat] =
|
|
114
|
-
dc_permittivity: Optional[PositiveFloat] =
|
|
115
|
-
dielectric_model_frequency: Optional[PositiveFloat] =
|
|
116
|
-
loss_tangent_at_frequency: Optional[PositiveFloat] =
|
|
117
|
-
permittivity_at_frequency: Optional[PositiveFloat] =
|
|
102
|
+
conductivity: Optional[PositiveFloat] = 0.0
|
|
103
|
+
dielectric_loss_tangent: Optional[PositiveFloat] = 0.0
|
|
104
|
+
magnetic_loss_tangent: Optional[PositiveFloat] = 0.0
|
|
105
|
+
mass_density: Optional[PositiveFloat] = 0.0
|
|
106
|
+
permittivity: Optional[PositiveFloat] = 0.0
|
|
107
|
+
permeability: Optional[PositiveFloat] = 0.0
|
|
108
|
+
poisson_ratio: Optional[PositiveFloat] = 0.0
|
|
109
|
+
specific_heat: Optional[PositiveFloat] = 0.0
|
|
110
|
+
thermal_conductivity: Optional[PositiveFloat] = 0.0
|
|
111
|
+
youngs_modulus: Optional[PositiveFloat] = 0.0
|
|
112
|
+
thermal_expansion_coefficient: Optional[PositiveFloat] = 0.0
|
|
113
|
+
dc_conductivity: Optional[PositiveFloat] = 0.0
|
|
114
|
+
dc_permittivity: Optional[PositiveFloat] = 0.0
|
|
115
|
+
dielectric_model_frequency: Optional[PositiveFloat] = 0.0
|
|
116
|
+
loss_tangent_at_frequency: Optional[PositiveFloat] = 0.0
|
|
117
|
+
permittivity_at_frequency: Optional[PositiveFloat] = 0.0
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
class Material(GrpcMaterialDef):
|
|
@@ -169,7 +169,7 @@ class Material(GrpcMaterialDef):
|
|
|
169
169
|
self.__dielectric_model = GrpcDjordjecvicSarkarModel(super().dielectric_material_model.msg)
|
|
170
170
|
return self.__dielectric_model
|
|
171
171
|
except:
|
|
172
|
-
return
|
|
172
|
+
return 0.0
|
|
173
173
|
|
|
174
174
|
@property
|
|
175
175
|
def conductivity(self):
|
|
@@ -184,7 +184,7 @@ class Material(GrpcMaterialDef):
|
|
|
184
184
|
value = self.get_property(GrpcMaterialProperty.CONDUCTIVITY).value
|
|
185
185
|
return value
|
|
186
186
|
except:
|
|
187
|
-
return
|
|
187
|
+
return 0.0
|
|
188
188
|
|
|
189
189
|
@conductivity.setter
|
|
190
190
|
def conductivity(self, value):
|
|
@@ -210,7 +210,7 @@ class Material(GrpcMaterialDef):
|
|
|
210
210
|
try:
|
|
211
211
|
return self.dielectric_material_model.dc_conductivity
|
|
212
212
|
except:
|
|
213
|
-
return
|
|
213
|
+
return None
|
|
214
214
|
|
|
215
215
|
@dc_conductivity.setter
|
|
216
216
|
def dc_conductivity(self, value):
|
|
@@ -230,7 +230,7 @@ class Material(GrpcMaterialDef):
|
|
|
230
230
|
try:
|
|
231
231
|
return self.dielectric_material_model.dc_relative_permitivity
|
|
232
232
|
except:
|
|
233
|
-
return
|
|
233
|
+
return None
|
|
234
234
|
|
|
235
235
|
@dc_permittivity.setter
|
|
236
236
|
def dc_permittivity(self, value):
|
|
@@ -250,7 +250,7 @@ class Material(GrpcMaterialDef):
|
|
|
250
250
|
try:
|
|
251
251
|
return self.dielectric_material_model.loss_tangent_at_frequency
|
|
252
252
|
except:
|
|
253
|
-
return
|
|
253
|
+
return None
|
|
254
254
|
|
|
255
255
|
@loss_tangent_at_frequency.setter
|
|
256
256
|
def loss_tangent_at_frequency(self, value):
|
|
@@ -270,7 +270,7 @@ class Material(GrpcMaterialDef):
|
|
|
270
270
|
try:
|
|
271
271
|
return self.dielectric_material_model.frequency
|
|
272
272
|
except:
|
|
273
|
-
return
|
|
273
|
+
return None
|
|
274
274
|
|
|
275
275
|
@dielectric_model_frequency.setter
|
|
276
276
|
def dielectric_model_frequency(self, value):
|
|
@@ -291,7 +291,7 @@ class Material(GrpcMaterialDef):
|
|
|
291
291
|
try:
|
|
292
292
|
return self.dielectric_material_model.relative_permitivity_at_frequency
|
|
293
293
|
except:
|
|
294
|
-
return
|
|
294
|
+
return None
|
|
295
295
|
|
|
296
296
|
@permittivity_at_frequency.setter
|
|
297
297
|
def permittivity_at_frequency(self, value):
|
|
@@ -313,7 +313,7 @@ class Material(GrpcMaterialDef):
|
|
|
313
313
|
value = self.get_property(GrpcMaterialProperty.PERMITTIVITY).value
|
|
314
314
|
return value
|
|
315
315
|
except:
|
|
316
|
-
return
|
|
316
|
+
return 0.0
|
|
317
317
|
|
|
318
318
|
@permittivity.setter
|
|
319
319
|
def permittivity(self, value):
|
|
@@ -334,7 +334,7 @@ class Material(GrpcMaterialDef):
|
|
|
334
334
|
value = self.get_property(GrpcMaterialProperty.PERMEABILITY).value
|
|
335
335
|
return value
|
|
336
336
|
except:
|
|
337
|
-
return
|
|
337
|
+
return 0.0
|
|
338
338
|
|
|
339
339
|
@permeability.setter
|
|
340
340
|
def permeability(self, value):
|
|
@@ -371,7 +371,7 @@ class Material(GrpcMaterialDef):
|
|
|
371
371
|
try:
|
|
372
372
|
return self.get_property(GrpcMaterialProperty.DIELECTRIC_LOSS_TANGENT).value
|
|
373
373
|
except:
|
|
374
|
-
return
|
|
374
|
+
return 0.0
|
|
375
375
|
|
|
376
376
|
@loss_tangent.setter
|
|
377
377
|
def loss_tangent(self, value):
|
|
@@ -401,7 +401,7 @@ class Material(GrpcMaterialDef):
|
|
|
401
401
|
value = self.get_property(GrpcMaterialProperty.MAGNETIC_LOSS_TANGENT).value
|
|
402
402
|
return value
|
|
403
403
|
except:
|
|
404
|
-
return
|
|
404
|
+
return 0.0
|
|
405
405
|
|
|
406
406
|
@magnetic_loss_tangent.setter
|
|
407
407
|
def magnetic_loss_tangent(self, value):
|
|
@@ -422,7 +422,7 @@ class Material(GrpcMaterialDef):
|
|
|
422
422
|
value = self.get_property(GrpcMaterialProperty.THERMAL_CONDUCTIVITY).value
|
|
423
423
|
return value
|
|
424
424
|
except:
|
|
425
|
-
return
|
|
425
|
+
return 0.0
|
|
426
426
|
|
|
427
427
|
@thermal_conductivity.setter
|
|
428
428
|
def thermal_conductivity(self, value):
|
|
@@ -443,7 +443,7 @@ class Material(GrpcMaterialDef):
|
|
|
443
443
|
value = self.get_property(GrpcMaterialProperty.MASS_DENSITY).value
|
|
444
444
|
return value
|
|
445
445
|
except:
|
|
446
|
-
return
|
|
446
|
+
return 0.0
|
|
447
447
|
|
|
448
448
|
@mass_density.setter
|
|
449
449
|
def mass_density(self, value):
|
|
@@ -464,7 +464,7 @@ class Material(GrpcMaterialDef):
|
|
|
464
464
|
value = self.get_property(GrpcMaterialProperty.YOUNGS_MODULUS).value
|
|
465
465
|
return value
|
|
466
466
|
except:
|
|
467
|
-
return
|
|
467
|
+
return 0.0
|
|
468
468
|
|
|
469
469
|
@youngs_modulus.setter
|
|
470
470
|
def youngs_modulus(self, value):
|
|
@@ -483,7 +483,7 @@ class Material(GrpcMaterialDef):
|
|
|
483
483
|
try:
|
|
484
484
|
return self.get_property(GrpcMaterialProperty.SPECIFIC_HEAT).value
|
|
485
485
|
except:
|
|
486
|
-
return
|
|
486
|
+
return 0.0
|
|
487
487
|
|
|
488
488
|
@specific_heat.setter
|
|
489
489
|
def specific_heat(self, value):
|
|
@@ -502,7 +502,7 @@ class Material(GrpcMaterialDef):
|
|
|
502
502
|
try:
|
|
503
503
|
return self.get_property(GrpcMaterialProperty.POISSONS_RATIO).value
|
|
504
504
|
except:
|
|
505
|
-
return
|
|
505
|
+
return 0.0
|
|
506
506
|
|
|
507
507
|
@poisson_ratio.setter
|
|
508
508
|
def poisson_ratio(self, value):
|
|
@@ -522,7 +522,7 @@ class Material(GrpcMaterialDef):
|
|
|
522
522
|
try:
|
|
523
523
|
return self.get_property(GrpcMaterialProperty.THERMAL_EXPANSION_COEFFICIENT).value
|
|
524
524
|
except:
|
|
525
|
-
return
|
|
525
|
+
return 0.0
|
|
526
526
|
|
|
527
527
|
@thermal_expansion_coefficient.setter
|
|
528
528
|
def thermal_expansion_coefficient(self, value):
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
|
|
23
|
+
from typing import Union
|
|
24
|
+
|
|
23
25
|
from ansys.edb.core.geometry.polygon_data import PolygonData as GrpcPolygonData
|
|
24
26
|
|
|
25
27
|
from pyedb.grpc.database.definition.component_def import ComponentDef
|
|
@@ -31,16 +33,16 @@ class Definitions:
|
|
|
31
33
|
self._pedb = pedb
|
|
32
34
|
|
|
33
35
|
@property
|
|
34
|
-
def component(self):
|
|
36
|
+
def component(self) -> dict[str, ComponentDef]:
|
|
35
37
|
"""Component definitions"""
|
|
36
38
|
return {l.name: ComponentDef(self._pedb, l) for l in self._pedb.active_db.component_defs}
|
|
37
39
|
|
|
38
40
|
@property
|
|
39
|
-
def package(self):
|
|
41
|
+
def package(self) -> dict[str, PackageDef]:
|
|
40
42
|
"""Package definitions."""
|
|
41
43
|
return {l.name: PackageDef(self._pedb, l) for l in self._pedb.active_db.package_defs}
|
|
42
44
|
|
|
43
|
-
def add_package_def(self, name, component_part_name=None, boundary_points=None):
|
|
45
|
+
def add_package_def(self, name, component_part_name=None, boundary_points=None) -> Union[PackageDef, bool]:
|
|
44
46
|
"""Add a package definition.
|
|
45
47
|
|
|
46
48
|
Parameters
|
|
@@ -54,7 +56,7 @@ class Definitions:
|
|
|
54
56
|
|
|
55
57
|
Returns
|
|
56
58
|
-------
|
|
57
|
-
|
|
59
|
+
PackageDef object.
|
|
58
60
|
"""
|
|
59
61
|
if not name in self.package:
|
|
60
62
|
package_def = PackageDef.create(self._pedb.active_db, name=name)
|
pyedb/grpc/database/hfss.py
CHANGED
|
@@ -43,7 +43,7 @@ class Hfss(object):
|
|
|
43
43
|
self._pedb = p_edb
|
|
44
44
|
|
|
45
45
|
@property
|
|
46
|
-
def hfss_extent_info(self):
|
|
46
|
+
def hfss_extent_info(self) -> HfssExtentInfo:
|
|
47
47
|
"""HFSS extent information."""
|
|
48
48
|
return HfssExtentInfo(self._pedb)
|
|
49
49
|
|
|
@@ -1207,7 +1207,7 @@ class Hfss(object):
|
|
|
1207
1207
|
stop_freq=20e9,
|
|
1208
1208
|
step_freq=1e6,
|
|
1209
1209
|
discrete_sweep=False,
|
|
1210
|
-
):
|
|
1210
|
+
) -> HfssSimulationSetup:
|
|
1211
1211
|
"""Add a HFSS analysis to EDB.
|
|
1212
1212
|
|
|
1213
1213
|
Parameters
|
|
@@ -416,9 +416,10 @@ class Component(GrpcComponentGroup):
|
|
|
416
416
|
float
|
|
417
417
|
Balls height value.
|
|
418
418
|
"""
|
|
419
|
-
|
|
419
|
+
try:
|
|
420
420
|
return self.component_property.solder_ball_property.height.value
|
|
421
|
-
|
|
421
|
+
except:
|
|
422
|
+
return None
|
|
422
423
|
|
|
423
424
|
@solder_ball_height.setter
|
|
424
425
|
def solder_ball_height(self, value):
|