pyedb 0.25.0__py3-none-any.whl → 0.26.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 CHANGED
@@ -44,7 +44,7 @@ deprecation_warning()
44
44
  #
45
45
 
46
46
  pyedb_path = os.path.dirname(__file__)
47
- __version__ = "0.25.0"
47
+ __version__ = "0.26.0"
48
48
  version = __version__
49
49
 
50
50
  #
@@ -113,8 +113,11 @@ class Primitive(Connectable):
113
113
  @property
114
114
  def layer(self):
115
115
  """Get the primitive edb layer object."""
116
- layer_name = self._edb_object.GetLayer().GetName()
117
- return self._pedb.stackup.all_layers[layer_name]
116
+ obj = self._edb_object.GetLayer()
117
+ if obj.IsNull():
118
+ return None
119
+ else:
120
+ return self._pedb.stackup.find_layer_by_name(obj.GetName())
118
121
 
119
122
  @property
120
123
  def layer_name(self):
@@ -84,8 +84,13 @@ class PadstackInstanceTerminal(Terminal):
84
84
  isRef=is_ref,
85
85
  )
86
86
  terminal = PadstackInstanceTerminal(self._pedb, terminal)
87
-
88
- return terminal if not terminal.is_null else False
87
+ if terminal.is_null:
88
+ msg = f"Failed to create terminal. "
89
+ if name in self._pedb.terminals:
90
+ msg += f"Terminal {name} already exists."
91
+ raise Exception(msg)
92
+ else:
93
+ return terminal
89
94
 
90
95
  def _get_parameters(self):
91
96
  """Gets the parameters of the padstack instance terminal."""
@@ -56,7 +56,13 @@ class PinGroupTerminal(Terminal):
56
56
  is_ref,
57
57
  )
58
58
  term = PinGroupTerminal(self._pedb, term)
59
- return term if not term.is_null else False
59
+ if term.is_null:
60
+ msg = f"Failed to create terminal. "
61
+ if name in self._pedb.terminals:
62
+ msg += f"Terminal {name} already exists."
63
+ raise Exception(msg)
64
+ else:
65
+ return term
60
66
 
61
67
  def pin_group(self):
62
68
  """Gets the pin group the terminal refers to."""
@@ -59,4 +59,10 @@ class PointTerminal(Terminal):
59
59
  is_ref,
60
60
  )
61
61
  terminal = PointTerminal(self._pedb, terminal)
62
- return terminal if not terminal.is_null else False
62
+ if terminal.is_null:
63
+ msg = f"Failed to create terminal. "
64
+ if name in self._pedb.terminals:
65
+ msg += f"Terminal {name} already exists."
66
+ raise Exception(msg)
67
+ else:
68
+ return terminal
@@ -23,6 +23,13 @@
23
23
  from __future__ import absolute_import
24
24
 
25
25
 
26
+ def layer_cast(pedb, edb_object):
27
+ if edb_object.IsStackupLayer():
28
+ return StackupLayerEdbClass(pedb, edb_object.Clone(), name=edb_object.GetName())
29
+ else:
30
+ return LayerEdbClass(pedb, edb_object.Clone(), name=edb_object.GetName())
31
+
32
+
26
33
  class LayerEdbClass(object):
27
34
  """Manages Edb Layers. Replaces EDBLayer."""
28
35
 
@@ -36,6 +36,7 @@ import warnings
36
36
  from pyedb.dotnet.edb_core.edb_data.layer_data import (
37
37
  LayerEdbClass,
38
38
  StackupLayerEdbClass,
39
+ layer_cast,
39
40
  )
40
41
  from pyedb.dotnet.edb_core.general import convert_py_list_to_net_list
41
42
  from pyedb.generic.general_methods import ET, generate_unique_name
@@ -284,10 +285,7 @@ class LayerCollection(object):
284
285
  layer_list = list(self._edb_object.Layers(self._pedb.edb_api.cell.layer_type_set.AllLayerSet))
285
286
  temp = dict()
286
287
  for i in layer_list:
287
- if i.IsStackupLayer():
288
- obj = StackupLayerEdbClass(self._pedb, i.Clone(), name=i.GetName())
289
- else:
290
- obj = LayerEdbClass(self._pedb, i.Clone(), name=i.GetName())
288
+ obj = layer_cast(self._pedb, i)
291
289
  temp[obj.name] = obj
292
290
  return temp
293
291
 
@@ -306,12 +304,20 @@ class LayerCollection(object):
306
304
  """
307
305
  return {name: obj for name, obj in self.all_layers.items() if obj.is_stackup_layer}
308
306
 
307
+ def find_layer_by_name(self, name: str):
308
+ """Finds a layer with the given name."""
309
+ obj = self._pedb.edb_api.cell._cell.Layer.FindByName(self._edb_object, name)
310
+ if obj.IsNull():
311
+ raise ValueError("Layer with name '{}' was not found.".format(name))
312
+ else:
313
+ return layer_cast(self._pedb, obj.Clone())
314
+
309
315
 
310
316
  class Stackup(LayerCollection):
311
317
  """Manages EDB methods for stackup accessible from `Edb.stackup` property."""
312
318
 
313
319
  def __getitem__(self, item):
314
- return self.all_layers[item]
320
+ return self.find_layer_by_name(item)
315
321
 
316
322
  def __init__(self, pedb, edb_object=None):
317
323
  super().__init__(pedb, edb_object)
@@ -1800,7 +1806,7 @@ class Stackup(LayerCollection):
1800
1806
  temp_data = {name: 0 for name, _ in self.signal_layers.items()}
1801
1807
  outline_area = 0
1802
1808
  for i in self._pedb.modeler.primitives:
1803
- layer_name = i.layer.name
1809
+ layer_name = i._edb_object.GetLayer().GetName()
1804
1810
  if layer_name.lower() == "outline":
1805
1811
  if i.area() > outline_area:
1806
1812
  outline_area = i.area()
pyedb/siwave.py CHANGED
@@ -266,6 +266,16 @@ class Siwave(object): # pragma no cover
266
266
  else:
267
267
  return False
268
268
 
269
+ @property
270
+ def file_dir(self) -> str:
271
+ """Directory path of the open project."""
272
+ return self.oproject.GetFileDir()
273
+
274
+ @property
275
+ def file_path(self) -> str:
276
+ """Path of the open project file."""
277
+ return self.oproject.GetFilePath()
278
+
269
279
  def save_project(self, projectpath=None, projectName=None):
270
280
  """Save the project.
271
281
 
@@ -283,7 +293,9 @@ class Siwave(object): # pragma no cover
283
293
 
284
294
  """
285
295
  if projectName and projectpath:
286
- self.oproject.ScrSaveProjectAs(os.path.join(projectpath, projectName + ".siw"))
296
+ if not projectName.endswith(".siw"):
297
+ projectName = projectName + ".siw"
298
+ self.oproject.ScrSaveProjectAs(os.path.join(projectpath, projectName))
287
299
  else:
288
300
  self.oproject.Save()
289
301
  return True
@@ -476,6 +488,7 @@ class Siwave(object): # pragma no cover
476
488
  if isinstance(file_path, Path):
477
489
  file_path = str(file_path)
478
490
  flag = self.oproject.ScrImportEDB(file_path)
491
+ # self.save_project(self.di)
479
492
  if flag == 0:
480
493
  self._logger.info(f"Importing EDB to {file_path}.")
481
494
  return True
@@ -493,11 +506,12 @@ class Siwave(object): # pragma no cover
493
506
  if isinstance(file_path, Path):
494
507
  file_path = str(file_path)
495
508
 
496
- temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
497
- temp_edb = os.path.join(temp_folder.name, "temp.aedb")
509
+ # temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
510
+ # temp_edb = os.path.join(temp_folder.name, "temp.aedb")
511
+
512
+ temp_edb = os.path.join(self.file_dir, "temp.aedb")
498
513
 
499
514
  self.export_edb(temp_edb)
500
- self.save_project()
501
515
  self.oproject.ScrCloseProject()
502
516
  edbapp = Edb(temp_edb, edbversion=self.current_version)
503
517
  edbapp.configuration.load(file_path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyedb
3
- Version: 0.25.0
3
+ Version: 0.26.0
4
4
  Summary: Higher-Level Pythonic Ansys Electronics Data Base
5
5
  Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
6
6
  Maintainer-email: PyEDB developers <simon.vandenbrouck@ansys.com>
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3.8
15
15
  Classifier: Programming Language :: Python :: 3.9
16
16
  Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Programming Language :: Python :: 3.11
18
- Requires-Dist: cffi>=1.16.0,<1.17; platform_system=='Linux'
18
+ Requires-Dist: cffi>=1.16.0,<1.18; platform_system=='Linux'
19
19
  Requires-Dist: pywin32 >= 303;platform_system=='Windows'
20
20
  Requires-Dist: ansys-pythonnet >= 3.1.0rc3
21
21
  Requires-Dist: dotnetcore2 ==3.1.23;platform_system=='Linux'
@@ -26,14 +26,14 @@ Requires-Dist: Rtree >= 1.2.0
26
26
  Requires-Dist: toml == 0.10.2
27
27
  Requires-Dist: scikit-rf
28
28
  Requires-Dist: ansys-sphinx-theme>=0.10.0,<1.1 ; extra == "doc"
29
- Requires-Dist: imageio>=2.30.0,<2.35 ; extra == "doc"
29
+ Requires-Dist: imageio>=2.30.0,<2.36 ; extra == "doc"
30
30
  Requires-Dist: ipython>=8.13.0,<8.27 ; extra == "doc"
31
31
  Requires-Dist: jupyterlab>=4.0.0,<4.3 ; extra == "doc"
32
32
  Requires-Dist: jupytext>=1.16.0,<1.17 ; extra == "doc"
33
33
  Requires-Dist: matplotlib>=3.5.0,<3.10 ; extra == "doc"
34
34
  Requires-Dist: nbsphinx>=0.9.0,<0.10 ; extra == "doc"
35
35
  Requires-Dist: nbconvert < 7.17 ; extra == "doc"
36
- Requires-Dist: numpydoc>=1.5.0,<1.8 ; extra == "doc"
36
+ Requires-Dist: numpydoc>=1.5.0,<1.9 ; extra == "doc"
37
37
  Requires-Dist: pypandoc>=1.10.0,<1.14 ; extra == "doc"
38
38
  Requires-Dist: recommonmark ; extra == "doc"
39
39
  Requires-Dist: Sphinx>=7.1.0,<8.1 ; extra == "doc"
@@ -1,7 +1,7 @@
1
- pyedb/__init__.py,sha256=rAP6JWOARv5TMG_5-3c-fqSFE0ILez9LAXKyut2zeSc,1521
1
+ pyedb/__init__.py,sha256=LPbrtRXIz0vH59E8iYey-OmAoq8r4GQp4vPaU_f2o3w,1521
2
2
  pyedb/edb_logger.py,sha256=yNkXnoL2me7ubLT6O6r6ElVnkZ1g8fmfFYC_2XJZ1Sw,14950
3
3
  pyedb/exceptions.py,sha256=n94xluzUks6BA24vd_L6HkrvoP_H_l6__hQmqzdCyPo,111
4
- pyedb/siwave.py,sha256=Mo-8ETIwTbPNbqfaDJkbl_G3Dp8mdtYFl54Ms9sGAZo,16004
4
+ pyedb/siwave.py,sha256=mH3wJ2e-lvAgNjAFRIkLTZ7mUjz7Gp_jm4z-QN66M88,16442
5
5
  pyedb/workflow.py,sha256=Y0ya4FUHwlSmoLP45zjdYLsSpyKduHUSpT9GGK9MGd8,814
6
6
  pyedb/component_libraries/ansys_components.py,sha256=O3ypt832IHY9zG2AD_yrRrbH2KH9P1yFaoi1EO6Zllw,4830
7
7
  pyedb/configuration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -38,7 +38,7 @@ pyedb/dotnet/edb_core/net_class.py,sha256=4U6Cc1Gn7ZJ_ub9uKmtrsoz5wD1XS42afci3Y3
38
38
  pyedb/dotnet/edb_core/nets.py,sha256=JZvrlPOKiRjbHAX6GkrYKvaXujHS3lz-rucS0Ib8ezk,43213
39
39
  pyedb/dotnet/edb_core/padstack.py,sha256=al5cXfnJXyaM6-KCAd8D8-TZzcIXHwco8grD44U7gNY,63588
40
40
  pyedb/dotnet/edb_core/siwave.py,sha256=4duoAsFCuPMNLxtMTEEVJCUaHKNkdbLDmtTXiD93VrM,64311
41
- pyedb/dotnet/edb_core/stackup.py,sha256=_jvmLHpo5_4CM8V_xnB81WQrqJGsEHs3eECS8Y-buaQ,119804
41
+ pyedb/dotnet/edb_core/stackup.py,sha256=b56leXg7X7dEVPP2DUD9n8LZIakWcjIsjiqqkIWsyZU,120035
42
42
  pyedb/dotnet/edb_core/cell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
43
  pyedb/dotnet/edb_core/cell/connectable.py,sha256=rKWPATg0GCHi4d1ftu2V7WWhkDONjloCSPujssie5a8,2310
44
44
  pyedb/dotnet/edb_core/cell/layout.py,sha256=u3HEdKc7rls3gkm7m31-XGi6l3pfoHEAswTVCz4FSmY,12619
@@ -55,13 +55,13 @@ pyedb/dotnet/edb_core/cell/hierarchy/spice_model.py,sha256=SGiUcan2l0n8DGk3GtwCs
55
55
  pyedb/dotnet/edb_core/cell/primitive/__init__.py,sha256=8jByHkoaowAYQTCww-zRrTQmN061fLz_OHjTLSrzQQY,58
56
56
  pyedb/dotnet/edb_core/cell/primitive/bondwire.py,sha256=fqIMdv0bNvk591DG6De5c--w9Rpkl5AOeo_qgzoPE6M,7322
57
57
  pyedb/dotnet/edb_core/cell/primitive/path.py,sha256=XVN7dOVpccoBP28M8l5iMzK5QSQdHqpKqC4jK76UTis,12543
58
- pyedb/dotnet/edb_core/cell/primitive/primitive.py,sha256=IMGIaPCY8wpq3uInizwc1ObmdsTn5kg9YEqk9uztRuU,29764
58
+ pyedb/dotnet/edb_core/cell/primitive/primitive.py,sha256=L9MNMc1OD8g_ghN2fhtdxa8v6jv6FY8D7oj7fF2A4vw,29825
59
59
  pyedb/dotnet/edb_core/cell/terminal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
60
  pyedb/dotnet/edb_core/cell/terminal/bundle_terminal.py,sha256=qM0wEXkZ-DpoJ6vlVa560Ce8IgOdp4vyIJPedvoa3O0,1977
61
61
  pyedb/dotnet/edb_core/cell/terminal/edge_terminal.py,sha256=lafPRrvsDPYKcysvrkO-5tEZXF3h4IcTXdeJgTjleuI,2158
62
- pyedb/dotnet/edb_core/cell/terminal/padstack_instance_terminal.py,sha256=HOMNvSj8thN3RgSg2eDb_CE8PpqkcVLrIYPZGOW-IQk,3803
63
- pyedb/dotnet/edb_core/cell/terminal/pingroup_terminal.py,sha256=M5qZNH-MLDkgSJABNVKmnBLyLgezm2fqJGl70EyPVUo,2586
64
- pyedb/dotnet/edb_core/cell/terminal/point_terminal.py,sha256=DafZBGjUx_OE8gZWcUKPh4cH3BRkJSj9XolhzIPOE3I,2400
62
+ pyedb/dotnet/edb_core/cell/terminal/padstack_instance_terminal.py,sha256=XI7NiP1qT2aft7hjPK4gX42RzreiZ66aHXIHFPwUghs,3999
63
+ pyedb/dotnet/edb_core/cell/terminal/pingroup_terminal.py,sha256=3y2UXqg8a7W74pjzZDljB1joCPTtmOkrIKGophDdgw4,2783
64
+ pyedb/dotnet/edb_core/cell/terminal/point_terminal.py,sha256=S3aCAuFc_QA36PVn2Cdb9L4dO3T4IikwyEVcP1FOW3I,2597
65
65
  pyedb/dotnet/edb_core/cell/terminal/terminal.py,sha256=x-xUwqg1ZJQTgubuNSd3qistl982kAvSXNvAoNohcfg,19276
66
66
  pyedb/dotnet/edb_core/definition/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
67
  pyedb/dotnet/edb_core/definition/component_def.py,sha256=tYZ4L6DigwSjdQJ5AlqEbordPVZyJ6hYFNc6b3QnJ18,6514
@@ -77,7 +77,7 @@ pyedb/dotnet/edb_core/edb_data/control_file.py,sha256=_W5DDBFvm4gTq8yCvhzfiWUsfp
77
77
  pyedb/dotnet/edb_core/edb_data/design_options.py,sha256=RO9ip-T5Bfxpsl97_QEk0qDZsza3tLzIX2t25XLutys,2057
78
78
  pyedb/dotnet/edb_core/edb_data/edbvalue.py,sha256=Vj_11HXsQUNavizKp5FicORm6cjhXRh9uvxhv_D_RJc,1977
79
79
  pyedb/dotnet/edb_core/edb_data/hfss_extent_info.py,sha256=hKFHWUl0_OCMEZJbQn5c8Y1a-BYKr8nAycIlrCoeufk,13005
80
- pyedb/dotnet/edb_core/edb_data/layer_data.py,sha256=B6cClg5KTcKUn33jYccTN0uNZZ5dQ037WHCsI-vg3Us,25748
80
+ pyedb/dotnet/edb_core/edb_data/layer_data.py,sha256=2K1rvBXAWg3s8paNU6TPNb5tC1B3bRHmiUZjVsoX_Z8,26001
81
81
  pyedb/dotnet/edb_core/edb_data/nets_data.py,sha256=Ifi5uSfnOuTLwesO9TS3_F-qa_8rpPXrJy6W5lvIWik,9684
82
82
  pyedb/dotnet/edb_core/edb_data/padstacks_data.py,sha256=wOBO86cFGnx8OIsALzlQv59XeSGBhUYhJa7rksySGRE,77523
83
83
  pyedb/dotnet/edb_core/edb_data/ports.py,sha256=wr2RQi8VExuNIVmnp7c4VpTIhODgthmJmHr01zO4ueo,8873
@@ -185,7 +185,7 @@ pyedb/misc/siw_feature_config/xtalk_scan/scan_config.py,sha256=YmYI6WTQulL5Uf8Wx
185
185
  pyedb/misc/siw_feature_config/xtalk_scan/td_xtalk_config.py,sha256=KHa-UqcXuabiVfT2CV-UvWl5Q2qGYHF2Ye9azcAlnXc,3966
186
186
  pyedb/modeler/geometry_operators.py,sha256=g_Sy7a6R23sP6RtboJn1rl8uTuo8oeLmMF21rNkzwjk,74198
187
187
  pyedb/siwave_core/icepak.py,sha256=WnZ-t8mik7LDY06V8hZFV-TxRZJQWK7bu_8Ichx-oBs,5206
188
- pyedb-0.25.0.dist-info/LICENSE,sha256=qQWivZ12ETN5l3QxvTARY-QI5eoRRlyHdwLlAj0Bg5I,1089
189
- pyedb-0.25.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
190
- pyedb-0.25.0.dist-info/METADATA,sha256=ldmFsRmsGY4Dy4YbEZBpH5YY_xQN4jUdqU5FC3611SA,8386
191
- pyedb-0.25.0.dist-info/RECORD,,
188
+ pyedb-0.26.0.dist-info/LICENSE,sha256=qQWivZ12ETN5l3QxvTARY-QI5eoRRlyHdwLlAj0Bg5I,1089
189
+ pyedb-0.26.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
190
+ pyedb-0.26.0.dist-info/METADATA,sha256=jAmjbUO3XTLpJ7Y-PIpgYQvcktdrERXU9caJNfVcSXc,8386
191
+ pyedb-0.26.0.dist-info/RECORD,,
File without changes