pyedb 0.54.0__py3-none-any.whl → 0.56.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 (105) hide show
  1. pyedb/__init__.py +1 -8
  2. pyedb/configuration/cfg_boundaries.py +69 -151
  3. pyedb/configuration/cfg_components.py +201 -460
  4. pyedb/configuration/cfg_data.py +4 -2
  5. pyedb/configuration/cfg_general.py +13 -36
  6. pyedb/configuration/cfg_modeler.py +2 -1
  7. pyedb/configuration/cfg_nets.py +21 -35
  8. pyedb/configuration/cfg_operations.py +22 -151
  9. pyedb/configuration/cfg_package_definition.py +56 -112
  10. pyedb/configuration/cfg_padstacks.py +292 -688
  11. pyedb/configuration/cfg_pin_groups.py +32 -79
  12. pyedb/configuration/cfg_ports_sources.py +19 -6
  13. pyedb/configuration/cfg_s_parameter_models.py +67 -172
  14. pyedb/configuration/cfg_setup.py +102 -295
  15. pyedb/configuration/configuration.py +64 -5
  16. pyedb/dotnet/database/Variables.py +26 -19
  17. pyedb/dotnet/database/cell/connectable.py +38 -9
  18. pyedb/dotnet/database/cell/hierarchy/component.py +28 -28
  19. pyedb/dotnet/database/cell/hierarchy/model.py +1 -1
  20. pyedb/dotnet/database/cell/layout.py +63 -2
  21. pyedb/dotnet/database/cell/layout_obj.py +2 -2
  22. pyedb/dotnet/database/cell/primitive/path.py +6 -8
  23. pyedb/dotnet/database/cell/primitive/primitive.py +3 -24
  24. pyedb/dotnet/database/cell/terminal/edge_terminal.py +2 -2
  25. pyedb/dotnet/database/cell/terminal/padstack_instance_terminal.py +1 -1
  26. pyedb/dotnet/database/cell/terminal/pingroup_terminal.py +1 -1
  27. pyedb/dotnet/database/cell/terminal/point_terminal.py +1 -1
  28. pyedb/dotnet/database/cell/terminal/terminal.py +24 -24
  29. pyedb/dotnet/database/cell/voltage_regulator.py +0 -21
  30. pyedb/dotnet/database/components.py +137 -124
  31. pyedb/dotnet/database/definition/component_def.py +4 -4
  32. pyedb/dotnet/database/definition/component_model.py +1 -1
  33. pyedb/dotnet/database/definition/package_def.py +2 -3
  34. pyedb/dotnet/database/dotnet/database.py +3 -199
  35. pyedb/dotnet/database/dotnet/primitive.py +3 -3
  36. pyedb/dotnet/database/edb_data/control_file.py +5 -5
  37. pyedb/dotnet/database/edb_data/hfss_extent_info.py +6 -6
  38. pyedb/dotnet/database/edb_data/layer_data.py +23 -23
  39. pyedb/dotnet/database/edb_data/padstacks_data.py +63 -88
  40. pyedb/dotnet/database/edb_data/primitives_data.py +5 -5
  41. pyedb/dotnet/database/edb_data/sources.py +6 -6
  42. pyedb/dotnet/database/edb_data/variables.py +1 -1
  43. pyedb/dotnet/database/geometry/point_data.py +14 -10
  44. pyedb/dotnet/database/geometry/polygon_data.py +3 -3
  45. pyedb/dotnet/database/hfss.py +46 -48
  46. pyedb/dotnet/database/layout_validation.py +14 -11
  47. pyedb/dotnet/database/materials.py +10 -11
  48. pyedb/dotnet/database/modeler.py +97 -91
  49. pyedb/dotnet/database/nets.py +19 -22
  50. pyedb/dotnet/database/padstack.py +171 -83
  51. pyedb/dotnet/database/siwave.py +42 -42
  52. pyedb/dotnet/database/stackup.py +140 -72
  53. pyedb/dotnet/database/utilities/heatsink.py +4 -4
  54. pyedb/dotnet/database/utilities/obj_base.py +2 -2
  55. pyedb/dotnet/database/utilities/simulation_setup.py +2 -2
  56. pyedb/dotnet/database/utilities/value.py +16 -16
  57. pyedb/dotnet/edb.py +230 -152
  58. pyedb/edb_logger.py +12 -27
  59. pyedb/extensions/create_cell_array.py +394 -0
  60. pyedb/extensions/via_design_backend.py +6 -3
  61. pyedb/generic/data_handlers.py +6 -7
  62. pyedb/generic/design_types.py +81 -30
  63. pyedb/generic/filesystem.py +5 -2
  64. pyedb/generic/general_methods.py +2 -122
  65. pyedb/generic/process.py +44 -108
  66. pyedb/generic/settings.py +79 -19
  67. pyedb/grpc/database/components.py +26 -4
  68. pyedb/grpc/database/control_file.py +5 -5
  69. pyedb/grpc/database/definition/materials.py +1 -1
  70. pyedb/grpc/database/definition/package_def.py +3 -3
  71. pyedb/grpc/database/definition/padstack_def.py +53 -0
  72. pyedb/grpc/database/geometry/polygon_data.py +1 -1
  73. pyedb/grpc/database/layout/layout.py +81 -5
  74. pyedb/grpc/database/layout_validation.py +5 -5
  75. pyedb/grpc/database/modeler.py +24 -16
  76. pyedb/grpc/database/net/net.py +15 -14
  77. pyedb/grpc/database/nets.py +70 -0
  78. pyedb/grpc/database/padstacks.py +122 -17
  79. pyedb/grpc/database/primitive/padstack_instance.py +175 -7
  80. pyedb/grpc/database/primitive/polygon.py +2 -2
  81. pyedb/grpc/database/simulation_setup/siwave_cpa_simulation_setup.py +3 -2
  82. pyedb/grpc/database/siwave.py +1 -1
  83. pyedb/grpc/database/source_excitations.py +12 -5
  84. pyedb/grpc/database/stackup.py +1 -1
  85. pyedb/grpc/database/terminal/bundle_terminal.py +1 -1
  86. pyedb/grpc/database/terminal/padstack_instance_terminal.py +1 -1
  87. pyedb/grpc/database/terminal/pingroup_terminal.py +1 -1
  88. pyedb/grpc/database/utility/value.py +1 -0
  89. pyedb/grpc/database/utility/xml_control_file.py +5 -5
  90. pyedb/grpc/edb.py +80 -30
  91. pyedb/grpc/edb_init.py +3 -3
  92. pyedb/grpc/rpc_session.py +14 -13
  93. pyedb/libraries/common.py +366 -0
  94. pyedb/libraries/rf_libraries/base_functions.py +1358 -0
  95. pyedb/libraries/rf_libraries/planar_antennas.py +628 -0
  96. pyedb/misc/decorators.py +61 -0
  97. pyedb/misc/misc.py +0 -13
  98. pyedb/modeler/geometry_operators.py +6 -6
  99. pyedb/siwave.py +6 -8
  100. pyedb/siwave_core/__init__.py +0 -0
  101. pyedb/siwave_core/cpa/__init__.py +0 -0
  102. {pyedb-0.54.0.dist-info → pyedb-0.56.0.dist-info}/METADATA +1 -2
  103. {pyedb-0.54.0.dist-info → pyedb-0.56.0.dist-info}/RECORD +105 -98
  104. {pyedb-0.54.0.dist-info → pyedb-0.56.0.dist-info}/WHEEL +0 -0
  105. {pyedb-0.54.0.dist-info → pyedb-0.56.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,366 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ from dataclasses import dataclass
24
+ from typing import Tuple, Union
25
+
26
+
27
+ @dataclass
28
+ class Substrate:
29
+ """
30
+ Small helper that groups the four basic substrate parameters used
31
+ throughout the library.
32
+
33
+ Parameters
34
+ ----------
35
+ h : float, default 100 µm
36
+ Substrate height in metres.
37
+ er : float, default 4.4
38
+ Relative permittivity.
39
+ tan_d : float, default 0
40
+ Loss tangent.
41
+ name : str, default "SUB"
42
+ Logical name used for layer creation.
43
+ size : tuple[float, float], default (1 mm, 1 mm)
44
+ (width, length) of the surrounding ground plane in metres.
45
+
46
+ Examples
47
+ --------
48
+ >>> sub = Substrate(h=1.6e-3, er=4.4, tan_d=0.02,
49
+ ... name="FR4", size=(10e-3, 15e-3))
50
+ >>> sub.h
51
+ 0.0016
52
+ """
53
+
54
+ h: float = 100e-6 # height (m)
55
+ er: float = 4.4 # relative permittivity
56
+ tan_d: float = 0 # loss tangent
57
+ name: str = "SUB"
58
+ size: Tuple[float, float] = (0.001, 0.001) # width, length in metres
59
+
60
+
61
+ from typing import Union
62
+
63
+
64
+ # ------------------------------------------------------------------
65
+ # Material
66
+ # ------------------------------------------------------------------
67
+ class Material:
68
+ """
69
+ Generic material definition.
70
+
71
+ When the material name is set, the object automatically registers
72
+ itself in the provided PyEDB material database if the name is not
73
+ already present.
74
+
75
+ Parameters
76
+ ----------
77
+ pedb : ansys.edb.core.database.Database
78
+ Active EDB session.
79
+ name : str
80
+ Material name (e.g. ``"Copper"``).
81
+
82
+ Examples
83
+ --------
84
+ >>> m = Material(edb, "MyMaterial")
85
+ >>> m.name
86
+ 'MyMaterial'
87
+ >>> edb.materials["MyMaterial"] # now exists in the database
88
+ <Material object at ...>
89
+ """
90
+
91
+ def __init__(self, pedb, name):
92
+ self._pedb = pedb
93
+ self.name = name
94
+
95
+ @property
96
+ def name(self) -> str:
97
+ """Material name."""
98
+ return self._name
99
+
100
+ @name.setter
101
+ def name(self, value: str):
102
+ self._name = value
103
+ if value not in self._pedb.materials:
104
+ self._pedb.materials.add_material(value)
105
+
106
+
107
+ # ------------------------------------------------------------------
108
+ # Conductor
109
+ # ------------------------------------------------------------------
110
+ class Conductor(Material):
111
+ """
112
+ Metallic conductor material with electrical conductivity.
113
+
114
+ Parameters
115
+ ----------
116
+ pedb : ansys.edb.core.database.Database
117
+ Active EDB session.
118
+ name : str
119
+ Material name.
120
+ conductivity : float, optional
121
+ Electrical conductivity in S/m. Default is 5.8e7 (Copper).
122
+
123
+ Examples
124
+ --------
125
+ >>> cu = Conductor(edb, "Copper", conductivity=5.8e7)
126
+ >>> cu.conductivity
127
+ 58000000.0
128
+ >>> cu.conductivity = 3.5e7 # update on-the-fly
129
+ >>> edb.materials["Copper"].conductivity
130
+ 35000000.0
131
+ """
132
+
133
+ def __init__(self, pedb, name: str, conductivity: float = 5.8e7):
134
+ super().__init__(pedb, name)
135
+ self.conductivity = conductivity
136
+
137
+ @property
138
+ def conductivity(self) -> float:
139
+ """Electrical conductivity (S/m)."""
140
+ return self._conductivity
141
+
142
+ @conductivity.setter
143
+ def conductivity(self, value: float):
144
+ self._conductivity = value
145
+ self._pedb.materials[self.name].conductivity = value
146
+
147
+
148
+ # ------------------------------------------------------------------
149
+ # Dielectric
150
+ # ------------------------------------------------------------------
151
+ class Dielectric(Material):
152
+ """
153
+ Dielectric material with relative permittivity and loss tangent.
154
+
155
+ Parameters
156
+ ----------
157
+ pedb : ansys.edb.core.database.Database
158
+ Active EDB session.
159
+ name : str
160
+ Material name.
161
+ permittivity : float, optional
162
+ Relative permittivity (εᵣ). Default is 11.9 (Silicon).
163
+ loss_tg : float, optional
164
+ Loss tangent (tan δ). Default is 0.02.
165
+
166
+ Examples
167
+ --------
168
+ >>> sub = Dielectric(edb, "Silicon", permittivity=11.9, loss_tg=0.01)
169
+ >>> sub.permittivity
170
+ 11.9
171
+ >>> sub.loss_tg = 0.005
172
+ >>> edb.materials["Silicon"].loss_tangent
173
+ 0.005
174
+ """
175
+
176
+ def __init__(self, pedb, name: str, permittivity: float = 11.9, loss_tg: float = 0.02):
177
+ super().__init__(pedb, name)
178
+ self.permittivity = permittivity
179
+ self.loss_tg = loss_tg
180
+
181
+ @property
182
+ def permittivity(self) -> float:
183
+ """Relative permittivity (εᵣ)."""
184
+ return self._permittivity
185
+
186
+ @permittivity.setter
187
+ def permittivity(self, value: float):
188
+ self._permittivity = value
189
+ self._pedb.materials[self.name].permittivity = value
190
+
191
+ @property
192
+ def loss_tg(self) -> float:
193
+ """Loss tangent (tan δ)."""
194
+ return self._loss_tg
195
+
196
+ @loss_tg.setter
197
+ def loss_tg(self, value: float):
198
+ self._loss_tg = value
199
+ self._pedb.materials[self.name].loss_tangent = value
200
+
201
+
202
+ # ------------------------------------------------------------------
203
+ # Layer
204
+ # ------------------------------------------------------------------
205
+ class Layer:
206
+ """
207
+ Physical layer inside a stackup.
208
+
209
+ Parameters
210
+ ----------
211
+ pedb : ansys.edb.core.database.Database
212
+ Active EDB session.
213
+ name : str
214
+ Layer name.
215
+ material : Conductor or Dielectric, optional
216
+ Material instance assigned to the layer.
217
+ thickness : float, optional
218
+ Layer thickness in meters. Default is 1 µm.
219
+
220
+ Examples
221
+ --------
222
+ >>> diel = Dielectric(edb, "FR4")
223
+ >>> lyr = Layer(edb, "Core", material=diel, thickness=100e-6)
224
+ >>> lyr.thickness = 50e-6
225
+ >>> edb.stackup.layers["Core"].thickness
226
+ 5e-05
227
+ """
228
+
229
+ def __init__(self, pedb, name: str, material: Union[Conductor, Dielectric] = None, thickness: float = 1e-6):
230
+ self._pedb = pedb
231
+ self.name: str = name
232
+ self.thickness: float = thickness
233
+ self._material = material
234
+
235
+ @property
236
+ def name(self) -> str:
237
+ """Layer name."""
238
+ return self._name
239
+
240
+ @name.setter
241
+ def name(self, value: str):
242
+ self._name = value
243
+ if value not in self._pedb.stackup.layers:
244
+ self._pedb.stackup.add_layer(value)
245
+ else:
246
+ self._pedb.stackup.layers[self.name].name = self.name
247
+
248
+ @property
249
+ def thickness(self) -> float:
250
+ """Layer thickness (m)."""
251
+ return self._thickness
252
+
253
+ @thickness.setter
254
+ def thickness(self, value: float):
255
+ self._thickness = value
256
+ self._pedb.stackup.layers[self.name].thickness = value
257
+
258
+ @property
259
+ def material(self) -> Union[Conductor, Dielectric]:
260
+ """Material assigned to this layer."""
261
+ return self._material
262
+
263
+ @material.setter
264
+ def material(self, material: Union[Conductor, Dielectric]):
265
+ self._material = material
266
+ self._pedb.stackup.layers[self.name].material = material.name
267
+
268
+
269
+ # ------------------------------------------------------------------
270
+ # MetalLayer
271
+ # ------------------------------------------------------------------
272
+ class MetalLayer(Layer):
273
+ """
274
+ Convenience wrapper for metallic layers.
275
+
276
+ Automatically creates a ``Conductor`` material.
277
+
278
+ Parameters
279
+ ----------
280
+ pedb : ansys.edb.core.database.Database
281
+ Active EDB session.
282
+ name : str
283
+ Layer name.
284
+ thickness : float, optional
285
+ Thickness in meters. Default is 1 µm.
286
+ material : str, optional
287
+ Name of the conductor material. Default is ``"Copper"``.
288
+
289
+ Examples
290
+ --------
291
+ >>> top = MetalLayer(edb, "TOP", thickness=18e-6, material="Gold")
292
+ >>> top.material.conductivity
293
+ 58000000.0
294
+ """
295
+
296
+ def __init__(self, pedb, name, thickness=1e-6, material: str = "Copper"):
297
+ super().__init__(pedb, name, thickness=thickness)
298
+ self.material = Conductor(pedb, name=material)
299
+
300
+
301
+ # ------------------------------------------------------------------
302
+ # DielectricLayer
303
+ # ------------------------------------------------------------------
304
+ class DielectricLayer(Layer):
305
+ """
306
+ Convenience wrapper for dielectric layers.
307
+
308
+ Automatically creates a ``Dielectric`` material.
309
+
310
+ Parameters
311
+ ----------
312
+ pedb : ansys.edb.core.database.Database
313
+ Active EDB session.
314
+ name : str
315
+ Layer name.
316
+ thickness : float, optional
317
+ Thickness in meters. Default is 1 µm.
318
+ material : str, optional
319
+ Name of the dielectric material. Default is ``"FR4"``.
320
+
321
+ Examples
322
+ --------
323
+ >>> core = DielectricLayer(edb, "Core", thickness=100e-6, material="FR4")
324
+ >>> core.material.permittivity
325
+ 4.4
326
+ """
327
+
328
+ def __init__(self, pedb, name, thickness=1e-6, material: str = "FR4"):
329
+ super().__init__(pedb, name, thickness=thickness)
330
+ self._pedb.stackup[name].type = "dielectric"
331
+ self.material = Dielectric(pedb, name=material)
332
+
333
+
334
+ # ------------------------------------------------------------------
335
+ # MicroStripTechnologyStackup
336
+ # ------------------------------------------------------------------
337
+ class MicroStripTechnologyStackup:
338
+ """
339
+ Pre-defined micro-strip stackup with bottom metal, substrate and top metal.
340
+
341
+ Parameters
342
+ ----------
343
+ pedb : ansys.edb.core.database.Database
344
+ Active EDB session.
345
+
346
+ Attributes
347
+ ----------
348
+ bottom_metal : MetalLayer
349
+ Bottom metal layer.
350
+ substrate : DielectricLayer
351
+ Substrate dielectric layer.
352
+ top_metal : MetalLayer
353
+ Top metal layer.
354
+
355
+ Examples
356
+ --------
357
+ >>> stack = MicroStripTechnologyStackup(edb)
358
+ >>> stack.top_metal.thickness = 5e-6
359
+ >>> stack.substrate.material.permittivity = 9.8
360
+ """
361
+
362
+ def __init__(self, pedb):
363
+ self._pedb = pedb
364
+ self.bottom_metal = MetalLayer(pedb, name="BOT_METAL", thickness=4e-6, material="Gold")
365
+ self.substrate = DielectricLayer(pedb, name="Substrate", thickness=100e-6, material="Silicon")
366
+ self.top_metal = MetalLayer(pedb, name="TOP_METAL", thickness=4e-6, material="Gold")