pyedb 0.13.0__py3-none-any.whl → 0.14.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_common.py +0 -5
- pyedb/configuration/cfg_components.py +0 -2
- pyedb/configuration/cfg_operations.py +0 -2
- pyedb/configuration/cfg_package_definition.py +0 -2
- pyedb/configuration/cfg_ports_sources.py +14 -11
- pyedb/configuration/cfg_stackup.py +0 -7
- pyedb/configuration/configuration.py +0 -6
- pyedb/dotnet/application/Variables.py +4 -40
- pyedb/dotnet/edb.py +27 -82
- pyedb/dotnet/edb_core/{edb_data/components_data.py → cell/hierarchy/component.py} +13 -133
- pyedb/dotnet/edb_core/cell/hierarchy/model.py +0 -3
- pyedb/dotnet/edb_core/cell/hierarchy/netlist_model.py +30 -0
- pyedb/dotnet/edb_core/cell/hierarchy/pin_pair_model.py +105 -0
- pyedb/dotnet/edb_core/cell/hierarchy/s_parameter_model.py +34 -0
- pyedb/dotnet/edb_core/cell/hierarchy/spice_model.py +34 -0
- pyedb/dotnet/edb_core/cell/layout.py +137 -0
- pyedb/dotnet/edb_core/cell/layout_obj.py +2 -4
- pyedb/dotnet/edb_core/cell/primitive.py +199 -1
- pyedb/dotnet/edb_core/cell/terminal/bundle_terminal.py +52 -0
- pyedb/dotnet/edb_core/cell/terminal/edge_terminal.py +50 -0
- pyedb/dotnet/edb_core/cell/terminal/padstack_instance_terminal.py +88 -0
- pyedb/dotnet/edb_core/cell/terminal/pingroup_terminal.py +59 -0
- pyedb/dotnet/edb_core/cell/terminal/point_terminal.py +73 -0
- pyedb/dotnet/edb_core/{edb_data/terminals.py → cell/terminal/terminal.py} +33 -242
- pyedb/dotnet/edb_core/components.py +10 -56
- pyedb/dotnet/edb_core/definition/component_def.py +1 -8
- pyedb/dotnet/edb_core/definition/component_model.py +0 -2
- pyedb/dotnet/edb_core/definition/definitions.py +0 -2
- pyedb/dotnet/edb_core/definition/package_def.py +7 -5
- pyedb/dotnet/edb_core/edb_data/control_file.py +0 -3
- pyedb/dotnet/edb_core/edb_data/hfss_extent_info.py +0 -5
- pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py +4 -9
- pyedb/dotnet/edb_core/edb_data/layer_data.py +0 -7
- pyedb/dotnet/edb_core/edb_data/nets_data.py +2 -5
- pyedb/dotnet/edb_core/edb_data/padstacks_data.py +11 -29
- pyedb/dotnet/edb_core/edb_data/ports.py +4 -4
- pyedb/dotnet/edb_core/edb_data/primitives_data.py +3 -26
- pyedb/dotnet/edb_core/edb_data/raptor_x_simulation_setup_data.py +13 -20
- pyedb/dotnet/edb_core/edb_data/simulation_configuration.py +3 -11
- pyedb/dotnet/edb_core/edb_data/sources.py +12 -17
- pyedb/dotnet/edb_core/general.py +1 -6
- pyedb/dotnet/edb_core/geometry/polygon_data.py +0 -3
- pyedb/dotnet/edb_core/hfss.py +1 -33
- pyedb/dotnet/edb_core/layout.py +0 -35
- pyedb/dotnet/edb_core/layout_validation.py +1 -3
- pyedb/dotnet/edb_core/materials.py +1 -22
- pyedb/dotnet/edb_core/net_class.py +0 -8
- pyedb/dotnet/edb_core/nets.py +4 -29
- pyedb/dotnet/edb_core/padstack.py +76 -30
- pyedb/dotnet/edb_core/sim_setup_data/data/adaptive_frequency_data.py +72 -0
- pyedb/dotnet/edb_core/sim_setup_data/data/mesh_operation.py +287 -0
- pyedb/dotnet/edb_core/{edb_data/hfss_simulation_setup_data.py → sim_setup_data/data/settings.py} +174 -878
- pyedb/dotnet/edb_core/sim_setup_data/data/sweep_data.py +509 -0
- pyedb/dotnet/edb_core/sim_setup_data/io/__init__.py +0 -0
- pyedb/dotnet/edb_core/{edb_data/siwave_simulation_setup_data.py → sim_setup_data/io/siwave.py} +0 -341
- pyedb/dotnet/edb_core/siwave.py +5 -33
- pyedb/dotnet/edb_core/stackup.py +4 -51
- pyedb/dotnet/edb_core/utilities/simulation_setup.py +612 -366
- pyedb/generic/data_handlers.py +1 -9
- pyedb/generic/general_methods.py +3 -53
- pyedb/generic/plot.py +1 -2
- pyedb/ipc2581/ecad/cad_data/layer_feature.py +1 -7
- pyedb/ipc2581/ecad/cad_data/package.py +1 -4
- pyedb/ipc2581/ecad/cad_data/path.py +1 -3
- pyedb/ipc2581/ecad/cad_data/polygon.py +1 -6
- pyedb/ipc2581/ecad/cad_data/step.py +1 -10
- pyedb/ipc2581/ipc2581.py +8 -15
- pyedb/modeler/geometry_operators.py +164 -67
- pyedb/siwave.py +1 -16
- {pyedb-0.13.0.dist-info → pyedb-0.14.0.dist-info}/METADATA +2 -2
- {pyedb-0.13.0.dist-info → pyedb-0.14.0.dist-info}/RECORD +75 -61
- /pyedb/dotnet/edb_core/cell/{__init__.py → terminal/__init__.py} +0 -0
- {pyedb-0.13.0.dist-info → pyedb-0.14.0.dist-info}/LICENSE +0 -0
- {pyedb-0.13.0.dist-info → pyedb-0.14.0.dist-info}/WHEEL +0 -0
pyedb/__init__.py
CHANGED
|
@@ -21,15 +21,11 @@
|
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
from pyedb.generic.general_methods import pyedb_function_handler
|
|
25
|
-
|
|
26
|
-
|
|
27
24
|
class CfgBase:
|
|
28
25
|
@property
|
|
29
26
|
def protected_attributes(self):
|
|
30
27
|
return []
|
|
31
28
|
|
|
32
|
-
@pyedb_function_handler
|
|
33
29
|
def get_attributes(self, exclude=None):
|
|
34
30
|
attrs = {i: j for i, j in self.__dict__.items() if i not in self.protected_attributes}
|
|
35
31
|
if exclude is not None:
|
|
@@ -39,7 +35,6 @@ class CfgBase:
|
|
|
39
35
|
attrs = {i: j for i, j in attrs.items() if j is not None}
|
|
40
36
|
return attrs
|
|
41
37
|
|
|
42
|
-
@pyedb_function_handler
|
|
43
38
|
def set_attributes(self, pedb_object):
|
|
44
39
|
attrs = self.get_attributes()
|
|
45
40
|
for attr, value in attrs.items():
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
|
|
23
23
|
from pyedb.configuration.cfg_common import CfgBase
|
|
24
|
-
from pyedb.generic.general_methods import pyedb_function_handler
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
class CfgPortProperties(CfgBase):
|
|
@@ -76,7 +75,6 @@ class CfgComponents:
|
|
|
76
75
|
self._pedb = pedb
|
|
77
76
|
self.components = [CfgComponent(**comp) for comp in data]
|
|
78
77
|
|
|
79
|
-
@pyedb_function_handler
|
|
80
78
|
def apply(self):
|
|
81
79
|
comps_in_db = self._pedb.components
|
|
82
80
|
for comp in self.components:
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
|
|
23
23
|
from pyedb.configuration.cfg_common import CfgBase
|
|
24
|
-
from pyedb.generic.general_methods import pyedb_function_handler
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
class CfgCutout(CfgBase):
|
|
@@ -56,7 +55,6 @@ class CfgOperations(CfgBase):
|
|
|
56
55
|
self._pedb = pedb
|
|
57
56
|
self.op_cutout = CfgCutout(**data["cutout"]) if "cutout" in data else None
|
|
58
57
|
|
|
59
|
-
@pyedb_function_handler
|
|
60
58
|
def apply(self):
|
|
61
59
|
"""Imports operation information from JSON."""
|
|
62
60
|
if self.op_cutout:
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
|
|
23
23
|
from pyedb.configuration.cfg_common import CfgBase
|
|
24
24
|
from pyedb.dotnet.edb_core.definition.package_def import PackageDef
|
|
25
|
-
from pyedb.generic.general_methods import pyedb_function_handler
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
class CfgPackage(CfgBase):
|
|
@@ -104,7 +103,6 @@ class CfgPackageDefinitions:
|
|
|
104
103
|
for _, i in comp_list.items():
|
|
105
104
|
i.package_def = pkg.name
|
|
106
105
|
|
|
107
|
-
@pyedb_function_handler
|
|
108
106
|
def get_data_from_db(self):
|
|
109
107
|
package_definitions = []
|
|
110
108
|
|
|
@@ -20,8 +20,6 @@
|
|
|
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 pyedb.generic.general_methods import pyedb_function_handler
|
|
24
|
-
|
|
25
23
|
|
|
26
24
|
class CfgCircuitElement:
|
|
27
25
|
@property
|
|
@@ -29,7 +27,6 @@ class CfgCircuitElement:
|
|
|
29
27
|
"""Edb."""
|
|
30
28
|
return self._pdata._pedb
|
|
31
29
|
|
|
32
|
-
@pyedb_function_handler
|
|
33
30
|
def __init__(self, pdata, **kwargs):
|
|
34
31
|
self._pdata = pdata
|
|
35
32
|
self._data = kwargs
|
|
@@ -40,17 +37,22 @@ class CfgCircuitElement:
|
|
|
40
37
|
self.pos_term_info = kwargs.get("positive_terminal", None) # {"pin" : "A1"}
|
|
41
38
|
self.neg_term_info = kwargs.get("negative_terminal", None)
|
|
42
39
|
|
|
43
|
-
@pyedb_function_handler
|
|
44
40
|
def _create_terminals(self):
|
|
45
41
|
"""Create step 1. Collect positive and negative terminals."""
|
|
46
42
|
pos_term_info = self.pos_term_info
|
|
47
43
|
if pos_term_info:
|
|
48
44
|
pos_type, pos_value = [[i, j] for i, j in pos_term_info.items()][0]
|
|
49
45
|
pos_objs = dict()
|
|
46
|
+
pos_coor_terminal = dict()
|
|
50
47
|
if self.type == "coax":
|
|
51
48
|
pins = self._get_pins(pos_type, pos_value)
|
|
52
49
|
pins = {f"{self.name}_{self.reference_designator}": i for _, i in pins.items()}
|
|
53
50
|
pos_objs.update(pins)
|
|
51
|
+
elif pos_type == "coordinates":
|
|
52
|
+
layer = pos_value["layer"]
|
|
53
|
+
point = pos_value["point"]
|
|
54
|
+
net_name = pos_value["net"]
|
|
55
|
+
pos_coor_terminal[self.name] = self.pedb.get_point_terminal(self.name, net_name, point, layer)
|
|
54
56
|
elif pos_type == "pin_group":
|
|
55
57
|
pos_objs[pos_value] = self.pedb.siwave.pin_groups[pos_value]
|
|
56
58
|
elif not self.distributed:
|
|
@@ -66,12 +68,19 @@ class CfgCircuitElement:
|
|
|
66
68
|
self._elem_num = len(pos_objs)
|
|
67
69
|
|
|
68
70
|
self.pos_terminals = {i: j.create_terminal(i) for i, j in pos_objs.items()}
|
|
71
|
+
self.pos_terminals.update(pos_coor_terminal)
|
|
69
72
|
|
|
70
73
|
neg_term_info = self.neg_term_info
|
|
71
74
|
self.neg_terminal = None
|
|
72
75
|
if neg_term_info:
|
|
73
76
|
neg_type, neg_value = [[i, j] for i, j in neg_term_info.items()][0]
|
|
74
|
-
|
|
77
|
+
|
|
78
|
+
if neg_type == "coordinates":
|
|
79
|
+
layer = neg_value["layer"]
|
|
80
|
+
point = neg_value["point"]
|
|
81
|
+
net_name = neg_value["net"]
|
|
82
|
+
self.neg_terminal = self.pedb.get_point_terminal(self.name + "_ref", net_name, point, layer)
|
|
83
|
+
elif neg_type == "nearest_pin":
|
|
75
84
|
ref_net = neg_value.get("reference_net", "GND")
|
|
76
85
|
search_radius = neg_value.get("search_radius", "5e-3")
|
|
77
86
|
temp = dict()
|
|
@@ -92,7 +101,6 @@ class CfgCircuitElement:
|
|
|
92
101
|
j.create_terminal(i) if not j.terminal else j.terminal for i, j in pin_group.items()
|
|
93
102
|
][0]
|
|
94
103
|
|
|
95
|
-
@pyedb_function_handler
|
|
96
104
|
def _get_pins(self, terminal_type, terminal_value):
|
|
97
105
|
terminal_value = terminal_value if isinstance(terminal_value, list) else [terminal_value]
|
|
98
106
|
|
|
@@ -112,7 +120,6 @@ class CfgCircuitElement:
|
|
|
112
120
|
pins.update({f"{self.reference_designator}_{terminal_value[0]}_{i}": j for i, j in temp.items()})
|
|
113
121
|
return pins
|
|
114
122
|
|
|
115
|
-
@pyedb_function_handler
|
|
116
123
|
def _create_pin_group(self, pins, is_ref=False):
|
|
117
124
|
if is_ref:
|
|
118
125
|
pg_name = f"pg_{self.name}_{self.reference_designator}_ref"
|
|
@@ -128,11 +135,9 @@ class CfgPort(CfgCircuitElement):
|
|
|
128
135
|
|
|
129
136
|
CFG_PORT_TYPE = {"circuit": [str], "coax": [str]}
|
|
130
137
|
|
|
131
|
-
@pyedb_function_handler
|
|
132
138
|
def __init__(self, pdata, **kwargs):
|
|
133
139
|
super().__init__(pdata, **kwargs)
|
|
134
140
|
|
|
135
|
-
@pyedb_function_handler
|
|
136
141
|
def create(self):
|
|
137
142
|
"""Create port."""
|
|
138
143
|
self._create_terminals()
|
|
@@ -152,13 +157,11 @@ class CfgPort(CfgCircuitElement):
|
|
|
152
157
|
class CfgSources(CfgCircuitElement):
|
|
153
158
|
CFG_SOURCE_TYPE = {"current": [int, float], "voltage": [int, float]}
|
|
154
159
|
|
|
155
|
-
@pyedb_function_handler
|
|
156
160
|
def __init__(self, pdata, **kwargs):
|
|
157
161
|
super().__init__(pdata, **kwargs)
|
|
158
162
|
|
|
159
163
|
self.magnitude = kwargs.get("magnitude", 0.001)
|
|
160
164
|
|
|
161
|
-
@pyedb_function_handler
|
|
162
165
|
def create(self):
|
|
163
166
|
"""Create sources."""
|
|
164
167
|
self._create_terminals()
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
|
|
23
23
|
from pyedb.configuration.cfg_common import CfgBase
|
|
24
|
-
from pyedb.generic.general_methods import pyedb_function_handler
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
class CfgMaterial(CfgBase):
|
|
@@ -54,7 +53,6 @@ class CfgStackup:
|
|
|
54
53
|
self.materials = [CfgMaterial(**mat) for mat in data.get("materials", [])]
|
|
55
54
|
self.layers = [CfgLayer(**lay) for lay in data.get("layers", [])]
|
|
56
55
|
|
|
57
|
-
@pyedb_function_handler
|
|
58
56
|
def apply(self):
|
|
59
57
|
"""Apply configuration settings to the current design"""
|
|
60
58
|
if len(self.materials):
|
|
@@ -77,7 +75,6 @@ class CfgStackup:
|
|
|
77
75
|
attrs = l_attrs.get_attributes()
|
|
78
76
|
self._pedb.stackup.add_layer_bottom(**attrs)
|
|
79
77
|
|
|
80
|
-
@pyedb_function_handler
|
|
81
78
|
def __apply_layers(self):
|
|
82
79
|
"""Apply layer settings to the current design"""
|
|
83
80
|
layers = list()
|
|
@@ -120,7 +117,6 @@ class CfgStackup:
|
|
|
120
117
|
elif l.type == "signal":
|
|
121
118
|
prev_layer_clone = self._pedb.stackup.layers[l.name]
|
|
122
119
|
|
|
123
|
-
@pyedb_function_handler
|
|
124
120
|
def __apply_materials(self):
|
|
125
121
|
"""Apply material settings to the current design"""
|
|
126
122
|
materials_in_db = {i.lower(): i for i, _ in self._pedb.materials.materials.items()}
|
|
@@ -131,7 +127,6 @@ class CfgStackup:
|
|
|
131
127
|
attrs = mat_in_cfg.get_attributes()
|
|
132
128
|
mat = self._pedb.materials.add_material(**attrs)
|
|
133
129
|
|
|
134
|
-
@pyedb_function_handler
|
|
135
130
|
def __get_materials_from_db(self):
|
|
136
131
|
materials = []
|
|
137
132
|
for name, p in self._pedb.materials.materials.items():
|
|
@@ -141,7 +136,6 @@ class CfgStackup:
|
|
|
141
136
|
materials.append(mat)
|
|
142
137
|
return materials
|
|
143
138
|
|
|
144
|
-
@pyedb_function_handler
|
|
145
139
|
def __get_layers_from_db(self):
|
|
146
140
|
layers = []
|
|
147
141
|
for name, obj in self._pedb.stackup.all_layers.items():
|
|
@@ -153,7 +147,6 @@ class CfgStackup:
|
|
|
153
147
|
layers.append(layer)
|
|
154
148
|
return layers
|
|
155
149
|
|
|
156
|
-
@pyedb_function_handler
|
|
157
150
|
def get_data_from_db(self):
|
|
158
151
|
"""Get configuration data from layout.
|
|
159
152
|
|
|
@@ -28,7 +28,6 @@ import toml
|
|
|
28
28
|
|
|
29
29
|
from pyedb.configuration.cfg_data import CfgData
|
|
30
30
|
from pyedb.dotnet.edb_core.definition.package_def import PackageDef
|
|
31
|
-
from pyedb.generic.general_methods import pyedb_function_handler
|
|
32
31
|
|
|
33
32
|
|
|
34
33
|
class Configuration:
|
|
@@ -42,7 +41,6 @@ class Configuration:
|
|
|
42
41
|
self._spice_model_library = ""
|
|
43
42
|
self.cfg_data = CfgData(self._pedb)
|
|
44
43
|
|
|
45
|
-
@pyedb_function_handler
|
|
46
44
|
def load(self, config_file, append=True, apply_file=False, output_file=None, open_at_the_end=True):
|
|
47
45
|
"""Import configuration settings from a configure file.
|
|
48
46
|
|
|
@@ -103,7 +101,6 @@ class Configuration:
|
|
|
103
101
|
self._pedb.open_edb()
|
|
104
102
|
return self.cfg_data
|
|
105
103
|
|
|
106
|
-
@pyedb_function_handler()
|
|
107
104
|
def run(self):
|
|
108
105
|
"""Apply configuration settings to the current design"""
|
|
109
106
|
|
|
@@ -157,7 +154,6 @@ class Configuration:
|
|
|
157
154
|
|
|
158
155
|
return True
|
|
159
156
|
|
|
160
|
-
@pyedb_function_handler
|
|
161
157
|
def _load_stackup(self):
|
|
162
158
|
"""Imports stackup information from json."""
|
|
163
159
|
data = self.data["stackup"]
|
|
@@ -214,7 +210,6 @@ class Configuration:
|
|
|
214
210
|
elif l["type"] == "signal":
|
|
215
211
|
prev_layer_clone = self._pedb.stackup.layers[l["name"]]
|
|
216
212
|
|
|
217
|
-
@pyedb_function_handler
|
|
218
213
|
def _load_package_def(self):
|
|
219
214
|
"""Imports package definition information from JSON."""
|
|
220
215
|
comps = self._pedb.components.components
|
|
@@ -277,7 +272,6 @@ class Configuration:
|
|
|
277
272
|
|
|
278
273
|
return data
|
|
279
274
|
|
|
280
|
-
@pyedb_function_handler
|
|
281
275
|
def export(self, file_path, stackup=True, package_definitions=True):
|
|
282
276
|
"""Export the configuration data from layout to a file.
|
|
283
277
|
|
|
@@ -54,7 +54,6 @@ from pyedb.generic.general_methods import (
|
|
|
54
54
|
is_array,
|
|
55
55
|
is_number,
|
|
56
56
|
open_file,
|
|
57
|
-
pyedb_function_handler,
|
|
58
57
|
)
|
|
59
58
|
|
|
60
59
|
|
|
@@ -173,7 +172,6 @@ class CSVDataset:
|
|
|
173
172
|
|
|
174
173
|
pass
|
|
175
174
|
|
|
176
|
-
@pyedb_function_handler()
|
|
177
175
|
def __getitem__(self, item): # pragma: no cover
|
|
178
176
|
variable_list = item.split(",")
|
|
179
177
|
data_out = CSVDataset()
|
|
@@ -188,7 +186,6 @@ class CSVDataset:
|
|
|
188
186
|
data_out._header.append(variable)
|
|
189
187
|
return data_out
|
|
190
188
|
|
|
191
|
-
@pyedb_function_handler()
|
|
192
189
|
def __add__(self, other): # pragma: no cover
|
|
193
190
|
assert self.number_of_columns == other.number_of_columns, "Inconsistent number of columns"
|
|
194
191
|
# Create a new object to return, avoiding changing the original inputs
|
|
@@ -258,7 +255,6 @@ class CSVDataset:
|
|
|
258
255
|
return self.__next__()
|
|
259
256
|
|
|
260
257
|
|
|
261
|
-
@pyedb_function_handler()
|
|
262
258
|
def _find_units_in_dependent_variables(variable_value, full_variables={}): # pragma: no cover
|
|
263
259
|
m2 = re.findall(r"[0-9.]+ *([a-z_A-Z]+)", variable_value)
|
|
264
260
|
if len(m2) > 0:
|
|
@@ -277,7 +273,6 @@ def _find_units_in_dependent_variables(variable_value, full_variables={}): # pr
|
|
|
277
273
|
return ""
|
|
278
274
|
|
|
279
275
|
|
|
280
|
-
@pyedb_function_handler()
|
|
281
276
|
def decompose_variable_value(variable_value, full_variables={}): # pragma: no cover
|
|
282
277
|
"""Decompose a variable value.
|
|
283
278
|
|
|
@@ -320,7 +315,6 @@ def decompose_variable_value(variable_value, full_variables={}): # pragma: no c
|
|
|
320
315
|
return float_value, units
|
|
321
316
|
|
|
322
317
|
|
|
323
|
-
@pyedb_function_handler()
|
|
324
318
|
def _generate_property_validation_errors(property_name, expected, actual): # pragma: no cover
|
|
325
319
|
expected_value, expected_unit = decompose_variable_value(expected)
|
|
326
320
|
actual_value, actual_unit = decompose_variable_value(actual)
|
|
@@ -335,7 +329,6 @@ def _generate_property_validation_errors(property_name, expected, actual): # pr
|
|
|
335
329
|
yield "Error {0}: Expected {1}, got {2}".format(property_name, expected, actual)
|
|
336
330
|
|
|
337
331
|
|
|
338
|
-
@pyedb_function_handler()
|
|
339
332
|
def generate_validation_errors(property_names, expected_settings, actual_settings): # pragma: no cover
|
|
340
333
|
"""From the given property names, expected settings and actual settings, return a list of validation errors.
|
|
341
334
|
If no errors are found, an empty list is returned. The validation of values such as "10mm"
|
|
@@ -481,7 +474,6 @@ class VariableManager(object):
|
|
|
481
474
|
"""
|
|
482
475
|
return self._variable_dict([self._odesign, self._oproject])
|
|
483
476
|
|
|
484
|
-
@pyedb_function_handler()
|
|
485
477
|
def decompose(self, variable_value): # pragma: no cover
|
|
486
478
|
"""Decompose a variable string to a floating with its unit.
|
|
487
479
|
|
|
@@ -833,21 +825,17 @@ class VariableManager(object):
|
|
|
833
825
|
all.update(self._dependent_variables)
|
|
834
826
|
return all
|
|
835
827
|
|
|
836
|
-
@pyedb_function_handler()
|
|
837
828
|
def __delitem__(self, key): # pragma: no cover
|
|
838
829
|
"""Implement del with array name or index."""
|
|
839
830
|
self.delete_variable(key)
|
|
840
831
|
|
|
841
|
-
@pyedb_function_handler()
|
|
842
832
|
def __getitem__(self, variable_name): # pragma: no cover
|
|
843
833
|
return self.variables[variable_name]
|
|
844
834
|
|
|
845
|
-
@pyedb_function_handler()
|
|
846
835
|
def __setitem__(self, variable, value): # pragma: no cover
|
|
847
836
|
self.set_variable(variable, value)
|
|
848
837
|
return True
|
|
849
838
|
|
|
850
|
-
@pyedb_function_handler()
|
|
851
839
|
def _cleanup_variables(self): # pragma: no cover
|
|
852
840
|
variables = self._get_var_list_from_aedt(self._app.odesign) + self._get_var_list_from_aedt(self._app.oproject)
|
|
853
841
|
all_dicts = [
|
|
@@ -861,7 +849,6 @@ class VariableManager(object):
|
|
|
861
849
|
if var_name not in variables:
|
|
862
850
|
del dict_var[var_name]
|
|
863
851
|
|
|
864
|
-
@pyedb_function_handler()
|
|
865
852
|
def _variable_dict(self, object_list, dependent=True, independent=True): # pragma: no cover
|
|
866
853
|
"""Retrieve the variable dictionary.
|
|
867
854
|
|
|
@@ -917,7 +904,7 @@ class VariableManager(object):
|
|
|
917
904
|
return vars_to_output
|
|
918
905
|
|
|
919
906
|
# TODO: Should be renamed to "evaluate"
|
|
920
|
-
|
|
907
|
+
|
|
921
908
|
def get_expression(self, variable_name): # pragma: no cover
|
|
922
909
|
"""Retrieve the variable value of a project or design variable as a string.
|
|
923
910
|
|
|
@@ -936,7 +923,6 @@ class VariableManager(object):
|
|
|
936
923
|
else:
|
|
937
924
|
return False
|
|
938
925
|
|
|
939
|
-
@pyedb_function_handler()
|
|
940
926
|
def aedt_object(self, variable): # pragma: no cover
|
|
941
927
|
"""Retrieve an AEDT object.
|
|
942
928
|
|
|
@@ -951,7 +937,6 @@ class VariableManager(object):
|
|
|
951
937
|
else:
|
|
952
938
|
return self._odesign
|
|
953
939
|
|
|
954
|
-
@pyedb_function_handler()
|
|
955
940
|
def set_variable(
|
|
956
941
|
self,
|
|
957
942
|
variable_name,
|
|
@@ -1180,7 +1165,6 @@ class VariableManager(object):
|
|
|
1180
1165
|
return False
|
|
1181
1166
|
return True
|
|
1182
1167
|
|
|
1183
|
-
@pyedb_function_handler()
|
|
1184
1168
|
def delete_separator(self, separator_name): # pragma: no cover
|
|
1185
1169
|
"""Delete a separator from either the active project or design.
|
|
1186
1170
|
|
|
@@ -1221,7 +1205,6 @@ class VariableManager(object):
|
|
|
1221
1205
|
pass
|
|
1222
1206
|
return False
|
|
1223
1207
|
|
|
1224
|
-
@pyedb_function_handler()
|
|
1225
1208
|
def delete_variable(self, var_name): # pragma: no cover
|
|
1226
1209
|
"""Delete a variable.
|
|
1227
1210
|
|
|
@@ -1265,7 +1248,6 @@ class VariableManager(object):
|
|
|
1265
1248
|
return True
|
|
1266
1249
|
return False
|
|
1267
1250
|
|
|
1268
|
-
@pyedb_function_handler()
|
|
1269
1251
|
def _get_var_list_from_aedt(self, desktop_object): # pragma: no cover
|
|
1270
1252
|
var_list = []
|
|
1271
1253
|
if self._app._is_object_oriented_enabled() and self._app.design_type != "Maxwell Circuit":
|
|
@@ -1384,7 +1366,6 @@ class Variable(object):
|
|
|
1384
1366
|
return self._app._odesign
|
|
1385
1367
|
return None
|
|
1386
1368
|
|
|
1387
|
-
@pyedb_function_handler()
|
|
1388
1369
|
def _update_var(self): # pragma: no cover
|
|
1389
1370
|
if self._app:
|
|
1390
1371
|
return self._app.variable_manager.set_variable(
|
|
@@ -1398,7 +1379,6 @@ class Variable(object):
|
|
|
1398
1379
|
)
|
|
1399
1380
|
return False
|
|
1400
1381
|
|
|
1401
|
-
@pyedb_function_handler()
|
|
1402
1382
|
def _set_prop_val(self, prop, val, n_times=10): # pragma: no cover
|
|
1403
1383
|
if self._app.design_type == "Maxwell Circuit":
|
|
1404
1384
|
return
|
|
@@ -1430,7 +1410,6 @@ class Variable(object):
|
|
|
1430
1410
|
except:
|
|
1431
1411
|
pass
|
|
1432
1412
|
|
|
1433
|
-
@pyedb_function_handler()
|
|
1434
1413
|
def _get_prop_val(self, prop): # pragma: no cover
|
|
1435
1414
|
if self._app.design_type == "Maxwell Circuit":
|
|
1436
1415
|
return
|
|
@@ -1712,7 +1691,6 @@ class Variable(object):
|
|
|
1712
1691
|
"""
|
|
1713
1692
|
return ("{}{}").format(self.numeric_value, self._units)
|
|
1714
1693
|
|
|
1715
|
-
@pyedb_function_handler()
|
|
1716
1694
|
def decompose(self): # pragma: no cover
|
|
1717
1695
|
"""Decompose a variable value to a floating with its unit.
|
|
1718
1696
|
|
|
@@ -1731,7 +1709,6 @@ class Variable(object):
|
|
|
1731
1709
|
"""
|
|
1732
1710
|
return decompose_variable_value(self.evaluated_value)
|
|
1733
1711
|
|
|
1734
|
-
@pyedb_function_handler()
|
|
1735
1712
|
def rescale_to(self, units): # pragma: no cover
|
|
1736
1713
|
"""Rescale the expression to a new unit within the current unit system.
|
|
1737
1714
|
|
|
@@ -1759,7 +1736,6 @@ class Variable(object):
|
|
|
1759
1736
|
self._units = units
|
|
1760
1737
|
return self
|
|
1761
1738
|
|
|
1762
|
-
@pyedb_function_handler()
|
|
1763
1739
|
def format(self, format): # pragma: no cover
|
|
1764
1740
|
"""Retrieve the string value with the specified numerical formatting.
|
|
1765
1741
|
|
|
@@ -1786,7 +1762,6 @@ class Variable(object):
|
|
|
1786
1762
|
"""
|
|
1787
1763
|
return ("{0:" + format + "}{1}").format(self.numeric_value, self._units)
|
|
1788
1764
|
|
|
1789
|
-
@pyedb_function_handler()
|
|
1790
1765
|
def __mul__(self, other): # pragma: no cover
|
|
1791
1766
|
"""Multiply the variable with a number or another variable and return a new object.
|
|
1792
1767
|
|
|
@@ -1845,7 +1820,6 @@ class Variable(object):
|
|
|
1845
1820
|
|
|
1846
1821
|
__rmul__ = __mul__
|
|
1847
1822
|
|
|
1848
|
-
@pyedb_function_handler()
|
|
1849
1823
|
def __add__(self, other): # pragma: no cover
|
|
1850
1824
|
"""Add the variable to another variable to return a new object.
|
|
1851
1825
|
|
|
@@ -1886,7 +1860,6 @@ class Variable(object):
|
|
|
1886
1860
|
|
|
1887
1861
|
return result_variable
|
|
1888
1862
|
|
|
1889
|
-
@pyedb_function_handler()
|
|
1890
1863
|
def __sub__(self, other): # pragma: no cover
|
|
1891
1864
|
"""Subtract another variable from the variable to return a new object.
|
|
1892
1865
|
|
|
@@ -1929,7 +1902,7 @@ class Variable(object):
|
|
|
1929
1902
|
return result_variable
|
|
1930
1903
|
|
|
1931
1904
|
# Python 3.x version
|
|
1932
|
-
|
|
1905
|
+
|
|
1933
1906
|
def __truediv__(self, other): # pragma: no cover
|
|
1934
1907
|
"""Divide the variable by a number or another variable to return a new object.
|
|
1935
1908
|
|
|
@@ -1969,11 +1942,10 @@ class Variable(object):
|
|
|
1969
1942
|
return Variable("{}{}".format(result_value, result_units))
|
|
1970
1943
|
|
|
1971
1944
|
# Python 2.7 version
|
|
1972
|
-
|
|
1945
|
+
|
|
1973
1946
|
def __div__(self, other): # pragma: no cover
|
|
1974
1947
|
return self.__truediv__(other)
|
|
1975
1948
|
|
|
1976
|
-
@pyedb_function_handler()
|
|
1977
1949
|
def __rtruediv__(self, other): # pragma: no cover
|
|
1978
1950
|
"""Divide another object by this object.
|
|
1979
1951
|
|
|
@@ -2012,7 +1984,7 @@ class Variable(object):
|
|
|
2012
1984
|
return Variable("{}{}".format(result_value, result_units))
|
|
2013
1985
|
|
|
2014
1986
|
# # Python 2.7 version
|
|
2015
|
-
#
|
|
1987
|
+
#
|
|
2016
1988
|
# def __div__(self, other):
|
|
2017
1989
|
# return self.__rtruediv__(other)
|
|
2018
1990
|
|
|
@@ -2056,7 +2028,6 @@ class DataSet(object):
|
|
|
2056
2028
|
self.zunit = zunit
|
|
2057
2029
|
self.vunit = vunit
|
|
2058
2030
|
|
|
2059
|
-
@pyedb_function_handler()
|
|
2060
2031
|
def _args(self): # pragma: no cover
|
|
2061
2032
|
"""Retrieve arguments."""
|
|
2062
2033
|
arg = []
|
|
@@ -2096,7 +2067,6 @@ class DataSet(object):
|
|
|
2096
2067
|
arg.append(arg2)
|
|
2097
2068
|
return arg
|
|
2098
2069
|
|
|
2099
|
-
@pyedb_function_handler()
|
|
2100
2070
|
def create(self): # pragma: no cover
|
|
2101
2071
|
"""Create a dataset.
|
|
2102
2072
|
|
|
@@ -2117,7 +2087,6 @@ class DataSet(object):
|
|
|
2117
2087
|
self._app._odesign.AddDataset(self._args())
|
|
2118
2088
|
return True
|
|
2119
2089
|
|
|
2120
|
-
@pyedb_function_handler()
|
|
2121
2090
|
def add_point(self, x, y, z=None, v=None): # pragma: no cover
|
|
2122
2091
|
"""Add a point to the dataset.
|
|
2123
2092
|
|
|
@@ -2151,7 +2120,6 @@ class DataSet(object):
|
|
|
2151
2120
|
|
|
2152
2121
|
return self.update()
|
|
2153
2122
|
|
|
2154
|
-
@pyedb_function_handler()
|
|
2155
2123
|
def remove_point_from_x(self, x): # pragma: no cover
|
|
2156
2124
|
"""Remove a point from an X-axis value.
|
|
2157
2125
|
|
|
@@ -2176,7 +2144,6 @@ class DataSet(object):
|
|
|
2176
2144
|
id_to_remove = self.x.index(x)
|
|
2177
2145
|
return self.remove_point_from_index(id_to_remove)
|
|
2178
2146
|
|
|
2179
|
-
@pyedb_function_handler()
|
|
2180
2147
|
def remove_point_from_index(self, id_to_remove): # pragma: no cover
|
|
2181
2148
|
"""Remove a point from an index.
|
|
2182
2149
|
|
|
@@ -2206,7 +2173,6 @@ class DataSet(object):
|
|
|
2206
2173
|
self._app.logger.error("cannot Remove {} index.".format(id_to_remove))
|
|
2207
2174
|
return False
|
|
2208
2175
|
|
|
2209
|
-
@pyedb_function_handler()
|
|
2210
2176
|
def update(self): # pragma: no cover
|
|
2211
2177
|
"""Update the dataset.
|
|
2212
2178
|
|
|
@@ -2230,7 +2196,6 @@ class DataSet(object):
|
|
|
2230
2196
|
self._app._odesign.EditDataset(self.name, self._args())
|
|
2231
2197
|
return True
|
|
2232
2198
|
|
|
2233
|
-
@pyedb_function_handler()
|
|
2234
2199
|
def delete(self): # pragma: no cover
|
|
2235
2200
|
"""Delete the dataset.
|
|
2236
2201
|
|
|
@@ -2253,7 +2218,6 @@ class DataSet(object):
|
|
|
2253
2218
|
del self._app.project_datasets[self.name]
|
|
2254
2219
|
return True
|
|
2255
2220
|
|
|
2256
|
-
@pyedb_function_handler()
|
|
2257
2221
|
def export(self, dataset_path=None): # pragma: no cover
|
|
2258
2222
|
"""Export the dataset.
|
|
2259
2223
|
|