pyedb 0.7.0__py3-none-any.whl → 0.8.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 (46) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/dotnet/clr_module.py +1 -1
  3. pyedb/dotnet/edb.py +7 -7
  4. pyedb/dotnet/edb_core/cell/hierarchy/model.py +1 -1
  5. pyedb/dotnet/edb_core/components.py +15 -12
  6. pyedb/dotnet/edb_core/configuration.py +232 -25
  7. pyedb/dotnet/edb_core/definition/component_def.py +10 -1
  8. pyedb/dotnet/edb_core/definition/component_model.py +1 -1
  9. pyedb/dotnet/edb_core/definition/definition_obj.py +1 -1
  10. pyedb/dotnet/edb_core/definition/definitions.py +8 -2
  11. pyedb/dotnet/edb_core/definition/package_def.py +61 -15
  12. pyedb/dotnet/edb_core/dotnet/database.py +5 -4
  13. pyedb/dotnet/edb_core/edb_data/components_data.py +3 -2
  14. pyedb/dotnet/edb_core/edb_data/connectable.py +1 -1
  15. pyedb/dotnet/edb_core/edb_data/hfss_extent_info.py +14 -13
  16. pyedb/dotnet/edb_core/edb_data/hfss_simulation_setup_data.py +2 -2
  17. pyedb/dotnet/edb_core/edb_data/layer_data.py +9 -3
  18. pyedb/dotnet/edb_core/edb_data/padstacks_data.py +6 -5
  19. pyedb/dotnet/edb_core/edb_data/primitives_data.py +16 -13
  20. pyedb/dotnet/edb_core/edb_data/siwave_simulation_setup_data.py +7 -1
  21. pyedb/dotnet/edb_core/edb_data/sources.py +10 -0
  22. pyedb/dotnet/edb_core/geometry/__init__.py +0 -0
  23. pyedb/dotnet/edb_core/{edb_data/obj_base.py → geometry/point_data.py} +12 -26
  24. pyedb/dotnet/edb_core/geometry/polygon_data.py +77 -0
  25. pyedb/dotnet/edb_core/layout.py +59 -0
  26. pyedb/dotnet/edb_core/materials.py +715 -597
  27. pyedb/dotnet/edb_core/nets.py +3 -3
  28. pyedb/dotnet/edb_core/obj_base.py +94 -0
  29. pyedb/dotnet/edb_core/padstack.py +57 -6
  30. pyedb/dotnet/edb_core/siwave.py +11 -4
  31. pyedb/dotnet/edb_core/stackup.py +152 -131
  32. pyedb/dotnet/edb_core/utilities/__init__.py +3 -0
  33. pyedb/dotnet/edb_core/utilities/heatsink.py +69 -0
  34. pyedb/dotnet/sim_setup_data/data/siw_dc_ir_settings.py +46 -0
  35. pyedb/edb_logger.py +15 -1
  36. pyedb/exceptions.py +6 -0
  37. pyedb/generic/filesystem.py +7 -3
  38. pyedb/generic/general_methods.py +4 -0
  39. pyedb/generic/process.py +4 -1
  40. pyedb/generic/settings.py +30 -8
  41. pyedb/siwave.py +50 -1
  42. {pyedb-0.7.0.dist-info → pyedb-0.8.0.dist-info}/METADATA +31 -53
  43. {pyedb-0.7.0.dist-info → pyedb-0.8.0.dist-info}/RECORD +46 -39
  44. /pyedb/dotnet/edb_core/{edb_data → utilities}/simulation_setup.py +0 -0
  45. {pyedb-0.7.0.dist-info → pyedb-0.8.0.dist-info}/LICENSE +0 -0
  46. {pyedb-0.7.0.dist-info → pyedb-0.8.0.dist-info}/WHEEL +0 -0
@@ -472,7 +472,7 @@ class EdbNets(object):
472
472
  @pyedb_function_handler()
473
473
  def get_plot_data(
474
474
  self,
475
- nets,
475
+ nets=None,
476
476
  layers=None,
477
477
  color_by_net=False,
478
478
  outline=None,
@@ -483,8 +483,8 @@ class EdbNets(object):
483
483
 
484
484
  Parameters
485
485
  ----------
486
- nets : str, list
487
- Name of the net or list of nets to plot. If `None` all nets will be plotted.
486
+ nets : str, list, optional
487
+ Name of the net or list of nets to plot. If `None` (default value) all nets will be plotted.
488
488
  layers : str, list, optional
489
489
  Name of the layers to include in the plot. If `None` all the signal layers will be considered.
490
490
  color_by_net : bool, optional
@@ -0,0 +1,94 @@
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 pyedb.dotnet.clr_module import Tuple
24
+ from pyedb.dotnet.edb_core.geometry.point_data import PointData
25
+
26
+
27
+ class BBox:
28
+ """Bounding box."""
29
+
30
+ def __init__(self, pedb, edb_object=None, point_1=None, point_2=None):
31
+ self._pedb = pedb
32
+ if edb_object:
33
+ self._edb_object = edb_object
34
+ else:
35
+ point_1 = PointData(self._pedb, x=point_1[0], y=point_1[1])
36
+ point_2 = PointData(self._pedb, x=point_2[0], y=point_2[1])
37
+ self._edb_object = Tuple[self._pedb.edb_api.Geometry.PointData, self._pedb.edb_api.Geometry.PointData](
38
+ point_1._edb_object, point_2._edb_object
39
+ )
40
+
41
+ @property
42
+ def point_1(self):
43
+ return [self._edb_object.Item1.X.ToDouble(), self._edb_object.Item1.Y.ToDouble()]
44
+
45
+ @property
46
+ def point_2(self):
47
+ return [self._edb_object.Item2.X.ToDouble(), self._edb_object.Item2.Y.ToDouble()]
48
+
49
+ @property
50
+ def corner_points(self):
51
+ return [self.point_1, self.point_2]
52
+
53
+
54
+ class ObjBase(object):
55
+ """Manages EDB functionalities for a base object."""
56
+
57
+ def __init__(self, pedb, edb_object):
58
+ self._pedb = pedb
59
+ self._edb_object = edb_object
60
+
61
+ @property
62
+ def is_null(self):
63
+ """Flag indicating if this object is null."""
64
+ return self._edb_object.IsNull()
65
+
66
+ @property
67
+ def type(self):
68
+ """Type of the edb object."""
69
+ try:
70
+ return self._edb_object.GetType()
71
+ except AttributeError: # pragma: no cover
72
+ return None
73
+
74
+ @property
75
+ def name(self):
76
+ """Name of the definition."""
77
+ return self._edb_object.GetName()
78
+
79
+ @name.setter
80
+ def name(self, value):
81
+ self._edb_object.SetName(value)
82
+
83
+ @property
84
+ def bounding_box(self):
85
+ """Bounding box.
86
+
87
+ Returns
88
+ -------
89
+ List[float]
90
+ List of coordinates for the component's bounding box, with the list of
91
+ coordinates in this order: [X lower left corner, Y lower left corner,
92
+ X upper right corner, Y upper right corner].
93
+ """
94
+ return BBox(self._pedb, self._edb_object.GetBBox()).corner_points
@@ -212,7 +212,7 @@ class EdbPadstacks(object):
212
212
 
213
213
  Returns
214
214
  -------
215
- dict[str, :class:`dotnet.edb_core.edb_data.padstacks_data.EDBPadstackInstance`]
215
+ dict[int, :class:`dotnet.edb_core.edb_data.padstacks_data.EDBPadstackInstance`]
216
216
  List of padstack instances.
217
217
 
218
218
  """
@@ -223,6 +223,24 @@ class EdbPadstacks(object):
223
223
  padstack_instances[edb_padstack_instance.GetId()] = EDBPadstackInstance(edb_padstack_instance, self._pedb)
224
224
  return padstack_instances
225
225
 
226
+ @property
227
+ def instances_by_name(self):
228
+ """Dictionary of all padstack instances (vias and pins) by name.
229
+
230
+ Returns
231
+ -------
232
+ dict[str, :class:`dotnet.edb_core.edb_data.padstacks_data.EDBPadstackInstance`]
233
+ List of padstack instances.
234
+
235
+ """
236
+ padstack_instances = {}
237
+ for _, edb_padstack_instance in self._pedb.padstacks.instances.items():
238
+ if edb_padstack_instance.aedt_name:
239
+ padstack_instances[edb_padstack_instance.aedt_name] = EDBPadstackInstance(
240
+ edb_padstack_instance, self._pedb
241
+ )
242
+ return padstack_instances
243
+
226
244
  @property
227
245
  def pins(self):
228
246
  """Dictionary of all pins instances (belonging to component).
@@ -1332,6 +1350,42 @@ class EdbPadstacks(object):
1332
1350
  self.definitions[padstack_name].edb_padstack.SetData(new_padstack_def)
1333
1351
  return True
1334
1352
 
1353
+ @pyedb_function_handler()
1354
+ def get_instances(self, name=None, pid=None, definition_name=None, net_name=None):
1355
+ """Get padstack instances by conditions.
1356
+
1357
+ Parameters
1358
+ ----------
1359
+ name : str, optional
1360
+ Name of the padstack.
1361
+ pid : int, optional
1362
+ Id of the padstack.
1363
+ definition_name : str, list, optional
1364
+ Name of the padstack definition.
1365
+ net_name : str, optional
1366
+ The net name to be used for filtering padstack instances.
1367
+
1368
+ Returns
1369
+ -------
1370
+ list
1371
+ List of :class:`dotnet.edb_core.edb_data.padstacks_data.EDBPadstackInstance`.
1372
+ """
1373
+
1374
+ instances_by_id = self.instances
1375
+ if pid:
1376
+ return instances_by_id[pid]
1377
+ elif name:
1378
+ return self.instances_by_name[name]
1379
+ else:
1380
+ instances = list(instances_by_id.values())
1381
+ if definition_name:
1382
+ definition_name = definition_name if isinstance(definition_name, list) else [definition_name]
1383
+ instances = [inst for inst in instances if inst.padstack_definition in definition_name]
1384
+ if net_name:
1385
+ net_name = net_name if isinstance(net_name, list) else [net_name]
1386
+ instances = [inst for inst in instances if inst.net_name in net_name]
1387
+ return instances
1388
+
1335
1389
  @pyedb_function_handler()
1336
1390
  def get_padstack_instance_by_net_name(self, net_name):
1337
1391
  """Get a list of padstack instances by net name.
@@ -1346,11 +1400,8 @@ class EdbPadstacks(object):
1346
1400
  list
1347
1401
  List of :class:`dotnet.edb_core.edb_data.padstacks_data.EDBPadstackInstance`.
1348
1402
  """
1349
- padstack_instances = []
1350
- for inst_id, inst in self.instances.items():
1351
- if inst.net_name == net_name:
1352
- padstack_instances.append(inst)
1353
- return padstack_instances
1403
+ warnings.warn("Use new property :func:`get_padstack_instance` instead.", DeprecationWarning)
1404
+ return self.get_instances(net_name=net_name)
1354
1405
 
1355
1406
  @pyedb_function_handler()
1356
1407
  def get_reference_pins(
@@ -27,6 +27,7 @@ This module contains these classes: ``CircuitPort``, ``CurrentSource``, ``EdbSiw
27
27
  import os
28
28
  import time
29
29
 
30
+ from pyedb.dotnet.edb_core.edb_data.padstacks_data import EDBPadstackInstance
30
31
  from pyedb.dotnet.edb_core.edb_data.simulation_configuration import (
31
32
  SimulationConfiguration,
32
33
  SourceType,
@@ -140,8 +141,14 @@ class EdbSiwave(object):
140
141
  Name of the source.
141
142
 
142
143
  """
143
- pos_pin = source.positive_node.node_pins
144
- neg_pin = source.negative_node.node_pins
144
+ if isinstance(source.positive_node.node_pins, EDBPadstackInstance):
145
+ pos_pin = source.positive_node.node_pins._edb_padstackinstance
146
+ else:
147
+ pos_pin = source.positive_node.node_pins
148
+ if isinstance(source.negative_node.node_pins, EDBPadstackInstance):
149
+ neg_pin = source.negative_node.node_pins._edb_padstackinstance
150
+ else:
151
+ neg_pin = source.negative_node.node_pins
145
152
 
146
153
  res, fromLayer_pos, toLayer_pos = pos_pin.GetLayerRange()
147
154
  res, fromLayer_neg, toLayer_neg = neg_pin.GetLayerRange()
@@ -1189,8 +1196,8 @@ class EdbSiwave(object):
1189
1196
 
1190
1197
  Parameters
1191
1198
  ----------
1192
- pins : list[Edb.Primitive.PadstackInstance]
1193
- List of EDB pins, length must be 2, since only 2 pins component are currently supported.
1199
+ pins : list[Edb.Cell.Primitive.PadstackInstance]
1200
+ List of EDB pins.
1194
1201
 
1195
1202
  component_name : str
1196
1203
  Component name.