pyedb 0.2.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.

Files changed (128) hide show
  1. pyedb/__init__.py +17 -0
  2. pyedb/dotnet/__init__.py +0 -0
  3. pyedb/dotnet/application/Variables.py +2261 -0
  4. pyedb/dotnet/application/__init__.py +0 -0
  5. pyedb/dotnet/clr_module.py +103 -0
  6. pyedb/dotnet/edb.py +4237 -0
  7. pyedb/dotnet/edb_core/__init__.py +1 -0
  8. pyedb/dotnet/edb_core/cell/__init__.py +0 -0
  9. pyedb/dotnet/edb_core/cell/hierarchy/__init__.py +0 -0
  10. pyedb/dotnet/edb_core/cell/hierarchy/model.py +66 -0
  11. pyedb/dotnet/edb_core/components.py +2669 -0
  12. pyedb/dotnet/edb_core/configuration.py +423 -0
  13. pyedb/dotnet/edb_core/definition/__init__.py +0 -0
  14. pyedb/dotnet/edb_core/definition/component_def.py +166 -0
  15. pyedb/dotnet/edb_core/definition/component_model.py +30 -0
  16. pyedb/dotnet/edb_core/definition/definition_obj.py +18 -0
  17. pyedb/dotnet/edb_core/definition/definitions.py +12 -0
  18. pyedb/dotnet/edb_core/dotnet/__init__.py +0 -0
  19. pyedb/dotnet/edb_core/dotnet/database.py +1218 -0
  20. pyedb/dotnet/edb_core/dotnet/layout.py +238 -0
  21. pyedb/dotnet/edb_core/dotnet/primitive.py +1517 -0
  22. pyedb/dotnet/edb_core/edb_data/__init__.py +0 -0
  23. pyedb/dotnet/edb_core/edb_data/components_data.py +938 -0
  24. pyedb/dotnet/edb_core/edb_data/connectable.py +113 -0
  25. pyedb/dotnet/edb_core/edb_data/control_file.py +1268 -0
  26. pyedb/dotnet/edb_core/edb_data/design_options.py +35 -0
  27. pyedb/dotnet/edb_core/edb_data/edbvalue.py +45 -0
  28. pyedb/dotnet/edb_core/edb_data/hfss_extent_info.py +330 -0
  29. pyedb/dotnet/edb_core/edb_data/hfss_simulation_setup_data.py +1607 -0
  30. pyedb/dotnet/edb_core/edb_data/layer_data.py +576 -0
  31. pyedb/dotnet/edb_core/edb_data/nets_data.py +281 -0
  32. pyedb/dotnet/edb_core/edb_data/obj_base.py +19 -0
  33. pyedb/dotnet/edb_core/edb_data/padstacks_data.py +2080 -0
  34. pyedb/dotnet/edb_core/edb_data/ports.py +287 -0
  35. pyedb/dotnet/edb_core/edb_data/primitives_data.py +1397 -0
  36. pyedb/dotnet/edb_core/edb_data/simulation_configuration.py +2914 -0
  37. pyedb/dotnet/edb_core/edb_data/simulation_setup.py +716 -0
  38. pyedb/dotnet/edb_core/edb_data/siwave_simulation_setup_data.py +1205 -0
  39. pyedb/dotnet/edb_core/edb_data/sources.py +514 -0
  40. pyedb/dotnet/edb_core/edb_data/terminals.py +632 -0
  41. pyedb/dotnet/edb_core/edb_data/utilities.py +148 -0
  42. pyedb/dotnet/edb_core/edb_data/variables.py +91 -0
  43. pyedb/dotnet/edb_core/general.py +181 -0
  44. pyedb/dotnet/edb_core/hfss.py +1646 -0
  45. pyedb/dotnet/edb_core/layout.py +1244 -0
  46. pyedb/dotnet/edb_core/layout_validation.py +272 -0
  47. pyedb/dotnet/edb_core/materials.py +939 -0
  48. pyedb/dotnet/edb_core/net_class.py +335 -0
  49. pyedb/dotnet/edb_core/nets.py +1215 -0
  50. pyedb/dotnet/edb_core/padstack.py +1389 -0
  51. pyedb/dotnet/edb_core/siwave.py +1427 -0
  52. pyedb/dotnet/edb_core/stackup.py +2703 -0
  53. pyedb/edb_logger.py +396 -0
  54. pyedb/generic/__init__.py +0 -0
  55. pyedb/generic/constants.py +1063 -0
  56. pyedb/generic/data_handlers.py +320 -0
  57. pyedb/generic/design_types.py +104 -0
  58. pyedb/generic/filesystem.py +150 -0
  59. pyedb/generic/general_methods.py +1535 -0
  60. pyedb/generic/plot.py +1840 -0
  61. pyedb/generic/process.py +285 -0
  62. pyedb/generic/settings.py +224 -0
  63. pyedb/ipc2581/__init__.py +0 -0
  64. pyedb/ipc2581/bom/__init__.py +0 -0
  65. pyedb/ipc2581/bom/bom.py +21 -0
  66. pyedb/ipc2581/bom/bom_item.py +32 -0
  67. pyedb/ipc2581/bom/characteristics.py +37 -0
  68. pyedb/ipc2581/bom/refdes.py +16 -0
  69. pyedb/ipc2581/content/__init__.py +0 -0
  70. pyedb/ipc2581/content/color.py +38 -0
  71. pyedb/ipc2581/content/content.py +55 -0
  72. pyedb/ipc2581/content/dictionary_color.py +29 -0
  73. pyedb/ipc2581/content/dictionary_fill.py +28 -0
  74. pyedb/ipc2581/content/dictionary_line.py +30 -0
  75. pyedb/ipc2581/content/entry_color.py +13 -0
  76. pyedb/ipc2581/content/entry_line.py +14 -0
  77. pyedb/ipc2581/content/fill.py +15 -0
  78. pyedb/ipc2581/content/layer_ref.py +10 -0
  79. pyedb/ipc2581/content/standard_geometries_dictionary.py +72 -0
  80. pyedb/ipc2581/ecad/__init__.py +0 -0
  81. pyedb/ipc2581/ecad/cad_data/__init__.py +0 -0
  82. pyedb/ipc2581/ecad/cad_data/assembly_drawing.py +26 -0
  83. pyedb/ipc2581/ecad/cad_data/cad_data.py +37 -0
  84. pyedb/ipc2581/ecad/cad_data/component.py +41 -0
  85. pyedb/ipc2581/ecad/cad_data/drill.py +30 -0
  86. pyedb/ipc2581/ecad/cad_data/feature.py +54 -0
  87. pyedb/ipc2581/ecad/cad_data/layer.py +41 -0
  88. pyedb/ipc2581/ecad/cad_data/layer_feature.py +151 -0
  89. pyedb/ipc2581/ecad/cad_data/logical_net.py +32 -0
  90. pyedb/ipc2581/ecad/cad_data/outline.py +25 -0
  91. pyedb/ipc2581/ecad/cad_data/package.py +104 -0
  92. pyedb/ipc2581/ecad/cad_data/padstack_def.py +38 -0
  93. pyedb/ipc2581/ecad/cad_data/padstack_hole_def.py +24 -0
  94. pyedb/ipc2581/ecad/cad_data/padstack_instance.py +62 -0
  95. pyedb/ipc2581/ecad/cad_data/padstack_pad_def.py +26 -0
  96. pyedb/ipc2581/ecad/cad_data/path.py +89 -0
  97. pyedb/ipc2581/ecad/cad_data/phy_net.py +80 -0
  98. pyedb/ipc2581/ecad/cad_data/pin.py +31 -0
  99. pyedb/ipc2581/ecad/cad_data/polygon.py +169 -0
  100. pyedb/ipc2581/ecad/cad_data/profile.py +40 -0
  101. pyedb/ipc2581/ecad/cad_data/stackup.py +31 -0
  102. pyedb/ipc2581/ecad/cad_data/stackup_group.py +42 -0
  103. pyedb/ipc2581/ecad/cad_data/stackup_layer.py +21 -0
  104. pyedb/ipc2581/ecad/cad_data/step.py +275 -0
  105. pyedb/ipc2581/ecad/cad_header.py +33 -0
  106. pyedb/ipc2581/ecad/ecad.py +19 -0
  107. pyedb/ipc2581/ecad/spec.py +46 -0
  108. pyedb/ipc2581/history_record.py +37 -0
  109. pyedb/ipc2581/ipc2581.py +387 -0
  110. pyedb/ipc2581/logistic_header.py +25 -0
  111. pyedb/misc/__init__.py +0 -0
  112. pyedb/misc/aedtlib_personalib_install.py +14 -0
  113. pyedb/misc/downloads.py +322 -0
  114. pyedb/misc/misc.py +67 -0
  115. pyedb/misc/pyedb.runtimeconfig.json +13 -0
  116. pyedb/misc/siw_feature_config/__init__.py +0 -0
  117. pyedb/misc/siw_feature_config/emc/__init__.py +0 -0
  118. pyedb/misc/siw_feature_config/emc/component_tags.py +46 -0
  119. pyedb/misc/siw_feature_config/emc/net_tags.py +37 -0
  120. pyedb/misc/siw_feature_config/emc/tag_library.py +62 -0
  121. pyedb/misc/siw_feature_config/emc/xml_generic.py +78 -0
  122. pyedb/misc/siw_feature_config/emc_rule_checker_settings.py +179 -0
  123. pyedb/misc/utilities.py +27 -0
  124. pyedb/modeler/geometry_operators.py +2082 -0
  125. pyedb-0.2.0.dist-info/LICENSE +21 -0
  126. pyedb-0.2.0.dist-info/METADATA +208 -0
  127. pyedb-0.2.0.dist-info/RECORD +128 -0
  128. pyedb-0.2.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,335 @@
1
+ from __future__ import absolute_import # noreorder
2
+
3
+ import re
4
+
5
+ from pyedb.dotnet.edb_core.edb_data.nets_data import (
6
+ EDBDifferentialPairData,
7
+ EDBExtendedNetData,
8
+ EDBNetClassData,
9
+ )
10
+ from pyedb.generic.general_methods import pyedb_function_handler
11
+
12
+
13
+ class EdbCommon:
14
+ def __init__(self, pedb):
15
+ self._pedb = pedb
16
+
17
+ @property
18
+ def _layout(self):
19
+ """Get layout.
20
+
21
+ Returns
22
+ -------
23
+ :class:` :class:`pyedb.dotnet.edb_core.dotnet.layout.LayoutDotNet`
24
+ """
25
+ return self._pedb.layout
26
+
27
+ @property
28
+ def _logger(self):
29
+ """EDB logger."""
30
+ return self._pedb.logger
31
+
32
+ @pyedb_function_handler()
33
+ def __getitem__(self, name):
34
+ """Get a net from the EDB project.
35
+
36
+ Parameters
37
+ ----------
38
+ name : str, int
39
+ Name or ID of the net.
40
+
41
+ Returns
42
+ -------
43
+ :class:` :class:`pyedb.dotnet.edb_core.edb_data.nets_data.EDBExtendedNetsData`
44
+
45
+ """
46
+ if name in self.items:
47
+ return self.items[name]
48
+ self._pedb.logger.error("Component or definition not found.")
49
+
50
+
51
+ class EdbNetClasses(EdbCommon, object):
52
+ """Manages EDB methods for managing nets accessible from the ``Edb.net_classes`` property.
53
+
54
+ Examples
55
+ --------
56
+ >>> from pyedb import Edb
57
+ >>> edbapp = Edb("myaedbfolder", edbversion="2021.2")
58
+ >>> edb_nets = edbapp.net_classes
59
+ """
60
+
61
+ def __init__(self, p_edb):
62
+ super().__init__(p_edb)
63
+
64
+ @property
65
+ def items(self):
66
+ """Extended nets.
67
+
68
+ Returns
69
+ -------
70
+ dict[str, :class:`pyedb.dotnet.edb_core.edb_data.nets_data.EDBDifferentialPairData`]
71
+ Dictionary of extended nets.
72
+ """
73
+ net_classes = {}
74
+ for net_class in self._layout.net_classes:
75
+ net_classes[net_class.GetName()] = EDBNetClassData(self._pedb, net_class)
76
+ return net_classes
77
+
78
+ @pyedb_function_handler()
79
+ def create(self, name, net):
80
+ # type: (str, str|list)->EDBNetClassData
81
+ """Create a new net class.
82
+
83
+ Parameters
84
+ ----------
85
+ name : str
86
+ Name of the net class.
87
+ net : str, list
88
+ Name of the nets to be added into this net class.
89
+
90
+ Returns
91
+ -------
92
+ :class:`pyedb.dotnet.edb_core.edb_data.nets_data.EDBNetClassData`
93
+ """
94
+ if name in self.items:
95
+ self._pedb.logger.error("{} already exists.".format(name))
96
+ return False
97
+
98
+ temp = EDBNetClassData(self._pedb)
99
+ api_obj = temp.api_create(name)
100
+ if isinstance(net, str):
101
+ net = [net]
102
+ for i in net:
103
+ api_obj.add_net(i)
104
+
105
+ return self.items[name]
106
+
107
+
108
+ class EdbExtendedNets(EdbCommon, object):
109
+ """Manages EDB methods for managing nets accessible from the ``Edb.extended_nets`` property.
110
+
111
+ Examples
112
+ --------
113
+ >>> from pyedb import Edb
114
+ >>> edbapp = Edb("myaedbfolder", edbversion="2021.2")
115
+ >>> edb_nets = edbapp.extended_nets
116
+ """
117
+
118
+ def __init__(self, p_edb):
119
+ super().__init__(p_edb)
120
+
121
+ @property
122
+ def items(self):
123
+ """Extended nets.
124
+
125
+ Returns
126
+ -------
127
+ dict[str, :class:`pyedb.dotnet.edb_core.edb_data.nets_data.EDBExtendedNetsData`]
128
+ Dictionary of extended nets.
129
+ """
130
+ nets = {}
131
+ for extended_net in self._layout.extended_nets:
132
+ nets[extended_net.GetName()] = EDBExtendedNetData(self._pedb, extended_net)
133
+ return nets
134
+
135
+ @pyedb_function_handler()
136
+ def create(self, name, net):
137
+ # type: (str, str|list)->EDBExtendedNetData
138
+ """Create a new Extended net.
139
+
140
+ Parameters
141
+ ----------
142
+ name : str
143
+ Name of the extended net.
144
+ net : str, list
145
+ Name of the nets to be added into this extended net.
146
+
147
+ Returns
148
+ -------
149
+ :class:`pyedb.dotnet.edb_core.edb_data.nets_data.EDBExtendedNetsData`
150
+ """
151
+ if name in self.items:
152
+ self._pedb.logger.error("{} already exists.".format(name))
153
+ return False
154
+
155
+ extended_net = EDBExtendedNetData(self._pedb)
156
+ api_extended_net = extended_net.api_create(name)
157
+ if isinstance(net, str):
158
+ net = [net]
159
+ for i in net:
160
+ api_extended_net.add_net(i)
161
+
162
+ return self.items[name]
163
+
164
+ @pyedb_function_handler()
165
+ def auto_identify_signal(self, resistor_below=10, inductor_below=1, capacitor_above=1e-9, exception_list=None):
166
+ # type: (int | float, int | float, int |float, list) -> list
167
+ """Get extended signal net and associated components.
168
+
169
+ Parameters
170
+ ----------
171
+ resistor_below : int, float, optional
172
+ Threshold for the resistor value. Search the extended net across resistors that
173
+ have a value lower than the threshold.
174
+ inductor_below : int, float, optional
175
+ Threshold for the inductor value. Search the extended net across inductances
176
+ that have a value lower than the threshold.
177
+ capacitor_above : int, float, optional
178
+ Threshold for the capacitor value. Search the extended net across capacitors
179
+ that have a value higher than the threshold.
180
+ exception_list : list, optional
181
+ List of components to bypass when performing threshold checks. Components
182
+ in the list are considered as serial components. The default is ``None``.
183
+
184
+ Returns
185
+ -------
186
+ list
187
+ List of all extended nets.
188
+
189
+ Examples
190
+ --------
191
+ >>> from pyedb import Edb
192
+ >>> app = Edb()
193
+ >>> app.extended_nets.auto_identify_signal()
194
+ """
195
+ return self._pedb.nets.generate_extended_nets(
196
+ resistor_below, inductor_below, capacitor_above, exception_list, True, True
197
+ )
198
+
199
+ @pyedb_function_handler()
200
+ def auto_identify_power(self, resistor_below=10, inductor_below=1, capacitor_above=1, exception_list=None):
201
+ # type: (int | float, int | float, int |float, list) -> list
202
+ """Get all extended power nets and their associated components.
203
+
204
+ Parameters
205
+ ----------
206
+ resistor_below : int, float, optional
207
+ Threshold for the resistor value. Search the extended net across resistors that
208
+ have a value lower than the threshold.
209
+ inductor_below : int, float, optional
210
+ Threshold for the inductor value. Search the extended net across inductances that
211
+ have a value lower than the threshold.
212
+ capacitor_above : int, float, optional
213
+ Threshold for the capacitor value. Search the extended net across capacitors that
214
+ have a value higher than the threshold.
215
+ exception_list : list, optional
216
+ List of components to bypass when performing threshold checks. Components
217
+ in the list are considered as serial components. The default is ``None``.
218
+
219
+ Returns
220
+ -------
221
+ list
222
+ List of all extended nets and their associated components.
223
+
224
+ Examples
225
+ --------
226
+ >>> from pyedb import Edb
227
+ >>> app = Edb()
228
+ >>> app.extended_nets.auto_identify_power()
229
+ """
230
+ return self._pedb.nets.generate_extended_nets(
231
+ resistor_below, inductor_below, capacitor_above, exception_list, True, True
232
+ )
233
+
234
+
235
+ class EdbDifferentialPairs(EdbCommon, object):
236
+ """Manages EDB methods for managing nets accessible from the ``Edb.differential_pairs`` property.
237
+
238
+ Examples
239
+ --------
240
+ >>> from pyedb import Edb
241
+ >>> edbapp = Edb("myaedbfolder", edbversion="2021.2")
242
+ >>> edb_nets = edbapp.differential_pairs.items
243
+ >>> edb_nets = edbapp.differential_pairs["DQ4"]
244
+ """
245
+
246
+ def __init__(self, p_edb):
247
+ super().__init__(p_edb)
248
+
249
+ @property
250
+ def items(self):
251
+ """Extended nets.
252
+
253
+ Returns
254
+ -------
255
+ dict[str, :class:`pyedb.dotnet.edb_core.edb_data.nets_data.EDBDifferentialPairData`]
256
+ Dictionary of extended nets.
257
+ """
258
+ diff_pairs = {}
259
+ for diff_pair in self._layout.differential_pairs:
260
+ diff_pairs[diff_pair.GetName()] = EDBDifferentialPairData(self._pedb, diff_pair)
261
+ return diff_pairs
262
+
263
+ @pyedb_function_handler()
264
+ def create(self, name, net_p, net_n):
265
+ # type: (str, str, str) -> EDBDifferentialPairData
266
+ """
267
+
268
+ Parameters
269
+ ----------
270
+ name : str
271
+ Name of the differential pair.
272
+ net_p : str
273
+ Name of the positive net.
274
+ net_n : str
275
+ Name of the negative net.
276
+
277
+ Returns
278
+ -------
279
+ :class:`pyedb.dotnet.edb_core.edb_data.nets_data.EDBDifferentialPairData`
280
+ """
281
+ if name in self.items:
282
+ self._pedb.logger.error("{} already exists.".format(name))
283
+ return False
284
+
285
+ diff_pair = EDBDifferentialPairData(self._pedb)
286
+ diff_pair.api_create(name)._api_set_differential_pair(net_p, net_n)
287
+
288
+ return self.items[name]
289
+
290
+ @pyedb_function_handler()
291
+ def auto_identify(self, positive_differentiator="_P", negative_differentiator="_N"):
292
+ """Auto identify differential pairs by naming conversion.
293
+
294
+ Parameters
295
+ ----------
296
+ positive_differentiator: str, optional
297
+ Differentiator of the positive net. The default is ``"_P"``.
298
+ negative_differentiator: str, optional
299
+ Differentiator of the negative net. The default is ``"_N"``.
300
+
301
+ Returns
302
+ -------
303
+ list
304
+ A list containing identified differential pair names.
305
+ Examples
306
+ --------
307
+ >>> from pyedb import Edb
308
+ >>> edbapp = Edb("myaedbfolder", edbversion="2023.1")
309
+ >>> edb_nets = edbapp.differential_pairs.auto_identify()
310
+ """
311
+ nets = self._pedb.nets.nets
312
+ pos_net = []
313
+ neg_net = []
314
+ for name, _ in nets.items():
315
+ if name.endswith(positive_differentiator):
316
+ pos_net.append(name)
317
+ elif name.endswith(negative_differentiator):
318
+ neg_net.append(name)
319
+ else:
320
+ pass
321
+
322
+ temp = []
323
+ for p in pos_net:
324
+ pattern_p = r"^(.+){}$".format(positive_differentiator)
325
+ match_p = re.findall(pattern_p, p)[0]
326
+
327
+ for n in neg_net:
328
+ pattern_n = r"^(.+){}$".format(negative_differentiator)
329
+ match_n = re.findall(pattern_n, n)[0]
330
+
331
+ if match_p == match_n:
332
+ diff_name = "DIFF_{}".format(match_p)
333
+ self.create(diff_name, p, n)
334
+ temp.append(diff_name)
335
+ return temp