pyedb 0.18.0__py3-none-any.whl → 0.20.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 (54) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_data.py +8 -11
  3. pyedb/configuration/cfg_nets.py +14 -0
  4. pyedb/configuration/cfg_pin_groups.py +57 -20
  5. pyedb/configuration/cfg_ports_sources.py +248 -60
  6. pyedb/configuration/configuration.py +51 -17
  7. pyedb/dotnet/edb.py +156 -236
  8. pyedb/dotnet/edb_core/cell/connectable.py +64 -0
  9. pyedb/dotnet/edb_core/cell/hierarchy/component.py +12 -10
  10. pyedb/dotnet/edb_core/cell/hierarchy/hierarchy_obj.py +1 -1
  11. pyedb/dotnet/edb_core/cell/layout.py +271 -76
  12. pyedb/dotnet/edb_core/cell/layout_obj.py +4 -49
  13. pyedb/dotnet/edb_core/cell/primitive.py +14 -2
  14. pyedb/dotnet/edb_core/cell/terminal/padstack_instance_terminal.py +10 -0
  15. pyedb/dotnet/edb_core/cell/terminal/pingroup_terminal.py +5 -0
  16. pyedb/dotnet/edb_core/cell/terminal/point_terminal.py +1 -12
  17. pyedb/dotnet/edb_core/cell/terminal/terminal.py +36 -20
  18. pyedb/dotnet/edb_core/cell/voltage_regulator.py +2 -16
  19. pyedb/dotnet/edb_core/components.py +88 -31
  20. pyedb/dotnet/edb_core/dotnet/database.py +5 -10
  21. pyedb/dotnet/edb_core/dotnet/primitive.py +20 -7
  22. pyedb/dotnet/edb_core/edb_data/control_file.py +2 -12
  23. pyedb/dotnet/edb_core/edb_data/padstacks_data.py +28 -37
  24. pyedb/dotnet/edb_core/edb_data/ports.py +0 -18
  25. pyedb/dotnet/edb_core/edb_data/primitives_data.py +1 -1
  26. pyedb/dotnet/edb_core/general.py +6 -9
  27. pyedb/dotnet/edb_core/hfss.py +4 -8
  28. pyedb/dotnet/edb_core/layout_obj_instance.py +30 -0
  29. pyedb/dotnet/edb_core/materials.py +4 -11
  30. pyedb/dotnet/edb_core/{layout.py → modeler.py} +153 -7
  31. pyedb/dotnet/edb_core/net_class.py +7 -8
  32. pyedb/dotnet/edb_core/nets.py +3 -9
  33. pyedb/dotnet/edb_core/padstack.py +23 -10
  34. pyedb/dotnet/edb_core/sim_setup_data/data/sim_setup_info.py +42 -3
  35. pyedb/dotnet/edb_core/sim_setup_data/data/simulation_settings.py +92 -158
  36. pyedb/dotnet/edb_core/sim_setup_data/data/siw_dc_ir_settings.py +22 -22
  37. pyedb/dotnet/edb_core/sim_setup_data/data/sweep_data.py +5 -2
  38. pyedb/dotnet/edb_core/sim_setup_data/io/siwave.py +76 -76
  39. pyedb/dotnet/edb_core/siwave.py +5 -6
  40. pyedb/dotnet/edb_core/stackup.py +18 -23
  41. pyedb/dotnet/edb_core/utilities/hfss_simulation_setup.py +23 -94
  42. pyedb/dotnet/edb_core/utilities/simulation_setup.py +40 -41
  43. pyedb/dotnet/edb_core/utilities/siwave_simulation_setup.py +26 -17
  44. pyedb/generic/filesystem.py +2 -8
  45. pyedb/generic/general_methods.py +4 -10
  46. pyedb/generic/plot.py +26 -29
  47. pyedb/generic/process.py +2 -6
  48. pyedb/misc/downloads.py +3 -40
  49. pyedb/siwave.py +2 -5
  50. {pyedb-0.18.0.dist-info → pyedb-0.20.0.dist-info}/METADATA +8 -8
  51. {pyedb-0.18.0.dist-info → pyedb-0.20.0.dist-info}/RECORD +53 -52
  52. pyedb/dotnet/edb_core/dotnet/layout.py +0 -260
  53. {pyedb-0.18.0.dist-info → pyedb-0.20.0.dist-info}/LICENSE +0 -0
  54. {pyedb-0.18.0.dist-info → pyedb-0.20.0.dist-info}/WHEEL +0 -0
@@ -38,27 +38,26 @@ from pyedb.dotnet.edb_core.edb_data.layer_data import (
38
38
  StackupLayerEdbClass,
39
39
  )
40
40
  from pyedb.dotnet.edb_core.general import convert_py_list_to_net_list
41
- from pyedb.generic.general_methods import ET, generate_unique_name, is_ironpython
41
+ from pyedb.generic.general_methods import ET, generate_unique_name
42
42
  from pyedb.misc.aedtlib_personalib_install import write_pretty_xml
43
43
 
44
44
  colors = None
45
45
  pd = None
46
46
  np = None
47
- if not is_ironpython:
48
- try:
49
- import matplotlib.colors as colors
50
- except ImportError:
51
- colors = None
52
-
53
- try:
54
- import numpy as np
55
- except ImportError:
56
- np = None
57
-
58
- try:
59
- import pandas as pd
60
- except ImportError:
61
- pd = None
47
+ try:
48
+ import matplotlib.colors as colors
49
+ except ImportError:
50
+ colors = None
51
+
52
+ try:
53
+ import numpy as np
54
+ except ImportError:
55
+ np = None
56
+
57
+ try:
58
+ import pandas as pd
59
+ except ImportError:
60
+ pd = None
62
61
 
63
62
  logger = logging.getLogger(__name__)
64
63
 
@@ -970,8 +969,7 @@ class Stackup(LayerCollection):
970
969
  if not pd:
971
970
  self._pedb.logger.error("Pandas is needed. Please, install it first.")
972
971
  return False
973
- if is_ironpython:
974
- return
972
+
975
973
  data = {
976
974
  "Type": [],
977
975
  "Material": [],
@@ -1972,9 +1970,7 @@ class Stackup(LayerCollection):
1972
1970
  if not pd:
1973
1971
  self._pedb.logger.error("Pandas is needed. You must install it first.")
1974
1972
  return False
1975
- if is_ironpython:
1976
- self._pedb.logger.error("Method works on CPython only.")
1977
- return False
1973
+
1978
1974
  df = pd.read_csv(file_path, index_col=0)
1979
1975
 
1980
1976
  for name in self.stackup_layers.keys(): # pragma: no cover
@@ -2451,8 +2447,7 @@ class Stackup(LayerCollection):
2451
2447
  -------
2452
2448
  :class:`matplotlib.plt`
2453
2449
  """
2454
- if is_ironpython:
2455
- return False
2450
+
2456
2451
  from pyedb.generic.constants import CSS4_COLORS
2457
2452
  from pyedb.generic.plot import plot_matplotlib
2458
2453
 
@@ -20,7 +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
- import warnings
24
23
 
25
24
  from pyedb.dotnet.edb_core.sim_setup_data.data.mesh_operation import (
26
25
  LengthMeshOperation,
@@ -37,10 +36,6 @@ from pyedb.dotnet.edb_core.sim_setup_data.data.settings import (
37
36
  ViaSettings,
38
37
  )
39
38
  from pyedb.dotnet.edb_core.sim_setup_data.data.sim_setup_info import SimSetupInfo
40
- from pyedb.dotnet.edb_core.sim_setup_data.data.simulation_settings import (
41
- HFSSPISimulationSettings,
42
- )
43
- from pyedb.dotnet.edb_core.sim_setup_data.data.sweep_data import SweepData
44
39
  from pyedb.dotnet.edb_core.utilities.simulation_setup import SimulationSetup
45
40
  from pyedb.generic.general_methods import generate_unique_name
46
41
 
@@ -58,37 +53,36 @@ class HfssSimulationSetup(SimulationSetup):
58
53
  self._edb_object = self._simulation_setup_builder(sim_setup_info._edb_object)
59
54
  self._update_setup()
60
55
 
61
- @property
62
- def get_sim_setup_info(self):
63
- """Get simulation setup information."""
64
- warnings.warn("Use new property :func:`sim_setup_info` instead.", DeprecationWarning)
65
- return self.sim_setup_info._edb_object
66
-
67
56
  @property
68
57
  def solver_slider_type(self):
69
58
  """Solver slider type.
70
59
  Options are:
71
- 1 - ``kFast``.
72
- 2 - ``kMedium``.
73
- 3 - ``kAccurate``.
74
- 4 - ``kNumSliderTypes``.
60
+ 1 - ``Fast``.
61
+ 2 - ``Medium``.
62
+ 3 - ``Accurate``.
75
63
 
76
64
  Returns
77
65
  -------
78
- str
66
+ int
79
67
  """
80
- return self.get_sim_setup_info.SimulationSettings.TSolveSliderType.ToString()
68
+ solver_types = {
69
+ "kFast": 0,
70
+ "kMedium": 1,
71
+ "kAccurate": 2,
72
+ "kNumSliderTypes": 3,
73
+ }
74
+ return solver_types[self.sim_setup_info.simulation_settings.SolveSliderType.ToString()]
81
75
 
82
76
  @solver_slider_type.setter
83
77
  def solver_slider_type(self, value):
84
78
  """Set solver slider type."""
85
79
  solver_types = {
86
- "kFast": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaWirebond,
87
- "kMedium": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaRibbon,
88
- "kAccurate": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaMesh,
89
- "kNumSliderTypes": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaField,
80
+ 0: self.sim_setup_info.simulation_settings.TSolveSliderType.kFast,
81
+ 1: self.sim_setup_info.simulation_settings.TSolveSliderType.kMedium,
82
+ 2: self.sim_setup_info.simulation_settings.TSolveSliderType.kAccurate,
83
+ 3: self.sim_setup_info.simulation_settings.TSolveSliderType.kNumSliderTypes,
90
84
  }
91
- self.get_sim_setup_info.SimulationSettings.TSolveSliderType = solver_types[value]
85
+ self.sim_setup_info.simulation_settings.SolveSliderType = solver_types[value]
92
86
  self._update_setup()
93
87
 
94
88
  @property
@@ -393,77 +387,12 @@ class HfssSimulationSetup(SimulationSetup):
393
387
  class HFSSPISimulationSetup(SimulationSetup):
394
388
  """Manages EDB methods for HFSSPI simulation setup."""
395
389
 
396
- def __init__(self, pedb, edb_object=None):
390
+ def __init__(self, pedb, edb_object=None, name: str = None):
397
391
  super().__init__(pedb, edb_object)
398
- self._edb_object = edb_object
399
- self._pedb = pedb
400
- self._setup_type = "kHFSSPI"
401
- self._edb_setup_info = None
402
- self.logger = self._pedb.logger
403
-
404
- def create(self, name=None):
405
- """Create an HFSS setup."""
406
- self._name = name
407
- self._create(name=name, simulation_setup_type=self._setup_type)
408
- return self
409
-
410
- @property
411
- def setup_type(self):
412
- return self._setup_type
413
-
414
- @property
415
- def settings(self):
416
- return HFSSPISimulationSettings(self._edb_setup_info, self._pedb, self._edb_object)
417
-
418
- @property
419
- def enabled(self):
420
- return self.settings.enabled
421
-
422
- @enabled.setter
423
- def enabled(self, value):
424
- if isinstance(value, bool):
425
- self.settings.enabled = value
426
- else:
427
- self.logger.error(f"Property enabled expects a boolean value while the provided value is {value}.")
428
-
429
- @property
430
- def position(self):
431
- return self._edb_setup_info.Position
432
392
 
433
- @position.setter
434
- def position(self, value):
435
- if isinstance(value, int):
436
- self._edb_setup_info.Position = value
437
- else:
438
- self.logger.error(f"Property position expects an integer value while the provided value is {value}.")
439
-
440
- def add_frequency_sweep(self, name=None, frequency_sweep=None):
441
- """Add frequency sweep.
442
-
443
- Parameters
444
- ----------
445
- name : str, optional
446
- Name of the frequency sweep.
447
- frequency_sweep : list, optional
448
- List of frequency points.
449
-
450
- Returns
451
- -------
452
- :class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.EdbFrequencySweep`wheen succeeded, ``False``
453
- when failed.
454
-
455
- Examples
456
- --------
457
- >>> setup1 = edbapp.create_hfss_setup("setup1")
458
- >>> setup1.add_frequency_sweep(frequency_sweep=[
459
- ... ["linear count", "0", "1kHz", 1],
460
- ... ["log scale", "1kHz", "0.1GHz", 10],
461
- ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"],
462
- ... ])
463
- """
464
- if name in self.frequency_sweeps:
465
- self.logger.error("Frequency sweep with same name already defined.")
466
- return False
467
- if not name:
468
- name = generate_unique_name("sweep")
469
- return SweepData(self, frequency_sweep, name)
393
+ self._simulation_setup_builder = self._pedb._edb.Utility.HFSSPISimulationSetup
394
+ if edb_object is None:
395
+ self._name = name
396
+ sim_setup_info = SimSetupInfo(self._pedb, sim_setup=self, setup_type="kHFSSPI", name=name)
397
+ self._edb_object = self._simulation_setup_builder(sim_setup_info._edb_object)
398
+ self._update_setup()
@@ -100,16 +100,33 @@ class SimulationSetup(object):
100
100
 
101
101
  @property
102
102
  def sim_setup_info(self):
103
- if self._edb_object:
104
- if self._edb_object.GetType().ToString() not in ["kHFSSPI", "kRaptorX"]:
105
- return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self._edb_object.GetSimSetupInfo())
106
- elif self._edb_setup_info:
107
- return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self._edb_setup_info)
103
+ return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self._edb_object.GetSimSetupInfo())
108
104
 
109
- @sim_setup_info.setter
110
- def sim_setup_info(self, sim_setup_info):
105
+ def set_sim_setup_info(self, sim_setup_info):
111
106
  self._edb_object = self._simulation_setup_builder(sim_setup_info._edb_object)
112
107
 
108
+ @property
109
+ def get_sim_setup_info(self):
110
+ """Get simulation setup information."""
111
+ warnings.warn("Use new property :func:`sim_setup_info` instead.", DeprecationWarning)
112
+ return self.sim_setup_info._edb_object
113
+
114
+ def get_simulation_settings(self):
115
+ sim_settings = self.sim_setup_info.simulation_settings
116
+ properties = {}
117
+ for k in dir(sim_settings):
118
+ if not k.startswith("_"):
119
+ properties[k] = getattr(sim_settings, k)
120
+ return properties
121
+
122
+ def set_simulation_settings(self, sim_settings: dict):
123
+ for k, v in sim_settings.items():
124
+ if k == "enabled":
125
+ continue
126
+ if k in self.get_simulation_settings():
127
+ setattr(self.sim_setup_info.simulation_settings, k, v)
128
+ self._update_setup()
129
+
113
130
  @property
114
131
  def setup_type(self):
115
132
  return self.sim_setup_info.sim_setup_type
@@ -126,11 +143,6 @@ class SimulationSetup(object):
126
143
 
127
144
  edb_setup_info = self._pedb.simsetupdata.SimSetupInfo[self._simulation_setup_type[simulation_setup_type]]()
128
145
  edb_setup_info.Name = name
129
- if (
130
- edb_setup_info.get_SimSetupType().ToString() == "kRaptorX"
131
- or edb_setup_info.get_SimSetupType().ToString() == "kHFSSPI"
132
- ):
133
- self._edb_setup_info = edb_setup_info
134
146
  self._edb_object = self._set_edb_setup_info(edb_setup_info)
135
147
  self._update_setup()
136
148
 
@@ -156,11 +168,10 @@ class SimulationSetup(object):
156
168
 
157
169
  if float(self._pedb.edbversion) >= 2024.2:
158
170
  setup_type_mapping["kRaptorX"] = utility.RaptorXSimulationSetup
159
- if float(self._pedb.edbversion) >= 2025.1:
160
171
  setup_type_mapping["kHFSSPI"] = utility.HFSSPISimulationSetup
161
172
  sim_setup_type = self.sim_setup_info.sim_setup_type
162
- setup_utility = setup_type_mapping[sim_setup_type.ToString()]
163
- return setup_utility(edb_setup_info)
173
+ setup_utility = setup_type_mapping[sim_setup_type]
174
+ return setup_utility(edb_setup_info._edb_object)
164
175
 
165
176
  @property
166
177
  def mesh_operations(self):
@@ -181,13 +192,11 @@ class SimulationSetup(object):
181
192
  @property
182
193
  def enabled(self):
183
194
  """Flag indicating if the setup is enabled."""
184
- return self.get_sim_setup_info.SimulationSettings.Enabled
195
+ return self.get_simulation_settings()["enabled"]
185
196
 
186
197
  @enabled.setter
187
- def enabled(self, value):
188
- self.get_sim_setup_info.SimulationSettings.Enabled = value
189
- self._edb_object = self._set_edb_setup_info(self.get_sim_setup_info)
190
- self._update_setup()
198
+ def enabled(self, value: bool):
199
+ self.set_simulation_settings({"enabled": value})
191
200
 
192
201
  @property
193
202
  def name(self):
@@ -197,8 +206,8 @@ class SimulationSetup(object):
197
206
  @name.setter
198
207
  def name(self, value):
199
208
  self._pedb.layout.cell.DeleteSimulationSetup(self.name)
200
- edb_setup_info = self.get_sim_setup_info
201
- edb_setup_info.Name = value
209
+ edb_setup_info = self.sim_setup_info
210
+ edb_setup_info.name = value
202
211
  self._name = value
203
212
  self._edb_object = self._set_edb_setup_info(edb_setup_info)
204
213
  self._update_setup()
@@ -206,19 +215,19 @@ class SimulationSetup(object):
206
215
  @property
207
216
  def position(self):
208
217
  """Position in the setup list."""
209
- return self.get_sim_setup_info.Position
218
+ return self.sim_setup_info.position
210
219
 
211
220
  @position.setter
212
221
  def position(self, value):
213
- edb_setup_info = self.get_sim_setup_info.SimulationSettings
214
- edb_setup_info.Position = value
222
+ edb_setup_info = self.sim_setup_info.simulation_settings
223
+ edb_setup_info.position = value
215
224
  self._set_edb_setup_info(edb_setup_info)
216
225
  self._update_setup()
217
226
 
218
227
  @property
219
228
  def setup_type(self):
220
229
  """Type of the setup."""
221
- return self.get_sim_setup_info.SimSetupType.ToString()
230
+ return self.sim_setup_info.sim_setup_type
222
231
 
223
232
  @property
224
233
  def frequency_sweeps(self):
@@ -228,14 +237,7 @@ class SimulationSetup(object):
228
237
  @property
229
238
  def sweeps(self):
230
239
  """List of frequency sweeps."""
231
- temp = {}
232
- if self.setup_type in ("kRaptorX", "kHFSSPI"):
233
- sweep_data_list = self._edb_setup_info.SweepDataList
234
- for i in list(sweep_data_list):
235
- temp[i.Name] = SweepData(self, None, i.Name, i)
236
- return temp
237
- else:
238
- return {i.name: i for i in self.sim_setup_info.sweep_data_list}
240
+ return {i.name: i for i in self.sim_setup_info.sweep_data_list}
239
241
 
240
242
  def add_sweep(self, name, frequency_set: list = None, **kwargs):
241
243
  """Add frequency sweep.
@@ -278,7 +280,7 @@ class SimulationSetup(object):
278
280
 
279
281
  ss_info = self.sim_setup_info
280
282
  ss_info.add_sweep_data(sweep_data)
281
- self.sim_setup_info = ss_info
283
+ self.set_sim_setup_info(ss_info)
282
284
  self._update_setup()
283
285
  return sweep_data
284
286
 
@@ -291,10 +293,7 @@ class SimulationSetup(object):
291
293
  """
292
294
  warnings.warn("Use new property :func:`add_sweep_data` instead.", DeprecationWarning)
293
295
  self._sweep_list[sweep_data.name] = sweep_data
294
- if self.setup_type in ["kRaptorX", "kHFSSPI"]:
295
- edb_setup_info = self._edb_setup_info
296
- else:
297
- edb_setup_info = self.get_sim_setup_info
296
+ edb_setup_info = self.sim_setup_info
298
297
 
299
298
  if self._setup_type in ["kSIwave", "kHFSS", "kRaptorX", "kHFSSPI"]:
300
299
  for _, v in self._sweep_list.items():
@@ -317,9 +316,9 @@ class SimulationSetup(object):
317
316
  fsweep = []
318
317
  if self.frequency_sweeps:
319
318
  fsweep = [val for key, val in self.frequency_sweeps.items() if not key == name]
320
- self.get_sim_setup_info.SweepDataList.Clear()
319
+ self.sim_setup_info._edb_object.SweepDataList.Clear()
321
320
  for i in fsweep:
322
- self.get_sim_setup_info.SweepDataList.Add(i._edb_object)
321
+ self.sim_setup_info._edb_object.SweepDataList.Add(i._edb_object)
323
322
  self._update_setup()
324
323
  return True if name in self.frequency_sweeps else False
325
324
 
@@ -132,19 +132,19 @@ class SiwaveSimulationSetup(SimulationSetup):
132
132
  @property
133
133
  def sim_setup_info(self):
134
134
  """Overrides the default sim_setup_info object."""
135
- return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self.get_sim_setup_info)
135
+ return self.get_sim_setup_info
136
136
 
137
137
  @sim_setup_info.setter
138
138
  def sim_setup_info(self, sim_setup_info):
139
139
  self._edb_object = self._simulation_setup_builder(sim_setup_info._edb_object)
140
140
 
141
141
  @property
142
- def get_sim_setup_info(self):
142
+ def get_sim_setup_info(self): # todo remove after refactoring
143
143
  """Get simulation information from the setup."""
144
144
 
145
145
  sim_setup_info = SimSetupInfo(self._pedb, sim_setup=self, setup_type="kSIwave", name=self._edb_object.GetName())
146
146
  clone_edb_sim_setup_info(source=self._edb_object, target=sim_setup_info._edb_object)
147
- return sim_setup_info._edb_object
147
+ return sim_setup_info
148
148
 
149
149
  def set_pi_slider(self, value):
150
150
  """Set SIwave PI simulation accuracy level.
@@ -173,15 +173,24 @@ class SiwaveSimulationSetup(SimulationSetup):
173
173
  self.si_slider_position = value
174
174
  self.advanced_settings.set_si_slider(value)
175
175
 
176
+ @property
177
+ def enabled(self):
178
+ """Flag indicating if the setup is enabled."""
179
+ return self.sim_setup_info.simulation_settings.Enabled
180
+
181
+ @enabled.setter
182
+ def enabled(self, value: bool):
183
+ self.sim_setup_info.simulation_settings.Enabled = value
184
+
176
185
  @property
177
186
  def pi_slider_position(self):
178
187
  """PI solider position. Values are from ``1`` to ``3``."""
179
- return self.get_sim_setup_info.SimulationSettings.PISliderPos
188
+ return self.get_sim_setup_info.simulation_settings.PISliderPos
180
189
 
181
190
  @pi_slider_position.setter
182
191
  def pi_slider_position(self, value):
183
192
  edb_setup_info = self.get_sim_setup_info
184
- edb_setup_info.SimulationSettings.PISliderPos = value
193
+ edb_setup_info.simulation_settings.PISliderPos = value
185
194
  self._edb_object = self._set_edb_setup_info(edb_setup_info)
186
195
  self._update_setup()
187
196
 
@@ -192,12 +201,12 @@ class SiwaveSimulationSetup(SimulationSetup):
192
201
  @property
193
202
  def si_slider_position(self):
194
203
  """SI slider position. Values are from ``1`` to ``3``."""
195
- return self.get_sim_setup_info.SimulationSettings.SISliderPos
204
+ return self.get_sim_setup_info.simulation_settings.SISliderPos
196
205
 
197
206
  @si_slider_position.setter
198
207
  def si_slider_position(self, value):
199
208
  edb_setup_info = self.get_sim_setup_info
200
- edb_setup_info.SimulationSettings.SISliderPos = value
209
+ edb_setup_info.simulation_settings.SISliderPos = value
201
210
  self._edb_object = self._set_edb_setup_info(edb_setup_info)
202
211
  self._update_setup()
203
212
 
@@ -213,12 +222,12 @@ class SiwaveSimulationSetup(SimulationSetup):
213
222
  -------
214
223
  bool
215
224
  """
216
- return self.get_sim_setup_info.SimulationSettings.UseCustomSettings
225
+ return self.get_sim_setup_info.simulation_settings.UseCustomSettings
217
226
 
218
227
  @use_custom_settings.setter
219
228
  def use_custom_settings(self, value):
220
229
  edb_setup_info = self.get_sim_setup_info
221
- edb_setup_info.SimulationSettings.UseCustomSettings = value
230
+ edb_setup_info.simulation_settings.UseCustomSettings = value
222
231
  self._edb_object = self._set_edb_setup_info(edb_setup_info)
223
232
  self._update_setup()
224
233
 
@@ -230,12 +239,12 @@ class SiwaveSimulationSetup(SimulationSetup):
230
239
  -------
231
240
  bool
232
241
  """
233
- return self.get_sim_setup_info.SimulationSettings.UseSISettings
242
+ return self.get_sim_setup_info.simulation_settings.UseSISettings
234
243
 
235
244
  @use_si_settings.setter
236
245
  def use_si_settings(self, value):
237
246
  edb_setup_info = self.get_sim_setup_info
238
- edb_setup_info.SimulationSettings.UseSISettings = value
247
+ edb_setup_info.simulation_settings.UseSISettings = value
239
248
  self._edb_object = self._set_edb_setup_info(edb_setup_info)
240
249
  self._update_setup()
241
250
 
@@ -268,21 +277,21 @@ class SiwaveDCSimulationSetup(SimulationSetup):
268
277
  @property
269
278
  def sim_setup_info(self):
270
279
  """Overrides the default sim_setup_info object."""
271
- return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self.get_sim_setup_info)
280
+ return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self.get_sim_setup_info._edb_object)
272
281
 
273
282
  @sim_setup_info.setter
274
283
  def sim_setup_info(self, sim_setup_info):
275
284
  self._edb_object = self._simulation_setup_builder(sim_setup_info._edb_object)
276
285
 
277
286
  @property
278
- def get_sim_setup_info(self):
287
+ def get_sim_setup_info(self): # todo remove after refactoring
279
288
  """Get simulation information from the setup."""
280
-
289
+ warnings.warn("Use new property :func:`sim_setup_info` instead.", DeprecationWarning)
281
290
  sim_setup_info = SimSetupInfo(
282
291
  self._pedb, sim_setup=self, setup_type="kSIwaveDCIR", name=self._edb_object.GetName()
283
292
  )
284
293
  clone_edb_sim_setup_info(source=self._edb_object, target=sim_setup_info._edb_object)
285
- return sim_setup_info._edb_object
294
+ return sim_setup_info
286
295
 
287
296
  @property
288
297
  def dc_ir_settings(self):
@@ -340,7 +349,7 @@ class SiwaveDCSimulationSetup(SimulationSetup):
340
349
  {str, int}, keys is source name, value int 0 unspecified, 1 negative node, 2 positive one.
341
350
 
342
351
  """
343
- return convert_netdict_to_pydict(self.get_sim_setup_info.SimulationSettings.DCIRSettings.SourceTermsToGround)
352
+ return convert_netdict_to_pydict(self.get_sim_setup_info.simulation_settings.DCIRSettings.SourceTermsToGround)
344
353
 
345
354
  def add_source_terminal_to_ground(self, source_name, terminal=0):
346
355
  """Add a source terminal to ground.
@@ -363,7 +372,7 @@ class SiwaveDCSimulationSetup(SimulationSetup):
363
372
  """
364
373
  terminals = self.source_terms_to_ground
365
374
  terminals[source_name] = terminal
366
- self.get_sim_setup_info.SimulationSettings.DCIRSettings.SourceTermsToGround = convert_pydict_to_netdict(
375
+ self.get_sim_setup_info.simulation_settings.DCIRSettings.SourceTermsToGround = convert_pydict_to_netdict(
367
376
  terminals
368
377
  )
369
378
  return self._update_setup()
@@ -16,16 +16,10 @@ def search_files(dirname, pattern="*"):
16
16
  -------
17
17
  list
18
18
  """
19
- from pyedb.generic.general_methods import is_ironpython
20
19
 
21
- if is_ironpython:
22
- import glob
20
+ import pathlib
23
21
 
24
- return list(glob.glob(os.path.join(dirname, pattern)))
25
- else:
26
- import pathlib
27
-
28
- return [os.path.abspath(i) for i in pathlib.Path(dirname).glob(pattern)]
22
+ return [os.path.abspath(i) for i in pathlib.Path(dirname).glob(pattern)]
29
23
 
30
24
 
31
25
  def my_location():
@@ -47,11 +47,9 @@ from pyedb.exceptions import MaterialModelException
47
47
  from pyedb.generic.constants import CSS4_COLORS
48
48
  from pyedb.generic.settings import settings
49
49
 
50
- is_ironpython = "IronPython" in sys.version or ".NETFramework" in sys.version
51
50
  is_linux = os.name == "posix"
52
51
  is_windows = not is_linux
53
52
  _pythonver = sys.version_info[0]
54
- inside_desktop = True if is_ironpython and "4.0.30319.42000" in sys.version else False
55
53
 
56
54
 
57
55
  try:
@@ -868,10 +866,7 @@ def read_xlsx(filename): # pragma: no cover
868
866
 
869
867
 
870
868
  def write_csv(output, list_data, delimiter=",", quotechar="|", quoting=csv.QUOTE_MINIMAL): # pragma: no cover
871
- if is_ironpython:
872
- f = open(output, "wb")
873
- else:
874
- f = open(output, "w", newline="")
869
+ f = open(output, "w", newline="")
875
870
  writer = csv.writer(f, delimiter=delimiter, quotechar=quotechar, quoting=quoting)
876
871
  for data in list_data:
877
872
  writer.writerow(data)
@@ -1302,10 +1297,9 @@ def install_with_pip(package_name, package_path=None, upgrade=False, uninstall=F
1302
1297
  uninstall : bool, optional
1303
1298
  Whether to install the package or uninstall the package.
1304
1299
  """
1305
- if is_linux and is_ironpython:
1306
- import subprocessdotnet as subprocess
1307
- else:
1308
- import subprocess
1300
+
1301
+ import subprocess
1302
+
1309
1303
  executable = '"{}"'.format(sys.executable) if is_windows else sys.executable
1310
1304
 
1311
1305
  commands = []
pyedb/generic/plot.py CHANGED
@@ -2,35 +2,32 @@ import ast
2
2
  import os
3
3
  import warnings
4
4
 
5
- from pyedb.generic.general_methods import is_ironpython
6
-
7
- if not is_ironpython: # pragma: no cover
8
- try:
9
- import numpy # noqa: F401
10
- except ImportError:
11
- warnings.warn(
12
- "The NumPy module is required to run some functionalities of PostProcess.\n"
13
- "Install with \n\npip install numpy\n\nRequires CPython."
14
- )
15
-
16
- try:
17
- from matplotlib.patches import PathPatch
18
- from matplotlib.path import Path
19
-
20
- # Use matplotlib agg backend (non-interactive) when the CI is running.
21
- if bool(int(os.getenv("PYEDB_CI_NO_DISPLAY", "0"))): # pragma: no cover
22
- import matplotlib
23
-
24
- matplotlib.use("Agg")
25
- import matplotlib.pyplot as plt
26
-
27
- except ImportError:
28
- warnings.warn(
29
- "The Matplotlib module is required to run some functionalities of PostProcess.\n"
30
- "Install with \n\npip install matplotlib\n\nRequires CPython."
31
- )
32
- except:
33
- pass
5
+ try:
6
+ import numpy # noqa: F401
7
+ except ImportError:
8
+ warnings.warn(
9
+ "The NumPy module is required to run some functionalities of PostProcess.\n"
10
+ "Install with \n\npip install numpy\n\nRequires CPython."
11
+ )
12
+
13
+ try:
14
+ from matplotlib.patches import PathPatch
15
+ from matplotlib.path import Path
16
+
17
+ # Use matplotlib agg backend (non-interactive) when the CI is running.
18
+ if bool(int(os.getenv("PYEDB_CI_NO_DISPLAY", "0"))): # pragma: no cover
19
+ import matplotlib
20
+
21
+ matplotlib.use("Agg")
22
+ import matplotlib.pyplot as plt
23
+
24
+ except ImportError:
25
+ warnings.warn(
26
+ "The Matplotlib module is required to run some functionalities of PostProcess.\n"
27
+ "Install with \n\npip install matplotlib\n\nRequires CPython."
28
+ )
29
+ except:
30
+ pass
34
31
 
35
32
 
36
33
  def plot_matplotlib(
pyedb/generic/process.py CHANGED
@@ -1,11 +1,7 @@
1
1
  import os.path
2
+ import subprocess
2
3
 
3
- from pyedb.generic.general_methods import env_path, is_ironpython, is_linux
4
-
5
- if is_linux and is_ironpython:
6
- import subprocessdotnet as subprocess
7
- else:
8
- import subprocess
4
+ from pyedb.generic.general_methods import env_path, is_linux
9
5
 
10
6
 
11
7
  class SiwaveSolve(object):