pyedb 0.53.0__py3-none-any.whl → 0.55.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 -8
- pyedb/configuration/cfg_boundaries.py +69 -151
- pyedb/configuration/cfg_components.py +201 -460
- pyedb/configuration/cfg_data.py +4 -2
- pyedb/configuration/cfg_general.py +13 -36
- pyedb/configuration/cfg_modeler.py +2 -1
- pyedb/configuration/cfg_nets.py +21 -35
- pyedb/configuration/cfg_operations.py +22 -151
- pyedb/configuration/cfg_package_definition.py +56 -112
- pyedb/configuration/cfg_padstacks.py +292 -688
- pyedb/configuration/cfg_pin_groups.py +32 -79
- pyedb/configuration/cfg_ports_sources.py +20 -9
- pyedb/configuration/cfg_s_parameter_models.py +67 -172
- pyedb/configuration/cfg_setup.py +102 -295
- pyedb/configuration/configuration.py +66 -6
- pyedb/dotnet/database/cell/connectable.py +38 -9
- pyedb/dotnet/database/cell/hierarchy/component.py +28 -28
- pyedb/dotnet/database/cell/hierarchy/model.py +1 -1
- pyedb/dotnet/database/cell/layout.py +64 -3
- pyedb/dotnet/database/cell/layout_obj.py +3 -3
- pyedb/dotnet/database/cell/primitive/path.py +6 -8
- pyedb/dotnet/database/cell/primitive/primitive.py +10 -31
- pyedb/dotnet/database/cell/terminal/edge_terminal.py +2 -2
- pyedb/dotnet/database/cell/terminal/padstack_instance_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/pingroup_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/point_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/terminal.py +26 -28
- pyedb/dotnet/database/cell/voltage_regulator.py +0 -21
- pyedb/dotnet/database/components.py +99 -91
- pyedb/dotnet/database/definition/component_def.py +4 -4
- pyedb/dotnet/database/definition/component_model.py +1 -1
- pyedb/dotnet/database/definition/package_def.py +2 -3
- pyedb/dotnet/database/dotnet/database.py +27 -218
- pyedb/dotnet/database/dotnet/primitive.py +16 -16
- pyedb/dotnet/database/edb_data/control_file.py +5 -5
- pyedb/dotnet/database/edb_data/hfss_extent_info.py +6 -6
- pyedb/dotnet/database/edb_data/layer_data.py +35 -35
- pyedb/dotnet/database/edb_data/padstacks_data.py +65 -90
- pyedb/dotnet/database/edb_data/primitives_data.py +5 -5
- pyedb/dotnet/database/edb_data/sources.py +6 -6
- pyedb/dotnet/database/edb_data/variables.py +8 -4
- pyedb/dotnet/database/geometry/point_data.py +14 -10
- pyedb/dotnet/database/geometry/polygon_data.py +3 -5
- pyedb/dotnet/database/hfss.py +50 -52
- pyedb/dotnet/database/layout_validation.py +14 -11
- pyedb/dotnet/database/materials.py +10 -11
- pyedb/dotnet/database/modeler.py +104 -101
- pyedb/dotnet/database/nets.py +20 -23
- pyedb/dotnet/database/padstack.py +156 -84
- pyedb/dotnet/database/sim_setup_data/data/settings.py +24 -0
- pyedb/dotnet/database/sim_setup_data/io/siwave.py +26 -1
- pyedb/dotnet/database/siwave.py +47 -47
- pyedb/dotnet/database/stackup.py +152 -87
- pyedb/dotnet/database/utilities/heatsink.py +4 -4
- pyedb/dotnet/database/utilities/obj_base.py +3 -3
- pyedb/dotnet/database/utilities/simulation_setup.py +2 -2
- pyedb/dotnet/database/utilities/value.py +116 -0
- pyedb/dotnet/edb.py +248 -170
- pyedb/edb_logger.py +12 -27
- pyedb/extensions/via_design_backend.py +6 -3
- pyedb/generic/design_types.py +68 -21
- pyedb/generic/general_methods.py +0 -120
- pyedb/generic/process.py +44 -108
- pyedb/generic/settings.py +75 -19
- pyedb/grpc/__init__.py +0 -0
- pyedb/grpc/database/components.py +55 -17
- pyedb/grpc/database/control_file.py +5 -5
- pyedb/grpc/database/definition/materials.py +24 -31
- pyedb/grpc/database/definition/package_def.py +18 -18
- pyedb/grpc/database/definition/padstack_def.py +104 -51
- pyedb/grpc/database/geometry/arc_data.py +7 -5
- pyedb/grpc/database/geometry/point_3d_data.py +8 -7
- pyedb/grpc/database/geometry/polygon_data.py +4 -3
- pyedb/grpc/database/hierarchy/component.py +43 -38
- pyedb/grpc/database/hierarchy/pin_pair_model.py +15 -14
- pyedb/grpc/database/hierarchy/pingroup.py +9 -9
- pyedb/grpc/database/layers/stackup_layer.py +45 -44
- pyedb/grpc/database/layout/layout.py +17 -13
- pyedb/grpc/database/layout/voltage_regulator.py +7 -7
- pyedb/grpc/database/layout_validation.py +16 -15
- pyedb/grpc/database/modeler.py +60 -58
- pyedb/grpc/database/net/net.py +15 -14
- pyedb/grpc/database/nets.py +112 -31
- pyedb/grpc/database/padstacks.py +303 -190
- pyedb/grpc/database/ports/ports.py +5 -6
- pyedb/grpc/database/primitive/bondwire.py +8 -7
- pyedb/grpc/database/primitive/circle.py +4 -4
- pyedb/grpc/database/primitive/padstack_instance.py +191 -23
- pyedb/grpc/database/primitive/path.py +7 -7
- pyedb/grpc/database/primitive/polygon.py +3 -3
- pyedb/grpc/database/primitive/primitive.py +13 -17
- pyedb/grpc/database/primitive/rectangle.py +13 -13
- pyedb/grpc/database/simulation_setup/hfss_general_settings.py +1 -1
- pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +10 -0
- pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +17 -1
- pyedb/grpc/database/siwave.py +31 -25
- pyedb/grpc/database/source_excitations.py +335 -233
- pyedb/grpc/database/stackup.py +165 -148
- pyedb/grpc/database/terminal/bundle_terminal.py +18 -8
- pyedb/grpc/database/terminal/edge_terminal.py +10 -0
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +16 -5
- pyedb/grpc/database/terminal/pingroup_terminal.py +12 -11
- pyedb/grpc/database/terminal/point_terminal.py +4 -3
- pyedb/grpc/database/terminal/terminal.py +9 -9
- pyedb/grpc/database/utility/value.py +109 -0
- pyedb/grpc/database/utility/xml_control_file.py +5 -5
- pyedb/grpc/edb.py +130 -63
- pyedb/grpc/edb_init.py +3 -10
- pyedb/grpc/rpc_session.py +10 -10
- pyedb/libraries/common.py +366 -0
- pyedb/libraries/rf_libraries/base_functions.py +1358 -0
- pyedb/libraries/rf_libraries/planar_antennas.py +628 -0
- pyedb/misc/decorators.py +61 -0
- pyedb/misc/misc.py +0 -13
- pyedb/siwave.py +2 -2
- {pyedb-0.53.0.dist-info → pyedb-0.55.0.dist-info}/METADATA +2 -3
- {pyedb-0.53.0.dist-info → pyedb-0.55.0.dist-info}/RECORD +119 -112
- {pyedb-0.53.0.dist-info → pyedb-0.55.0.dist-info}/WHEEL +0 -0
- {pyedb-0.53.0.dist-info → pyedb-0.55.0.dist-info}/licenses/LICENSE +0 -0
pyedb/generic/settings.py
CHANGED
|
@@ -21,12 +21,24 @@
|
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
|
|
23
23
|
import os
|
|
24
|
+
import re
|
|
25
|
+
import sys
|
|
24
26
|
import time
|
|
27
|
+
import warnings
|
|
25
28
|
|
|
26
29
|
|
|
27
30
|
class Settings(object):
|
|
28
31
|
"""Manages all PyEDB environment variables and global settings."""
|
|
29
32
|
|
|
33
|
+
INSTALLED_VERSIONS = None
|
|
34
|
+
INSTALLED_STUDENT_VERSIONS = None
|
|
35
|
+
INSTALLED_CLIENT_VERSIONS = None
|
|
36
|
+
LATEST_VERSION = None
|
|
37
|
+
LATEST_STUDENT_VERSION = None
|
|
38
|
+
|
|
39
|
+
specified_version = None
|
|
40
|
+
is_student_version = False
|
|
41
|
+
|
|
30
42
|
def __init__(self):
|
|
31
43
|
self.remote_rpc_session = False
|
|
32
44
|
self._enable_screen_logs = True
|
|
@@ -58,26 +70,12 @@ class Settings(object):
|
|
|
58
70
|
self._global_log_file_size = 10
|
|
59
71
|
self._lsf_queue = None
|
|
60
72
|
self._edb_environment_variables = {}
|
|
61
|
-
self.
|
|
62
|
-
self.
|
|
63
|
-
|
|
64
|
-
@property
|
|
65
|
-
def logger(self):
|
|
66
|
-
"""Active logger."""
|
|
67
|
-
return self._logger
|
|
68
|
-
|
|
69
|
-
@logger.setter
|
|
70
|
-
def logger(self, val):
|
|
71
|
-
self._logger = val
|
|
73
|
+
self.logger = None
|
|
74
|
+
self.log_file = None
|
|
75
|
+
self._aedt_version = None
|
|
72
76
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"""Flag that disable Edb log when PyAEDT is used."""
|
|
76
|
-
return self._use_pyaedt_log
|
|
77
|
-
|
|
78
|
-
@use_pyaedt_log.setter
|
|
79
|
-
def use_pyaedt_log(self, value):
|
|
80
|
-
self._use_pyaedt_log = value
|
|
77
|
+
self.__get_version_information()
|
|
78
|
+
self.__init_logger()
|
|
81
79
|
|
|
82
80
|
@property
|
|
83
81
|
def edb_environment_variables(self):
|
|
@@ -261,5 +259,63 @@ class Settings(object):
|
|
|
261
259
|
def retry_n_times_time_interval(self, value):
|
|
262
260
|
self._retry_n_times_time_interval = float(value)
|
|
263
261
|
|
|
262
|
+
def __get_version_information(self):
|
|
263
|
+
"""Get the installed AEDT versions.
|
|
264
|
+
|
|
265
|
+
This method returns a dictionary, with the version as the key and the installation path
|
|
266
|
+
as the value."""
|
|
267
|
+
version_pattern = re.compile(r"^(ANSYSEM_ROOT|ANSYSEM_PY_CLIENT_ROOT|ANSYSEMSV_ROOT)\d{3}$")
|
|
268
|
+
env_list = sorted([x for x in os.environ if version_pattern.match(x)], reverse=True)
|
|
269
|
+
if not env_list: # pragma: no cover
|
|
270
|
+
warnings.warn("No installed versions of AEDT are found in the system environment variables.")
|
|
271
|
+
return
|
|
272
|
+
|
|
273
|
+
aedt_system_env_variables = {i: os.environ[i] for i in env_list}
|
|
274
|
+
|
|
275
|
+
standard_versions = {}
|
|
276
|
+
client_versions = {}
|
|
277
|
+
student_versions = {}
|
|
278
|
+
# version_list is ordered: first normal versions, then client versions, finally student versions
|
|
279
|
+
for var_name, aedt_path in aedt_system_env_variables.items():
|
|
280
|
+
version_id = var_name[-3:]
|
|
281
|
+
version, release = version_id[0:2], version_id[2]
|
|
282
|
+
version_name = f"20{version}.{release}"
|
|
283
|
+
if "ANSYSEM_ROOT" in var_name:
|
|
284
|
+
standard_versions[version_name] = aedt_path
|
|
285
|
+
elif "ANSYSEM_PY_CLIENT_ROOT" in var_name:
|
|
286
|
+
client_versions[version_name] = aedt_path
|
|
287
|
+
else:
|
|
288
|
+
student_versions[version_name] = aedt_path
|
|
289
|
+
self.INSTALLED_VERSIONS = standard_versions
|
|
290
|
+
self.INSTALLED_STUDENT_VERSIONS = student_versions
|
|
291
|
+
self.INSTALLED_CLIENT_VERSIONS = client_versions
|
|
292
|
+
|
|
293
|
+
if len(self.INSTALLED_VERSIONS):
|
|
294
|
+
self.LATEST_VERSION = max(standard_versions.keys(), key=lambda x: tuple(map(int, x.split("."))))
|
|
295
|
+
if len(self.INSTALLED_STUDENT_VERSIONS):
|
|
296
|
+
self.LATEST_STUDENT_VERSION = max(student_versions.keys(), key=lambda x: tuple(map(int, x.split("."))))
|
|
297
|
+
|
|
298
|
+
@property
|
|
299
|
+
def aedt_installation_path(self):
|
|
300
|
+
if self.edb_dll_path:
|
|
301
|
+
return self.edb_dll_path
|
|
302
|
+
elif self.is_student_version:
|
|
303
|
+
return self.INSTALLED_STUDENT_VERSIONS[self.specified_version]
|
|
304
|
+
elif self.specified_version in self.INSTALLED_VERSIONS.keys():
|
|
305
|
+
return self.INSTALLED_VERSIONS[self.specified_version]
|
|
306
|
+
elif os.name == "posix":
|
|
307
|
+
main = sys.modules["__main__"]
|
|
308
|
+
if "oDesktop" in dir(main):
|
|
309
|
+
return main.oDesktop.GetExeDir()
|
|
310
|
+
else:
|
|
311
|
+
raise RuntimeError(f"Version {self.specified_version} is not installed on the system. ")
|
|
312
|
+
else:
|
|
313
|
+
raise RuntimeError(f"Version {self.specified_version} is not installed on the system. ")
|
|
314
|
+
|
|
315
|
+
def __init_logger(self):
|
|
316
|
+
from pyedb.edb_logger import EdbLogger
|
|
317
|
+
|
|
318
|
+
self.logger = EdbLogger(to_stdout=self.enable_screen_logs, settings=self)
|
|
319
|
+
|
|
264
320
|
|
|
265
321
|
settings = Settings()
|
pyedb/grpc/__init__.py
ADDED
|
File without changes
|
|
@@ -39,7 +39,6 @@ from ansys.edb.core.definition.solder_ball_property import (
|
|
|
39
39
|
from ansys.edb.core.hierarchy.component_group import ComponentType as GrpcComponentType
|
|
40
40
|
from ansys.edb.core.hierarchy.spice_model import SPICEModel as GrpcSPICEModel
|
|
41
41
|
from ansys.edb.core.utility.rlc import Rlc as GrpcRlc
|
|
42
|
-
from ansys.edb.core.utility.value import Value as GrpcValue
|
|
43
42
|
|
|
44
43
|
from pyedb.component_libraries.ansys_components import (
|
|
45
44
|
ComponentLib,
|
|
@@ -57,6 +56,8 @@ from pyedb.grpc.database.hierarchy.pin_pair_model import PinPairModel
|
|
|
57
56
|
from pyedb.grpc.database.hierarchy.pingroup import PinGroup
|
|
58
57
|
from pyedb.grpc.database.padstacks import Padstacks
|
|
59
58
|
from pyedb.grpc.database.utility.sources import SourceType
|
|
59
|
+
from pyedb.grpc.database.utility.value import Value
|
|
60
|
+
from pyedb.misc.decorators import deprecate_argument_name
|
|
60
61
|
from pyedb.modeler.geometry_operators import GeometryOperators
|
|
61
62
|
|
|
62
63
|
|
|
@@ -500,6 +501,7 @@ class Components(object):
|
|
|
500
501
|
"""
|
|
501
502
|
return self.instances[name]
|
|
502
503
|
|
|
504
|
+
@deprecate_argument_name({"pinName": "pin_name"})
|
|
503
505
|
def get_pin_from_component(
|
|
504
506
|
self,
|
|
505
507
|
component: Union[str, Component],
|
|
@@ -1098,17 +1100,17 @@ class Components(object):
|
|
|
1098
1100
|
rlc.r_enabled = False
|
|
1099
1101
|
else:
|
|
1100
1102
|
rlc.r_enabled = True
|
|
1101
|
-
rlc.r =
|
|
1103
|
+
rlc.r = Value(r_value)
|
|
1102
1104
|
if l_value is None:
|
|
1103
1105
|
rlc.l_enabled = False
|
|
1104
1106
|
else:
|
|
1105
1107
|
rlc.l_enabled = True
|
|
1106
|
-
rlc.l =
|
|
1108
|
+
rlc.l = Value(l_value)
|
|
1107
1109
|
if c_value is None:
|
|
1108
1110
|
rlc.c_enabled = False
|
|
1109
1111
|
else:
|
|
1110
1112
|
rlc.c_enabled = True
|
|
1111
|
-
rlc.C =
|
|
1113
|
+
rlc.C = Value(c_value)
|
|
1112
1114
|
if rlc.r_enabled and not rlc.c_enabled and not rlc.l_enabled:
|
|
1113
1115
|
new_cmp.component_type = GrpcComponentType.RESISTOR
|
|
1114
1116
|
elif rlc.c_enabled and not rlc.r_enabled and not rlc.l_enabled:
|
|
@@ -1434,12 +1436,12 @@ class Components(object):
|
|
|
1434
1436
|
pin1 = list(cmp.pins.values())[0]
|
|
1435
1437
|
pin_layers = pin1.padstack_def.data.layer_names
|
|
1436
1438
|
pad_params = self._pedb.padstacks.get_pad_parameters(pin=pin1, layername=pin_layers[0], pad_type=0)
|
|
1437
|
-
_sb_diam = min([abs(
|
|
1439
|
+
_sb_diam = min([abs(Value(val)) for val in pad_params[1]])
|
|
1438
1440
|
sball_diam = 0.8 * _sb_diam
|
|
1439
1441
|
if sball_height:
|
|
1440
|
-
sball_height =
|
|
1442
|
+
sball_height = Value(sball_height)
|
|
1441
1443
|
else:
|
|
1442
|
-
sball_height =
|
|
1444
|
+
sball_height = Value(sball_diam)
|
|
1443
1445
|
|
|
1444
1446
|
if not sball_mid_diam:
|
|
1445
1447
|
sball_mid_diam = sball_diam
|
|
@@ -1460,17 +1462,17 @@ class Components(object):
|
|
|
1460
1462
|
cmp_property.die_property = ic_die_prop
|
|
1461
1463
|
|
|
1462
1464
|
solder_ball_prop = cmp_property.solder_ball_property
|
|
1463
|
-
solder_ball_prop.set_diameter(
|
|
1464
|
-
solder_ball_prop.height =
|
|
1465
|
+
solder_ball_prop.set_diameter(Value(sball_diam), Value(sball_mid_diam))
|
|
1466
|
+
solder_ball_prop.height = Value(sball_height)
|
|
1465
1467
|
|
|
1466
1468
|
solder_ball_prop.shape = sball_shape
|
|
1467
1469
|
cmp_property.solder_ball_property = solder_ball_prop
|
|
1468
1470
|
|
|
1469
1471
|
port_prop = cmp_property.port_property
|
|
1470
|
-
port_prop.reference_height =
|
|
1472
|
+
port_prop.reference_height = Value(reference_height)
|
|
1471
1473
|
port_prop.reference_size_auto = auto_reference_size
|
|
1472
1474
|
if not auto_reference_size:
|
|
1473
|
-
port_prop.set_reference_size(
|
|
1475
|
+
port_prop.set_reference_size(Value(reference_size_x), Value(reference_size_y))
|
|
1474
1476
|
cmp_property.port_property = port_prop
|
|
1475
1477
|
cmp.component_property = cmp_property
|
|
1476
1478
|
return True
|
|
@@ -1520,17 +1522,17 @@ class Components(object):
|
|
|
1520
1522
|
rlc.is_parallel = isparallel
|
|
1521
1523
|
if res_value is not None:
|
|
1522
1524
|
rlc.r_enabled = True
|
|
1523
|
-
rlc.r =
|
|
1525
|
+
rlc.r = Value(res_value)
|
|
1524
1526
|
else:
|
|
1525
1527
|
rlc.r_enabled = False
|
|
1526
1528
|
if ind_value is not None:
|
|
1527
1529
|
rlc.l_enabled = True
|
|
1528
|
-
rlc.l =
|
|
1530
|
+
rlc.l = Value(ind_value)
|
|
1529
1531
|
else:
|
|
1530
1532
|
rlc.l_enabled = False
|
|
1531
1533
|
if cap_value is not None:
|
|
1532
1534
|
rlc.c_enabled = True
|
|
1533
|
-
rlc.c =
|
|
1535
|
+
rlc.c = Value(cap_value)
|
|
1534
1536
|
else:
|
|
1535
1537
|
rlc.CEnabled = False
|
|
1536
1538
|
pin_pair = (from_pin.name, to_pin.name)
|
|
@@ -1838,7 +1840,7 @@ class Components(object):
|
|
|
1838
1840
|
transformed_pt_pos = pt_pos
|
|
1839
1841
|
else:
|
|
1840
1842
|
transformed_pt_pos = pin.component.transform.transform_point(pt_pos)
|
|
1841
|
-
return [transformed_pt_pos[0]
|
|
1843
|
+
return [Value(transformed_pt_pos[0]), Value(transformed_pt_pos[1])]
|
|
1842
1844
|
|
|
1843
1845
|
def get_pins_name_from_net(self, net_name: str, pin_list: Optional[List[Any]] = None) -> List[str]:
|
|
1844
1846
|
"""Get pin names from net.
|
|
@@ -2021,8 +2023,8 @@ class Components(object):
|
|
|
2021
2023
|
w = min(pars[0], w)
|
|
2022
2024
|
elif pad.polygon_data: # pragma: no cover
|
|
2023
2025
|
bbox = pad.polygon_data.bbox()
|
|
2024
|
-
lower = [bbox[0].x
|
|
2025
|
-
upper = [bbox[1].x
|
|
2026
|
+
lower = [Value(bbox[0].x), Value(bbox[0].y)]
|
|
2027
|
+
upper = [Value(bbox[1].x), Value(bbox[1].y)]
|
|
2026
2028
|
pars = [abs(lower[0] - upper[0]), abs(lower[1] - upper[1])]
|
|
2027
2029
|
delta_pins.append(max(pars) + min(pars) / 2)
|
|
2028
2030
|
w = min(min(pars), w)
|
|
@@ -2228,6 +2230,42 @@ class Components(object):
|
|
|
2228
2230
|
component=component.refdes, circuit_ports=create_circuit_port, pec_boundary=pec_boundary
|
|
2229
2231
|
)
|
|
2230
2232
|
|
|
2233
|
+
def add_port_on_rlc_component(
|
|
2234
|
+
self, component: Optional[Union[str, Component]] = None, circuit_ports: bool = True, pec_boundary: bool = False
|
|
2235
|
+
) -> bool:
|
|
2236
|
+
"""Deactivate RLC component and replace it with a circuit port.
|
|
2237
|
+
The circuit port supports only two-pin components.
|
|
2238
|
+
|
|
2239
|
+
Parameters
|
|
2240
|
+
----------
|
|
2241
|
+
component : str
|
|
2242
|
+
Reference designator of the RLC component.
|
|
2243
|
+
|
|
2244
|
+
circuit_ports : bool
|
|
2245
|
+
``True`` will replace RLC component by circuit ports, ``False`` gap ports compatible with HFSS 3D modeler
|
|
2246
|
+
export.
|
|
2247
|
+
|
|
2248
|
+
pec_boundary : bool, optional
|
|
2249
|
+
Whether to define the PEC boundary, The default is ``False``. If set to ``True``,
|
|
2250
|
+
a perfect short is created between the pin and impedance is ignored. This
|
|
2251
|
+
parameter is only supported on a port created between two pins, such as
|
|
2252
|
+
when there is no pin group.
|
|
2253
|
+
|
|
2254
|
+
Returns
|
|
2255
|
+
-------
|
|
2256
|
+
bool
|
|
2257
|
+
``True`` when successful, ``False`` when failed.
|
|
2258
|
+
|
|
2259
|
+
Examples
|
|
2260
|
+
--------
|
|
2261
|
+
>>> from pyedb import Edb
|
|
2262
|
+
>>> edb = Edb()
|
|
2263
|
+
>>> edb.source_excitation.add_port_on_rlc_component("R1")
|
|
2264
|
+
"""
|
|
2265
|
+
return self._pedb.source_excitation.add_port_on_rlc_component(
|
|
2266
|
+
component=component, circuit_ports=circuit_ports, pec_boundary=pec_boundary
|
|
2267
|
+
)
|
|
2268
|
+
|
|
2231
2269
|
def replace_rlc_by_gap_boundaries(self, component: Optional[Union[str, Component]] = None) -> bool:
|
|
2232
2270
|
"""Replace RLC component by RLC gap boundaries. These boundary types are compatible with 3D modeler export.
|
|
2233
2271
|
Only 2 pins RLC components are supported in this command.
|
|
@@ -27,8 +27,8 @@ import subprocess
|
|
|
27
27
|
import sys
|
|
28
28
|
from typing import Any, Dict, List, Optional, Union
|
|
29
29
|
|
|
30
|
-
from pyedb.edb_logger import pyedb_logger
|
|
31
30
|
from pyedb.generic.general_methods import ET, env_path, env_value, is_linux
|
|
31
|
+
from pyedb.generic.settings import settings
|
|
32
32
|
from pyedb.misc.aedtlib_personalib_install import write_pretty_xml
|
|
33
33
|
from pyedb.misc.misc import list_installed_ansysem
|
|
34
34
|
|
|
@@ -194,7 +194,7 @@ def convert_technology_file(tech_file, edbversion=None, control_file=None):
|
|
|
194
194
|
base_path = env_path(edbversion)
|
|
195
195
|
sys.path.append(base_path)
|
|
196
196
|
else:
|
|
197
|
-
|
|
197
|
+
settings.logger.error("No EDB installation found. Check environment variables")
|
|
198
198
|
return False
|
|
199
199
|
os.environ["HELIC_ROOT"] = os.path.join(base_path, "helic")
|
|
200
200
|
if os.getenv("ANSYSLMD_LICENCE_FILE", None) is None:
|
|
@@ -207,7 +207,7 @@ def convert_technology_file(tech_file, edbversion=None, control_file=None):
|
|
|
207
207
|
os.environ["ANSYSLMD_LICENSE_FILE"] = line.split("=")[1]
|
|
208
208
|
break
|
|
209
209
|
else:
|
|
210
|
-
|
|
210
|
+
settings.logger.error("ANSYSLMD_LICENSE_FILE is not defined.")
|
|
211
211
|
vlc_file_name = os.path.splitext(tech_file)[0]
|
|
212
212
|
if not control_file:
|
|
213
213
|
control_file = vlc_file_name + ".xml"
|
|
@@ -241,9 +241,9 @@ def convert_technology_file(tech_file, edbversion=None, control_file=None):
|
|
|
241
241
|
p = subprocess.Popen(command, env=my_env)
|
|
242
242
|
p.wait()
|
|
243
243
|
if os.path.exists(control_file):
|
|
244
|
-
|
|
244
|
+
settings.logger.info("XML file created.")
|
|
245
245
|
return control_file
|
|
246
|
-
|
|
246
|
+
settings.logger.error("Technology files are supported only in Linux. Use control file instead.")
|
|
247
247
|
return False
|
|
248
248
|
|
|
249
249
|
|
|
@@ -40,11 +40,11 @@ from ansys.edb.core.definition.material_def import MaterialDef as GrpcMaterialDe
|
|
|
40
40
|
from ansys.edb.core.definition.multipole_debye_model import (
|
|
41
41
|
MultipoleDebyeModel as GrpcMultipoleDebyeModel,
|
|
42
42
|
)
|
|
43
|
-
from ansys.edb.core.utility.value import Value as GrpcValue
|
|
44
43
|
from pydantic import BaseModel, confloat
|
|
45
44
|
|
|
46
45
|
from pyedb import Edb
|
|
47
46
|
from pyedb.exceptions import MaterialModelException
|
|
47
|
+
from pyedb.grpc.database.utility.value import Value
|
|
48
48
|
|
|
49
49
|
logger = logging.getLogger(__name__)
|
|
50
50
|
|
|
@@ -181,8 +181,7 @@ class Material(GrpcMaterialDef):
|
|
|
181
181
|
Conductivity value.
|
|
182
182
|
"""
|
|
183
183
|
try:
|
|
184
|
-
|
|
185
|
-
return value
|
|
184
|
+
return Value(self.get_property(GrpcMaterialProperty.CONDUCTIVITY))
|
|
186
185
|
except:
|
|
187
186
|
return 0.0
|
|
188
187
|
|
|
@@ -195,7 +194,7 @@ class Material(GrpcMaterialDef):
|
|
|
195
194
|
f"Changing conductivity is only allowed when no dielectric model is assigned."
|
|
196
195
|
)
|
|
197
196
|
else:
|
|
198
|
-
self.set_property(GrpcMaterialProperty.CONDUCTIVITY,
|
|
197
|
+
self.set_property(GrpcMaterialProperty.CONDUCTIVITY, Value(value))
|
|
199
198
|
|
|
200
199
|
@property
|
|
201
200
|
def dc_conductivity(self):
|
|
@@ -310,15 +309,14 @@ class Material(GrpcMaterialDef):
|
|
|
310
309
|
|
|
311
310
|
"""
|
|
312
311
|
try:
|
|
313
|
-
|
|
314
|
-
return value
|
|
312
|
+
return Value(self.get_property(GrpcMaterialProperty.PERMITTIVITY))
|
|
315
313
|
except:
|
|
316
314
|
return 0.0
|
|
317
315
|
|
|
318
316
|
@permittivity.setter
|
|
319
317
|
def permittivity(self, value):
|
|
320
318
|
"""Set material permittivity."""
|
|
321
|
-
self.set_property(GrpcMaterialProperty.PERMITTIVITY,
|
|
319
|
+
self.set_property(GrpcMaterialProperty.PERMITTIVITY, Value(value))
|
|
322
320
|
|
|
323
321
|
@property
|
|
324
322
|
def permeability(self) -> float:
|
|
@@ -331,15 +329,14 @@ class Material(GrpcMaterialDef):
|
|
|
331
329
|
|
|
332
330
|
"""
|
|
333
331
|
try:
|
|
334
|
-
|
|
335
|
-
return value
|
|
332
|
+
return Value(self.get_property(GrpcMaterialProperty.PERMEABILITY))
|
|
336
333
|
except:
|
|
337
334
|
return 0.0
|
|
338
335
|
|
|
339
336
|
@permeability.setter
|
|
340
337
|
def permeability(self, value):
|
|
341
338
|
"""Set material permeability."""
|
|
342
|
-
self.set_property(GrpcMaterialProperty.PERMEABILITY,
|
|
339
|
+
self.set_property(GrpcMaterialProperty.PERMEABILITY, Value(value))
|
|
343
340
|
|
|
344
341
|
@property
|
|
345
342
|
def loss_tangent(self):
|
|
@@ -369,7 +366,7 @@ class Material(GrpcMaterialDef):
|
|
|
369
366
|
|
|
370
367
|
"""
|
|
371
368
|
try:
|
|
372
|
-
return self.get_property(GrpcMaterialProperty.DIELECTRIC_LOSS_TANGENT)
|
|
369
|
+
return Value(self.get_property(GrpcMaterialProperty.DIELECTRIC_LOSS_TANGENT))
|
|
373
370
|
except:
|
|
374
371
|
return 0.0
|
|
375
372
|
|
|
@@ -381,12 +378,12 @@ class Material(GrpcMaterialDef):
|
|
|
381
378
|
"Use property dielectric_loss_tangent instead.",
|
|
382
379
|
DeprecationWarning,
|
|
383
380
|
)
|
|
384
|
-
self.dielectric_loss_tangent
|
|
381
|
+
self.dielectric_loss_tangent = value
|
|
385
382
|
|
|
386
383
|
@dielectric_loss_tangent.setter
|
|
387
384
|
def dielectric_loss_tangent(self, value):
|
|
388
385
|
"""Set material loss tangent."""
|
|
389
|
-
self.set_property(GrpcMaterialProperty.DIELECTRIC_LOSS_TANGENT,
|
|
386
|
+
self.set_property(GrpcMaterialProperty.DIELECTRIC_LOSS_TANGENT, Value(value))
|
|
390
387
|
|
|
391
388
|
@property
|
|
392
389
|
def magnetic_loss_tangent(self) -> float:
|
|
@@ -398,15 +395,14 @@ class Material(GrpcMaterialDef):
|
|
|
398
395
|
Magnetic loss tangent value.
|
|
399
396
|
"""
|
|
400
397
|
try:
|
|
401
|
-
|
|
402
|
-
return value
|
|
398
|
+
return Value(self.get_property(GrpcMaterialProperty.MAGNETIC_LOSS_TANGENT))
|
|
403
399
|
except:
|
|
404
400
|
return 0.0
|
|
405
401
|
|
|
406
402
|
@magnetic_loss_tangent.setter
|
|
407
403
|
def magnetic_loss_tangent(self, value):
|
|
408
404
|
"""Set material magnetic loss tangent."""
|
|
409
|
-
self.set_property(GrpcMaterialProperty.MAGNETIC_LOSS_TANGENT,
|
|
405
|
+
self.set_property(GrpcMaterialProperty.MAGNETIC_LOSS_TANGENT, Value(value))
|
|
410
406
|
|
|
411
407
|
@property
|
|
412
408
|
def thermal_conductivity(self) -> float:
|
|
@@ -419,15 +415,14 @@ class Material(GrpcMaterialDef):
|
|
|
419
415
|
|
|
420
416
|
"""
|
|
421
417
|
try:
|
|
422
|
-
|
|
423
|
-
return value
|
|
418
|
+
return Value(self.get_property(GrpcMaterialProperty.THERMAL_CONDUCTIVITY))
|
|
424
419
|
except:
|
|
425
420
|
return 0.0
|
|
426
421
|
|
|
427
422
|
@thermal_conductivity.setter
|
|
428
423
|
def thermal_conductivity(self, value):
|
|
429
424
|
"""Set material thermal conductivity."""
|
|
430
|
-
self.set_property(GrpcMaterialProperty.THERMAL_CONDUCTIVITY,
|
|
425
|
+
self.set_property(GrpcMaterialProperty.THERMAL_CONDUCTIVITY, Value(value))
|
|
431
426
|
|
|
432
427
|
@property
|
|
433
428
|
def mass_density(self) -> float:
|
|
@@ -440,15 +435,14 @@ class Material(GrpcMaterialDef):
|
|
|
440
435
|
|
|
441
436
|
"""
|
|
442
437
|
try:
|
|
443
|
-
|
|
444
|
-
return value
|
|
438
|
+
return Value(self.get_property(GrpcMaterialProperty.MASS_DENSITY))
|
|
445
439
|
except:
|
|
446
440
|
return 0.0
|
|
447
441
|
|
|
448
442
|
@mass_density.setter
|
|
449
443
|
def mass_density(self, value):
|
|
450
444
|
"""Set material mass density."""
|
|
451
|
-
self.set_property(GrpcMaterialProperty.MASS_DENSITY,
|
|
445
|
+
self.set_property(GrpcMaterialProperty.MASS_DENSITY, Value(value))
|
|
452
446
|
|
|
453
447
|
@property
|
|
454
448
|
def youngs_modulus(self) -> float:
|
|
@@ -461,15 +455,14 @@ class Material(GrpcMaterialDef):
|
|
|
461
455
|
|
|
462
456
|
"""
|
|
463
457
|
try:
|
|
464
|
-
|
|
465
|
-
return value
|
|
458
|
+
return Value(self.get_property(GrpcMaterialProperty.YOUNGS_MODULUS))
|
|
466
459
|
except:
|
|
467
460
|
return 0.0
|
|
468
461
|
|
|
469
462
|
@youngs_modulus.setter
|
|
470
463
|
def youngs_modulus(self, value):
|
|
471
464
|
"""Set material young modulus."""
|
|
472
|
-
self.set_property(GrpcMaterialProperty.YOUNGS_MODULUS,
|
|
465
|
+
self.set_property(GrpcMaterialProperty.YOUNGS_MODULUS, Value(value))
|
|
473
466
|
|
|
474
467
|
@property
|
|
475
468
|
def specific_heat(self) -> float:
|
|
@@ -481,14 +474,14 @@ class Material(GrpcMaterialDef):
|
|
|
481
474
|
Material specific heat value.
|
|
482
475
|
"""
|
|
483
476
|
try:
|
|
484
|
-
return self.get_property(GrpcMaterialProperty.SPECIFIC_HEAT)
|
|
477
|
+
return Value(self.get_property(GrpcMaterialProperty.SPECIFIC_HEAT))
|
|
485
478
|
except:
|
|
486
479
|
return 0.0
|
|
487
480
|
|
|
488
481
|
@specific_heat.setter
|
|
489
482
|
def specific_heat(self, value):
|
|
490
483
|
"""Set material specific heat."""
|
|
491
|
-
self.set_property(GrpcMaterialProperty.SPECIFIC_HEAT,
|
|
484
|
+
self.set_property(GrpcMaterialProperty.SPECIFIC_HEAT, Value(value))
|
|
492
485
|
|
|
493
486
|
@property
|
|
494
487
|
def poisson_ratio(self) -> float:
|
|
@@ -500,14 +493,14 @@ class Material(GrpcMaterialDef):
|
|
|
500
493
|
Material poisson ratio value.
|
|
501
494
|
"""
|
|
502
495
|
try:
|
|
503
|
-
return self.get_property(GrpcMaterialProperty.POISSONS_RATIO)
|
|
496
|
+
return Value(self.get_property(GrpcMaterialProperty.POISSONS_RATIO))
|
|
504
497
|
except:
|
|
505
498
|
return 0.0
|
|
506
499
|
|
|
507
500
|
@poisson_ratio.setter
|
|
508
501
|
def poisson_ratio(self, value):
|
|
509
502
|
"""Set material poisson ratio."""
|
|
510
|
-
self.set_property(GrpcMaterialProperty.POISSONS_RATIO,
|
|
503
|
+
self.set_property(GrpcMaterialProperty.POISSONS_RATIO, Value(value))
|
|
511
504
|
|
|
512
505
|
@property
|
|
513
506
|
def thermal_expansion_coefficient(self) -> float:
|
|
@@ -520,14 +513,14 @@ class Material(GrpcMaterialDef):
|
|
|
520
513
|
|
|
521
514
|
"""
|
|
522
515
|
try:
|
|
523
|
-
return self.get_property(GrpcMaterialProperty.THERMAL_EXPANSION_COEFFICIENT)
|
|
516
|
+
return Value(self.get_property(GrpcMaterialProperty.THERMAL_EXPANSION_COEFFICIENT))
|
|
524
517
|
except:
|
|
525
518
|
return 0.0
|
|
526
519
|
|
|
527
520
|
@thermal_expansion_coefficient.setter
|
|
528
521
|
def thermal_expansion_coefficient(self, value):
|
|
529
522
|
"""Set material thermal coefficient."""
|
|
530
|
-
self.set_property(GrpcMaterialProperty.THERMAL_EXPANSION_COEFFICIENT,
|
|
523
|
+
self.set_property(GrpcMaterialProperty.THERMAL_EXPANSION_COEFFICIENT, Value(value))
|
|
531
524
|
|
|
532
525
|
def set_debye_model(self):
|
|
533
526
|
"""Set Debye model on current material."""
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
|
|
23
23
|
from ansys.edb.core.definition.package_def import PackageDef as GrpcPackageDef
|
|
24
24
|
from ansys.edb.core.geometry.polygon_data import PolygonData as GrpcPolygonData
|
|
25
|
-
from ansys.edb.core.utility.value import Value as GrpcValue
|
|
26
25
|
|
|
27
|
-
from pyedb.
|
|
26
|
+
from pyedb.generic.settings import settings
|
|
28
27
|
from pyedb.grpc.database.utility.heat_sink import HeatSink
|
|
29
|
-
from pyedb.
|
|
28
|
+
from pyedb.grpc.database.utility.value import Value
|
|
29
|
+
from pyedb.misc.decorators import deprecated_property
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
class PackageDef(GrpcPackageDef):
|
|
@@ -82,7 +82,7 @@ class PackageDef(GrpcPackageDef):
|
|
|
82
82
|
else:
|
|
83
83
|
bbox = extent_bounding_box
|
|
84
84
|
if bbox is None:
|
|
85
|
-
|
|
85
|
+
settings.logger.warning(
|
|
86
86
|
"Package creation uses bounding box but it cannot be inferred. "
|
|
87
87
|
"Please set argument 'component_part_name' or 'extent_bounding_box'."
|
|
88
88
|
)
|
|
@@ -115,11 +115,11 @@ class PackageDef(GrpcPackageDef):
|
|
|
115
115
|
float
|
|
116
116
|
maximum power value.
|
|
117
117
|
"""
|
|
118
|
-
return super().maximum_power
|
|
118
|
+
return Value(super().maximum_power)
|
|
119
119
|
|
|
120
120
|
@maximum_power.setter
|
|
121
121
|
def maximum_power(self, value):
|
|
122
|
-
super(PackageDef, self.__class__).maximum_power.__set__(self,
|
|
122
|
+
super(PackageDef, self.__class__).maximum_power.__set__(self, Value(value))
|
|
123
123
|
|
|
124
124
|
@property
|
|
125
125
|
def therm_cond(self) -> float:
|
|
@@ -131,11 +131,11 @@ class PackageDef(GrpcPackageDef):
|
|
|
131
131
|
Thermal conductivity value.
|
|
132
132
|
|
|
133
133
|
"""
|
|
134
|
-
return super().thermal_conductivity
|
|
134
|
+
return Value(super().thermal_conductivity)
|
|
135
135
|
|
|
136
136
|
@therm_cond.setter
|
|
137
137
|
def therm_cond(self, value):
|
|
138
|
-
super(PackageDef, self.__class__).thermal_conductivity.__set__(self,
|
|
138
|
+
super(PackageDef, self.__class__).thermal_conductivity.__set__(self, Value(value))
|
|
139
139
|
|
|
140
140
|
@property
|
|
141
141
|
def theta_jb(self) -> float:
|
|
@@ -146,11 +146,11 @@ class PackageDef(GrpcPackageDef):
|
|
|
146
146
|
float
|
|
147
147
|
Theta jb value.
|
|
148
148
|
"""
|
|
149
|
-
return super().theta_jb
|
|
149
|
+
return Value(super().theta_jb)
|
|
150
150
|
|
|
151
151
|
@theta_jb.setter
|
|
152
152
|
def theta_jb(self, value):
|
|
153
|
-
super(PackageDef, self.__class__).theta_jb.__set__(self,
|
|
153
|
+
super(PackageDef, self.__class__).theta_jb.__set__(self, Value(value))
|
|
154
154
|
|
|
155
155
|
@property
|
|
156
156
|
def theta_jc(self) -> float:
|
|
@@ -161,11 +161,11 @@ class PackageDef(GrpcPackageDef):
|
|
|
161
161
|
float
|
|
162
162
|
Theta jc value.
|
|
163
163
|
"""
|
|
164
|
-
return super().theta_jc
|
|
164
|
+
return Value(super().theta_jc)
|
|
165
165
|
|
|
166
166
|
@theta_jc.setter
|
|
167
167
|
def theta_jc(self, value):
|
|
168
|
-
super(PackageDef, self.__class__).theta_jc.__set__(self,
|
|
168
|
+
super(PackageDef, self.__class__).theta_jc.__set__(self, Value(value))
|
|
169
169
|
|
|
170
170
|
@property
|
|
171
171
|
def height(self) -> float:
|
|
@@ -176,11 +176,11 @@ class PackageDef(GrpcPackageDef):
|
|
|
176
176
|
float
|
|
177
177
|
Height value.
|
|
178
178
|
"""
|
|
179
|
-
return super().height
|
|
179
|
+
return Value(super().height)
|
|
180
180
|
|
|
181
181
|
@height.setter
|
|
182
182
|
def height(self, value):
|
|
183
|
-
super(PackageDef, self.__class__).height.__set__(self,
|
|
183
|
+
super(PackageDef, self.__class__).height.__set__(self, Value(value))
|
|
184
184
|
|
|
185
185
|
@property
|
|
186
186
|
def heat_sink(self) -> HeatSink:
|
|
@@ -235,10 +235,10 @@ class PackageDef(GrpcPackageDef):
|
|
|
235
235
|
super(PackageDef, self.__class__).heat_sink.__set__(
|
|
236
236
|
self,
|
|
237
237
|
GrpcHeatSink(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
238
|
+
Value(fin_thickness),
|
|
239
|
+
Value(fin_spacing),
|
|
240
|
+
Value(fin_base_height),
|
|
241
|
+
Value(fin_height),
|
|
242
242
|
fin_orientation,
|
|
243
243
|
),
|
|
244
244
|
)
|