pyedb 0.14.1__py3-none-any.whl → 0.15.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.14.1"
47
+ __version__ = "0.15.0"
48
48
  version = __version__
49
49
 
50
50
  #
pyedb/dotnet/edb.py CHANGED
@@ -48,6 +48,7 @@ from pyedb.dotnet.edb_core.cell.terminal.padstack_instance_terminal import (
48
48
  from pyedb.dotnet.edb_core.cell.terminal.pingroup_terminal import PinGroupTerminal
49
49
  from pyedb.dotnet.edb_core.cell.terminal.point_terminal import PointTerminal
50
50
  from pyedb.dotnet.edb_core.cell.terminal.terminal import Terminal
51
+ from pyedb.dotnet.edb_core.cell.voltage_regulator import VoltageRegulator
51
52
  from pyedb.dotnet.edb_core.components import Components
52
53
  from pyedb.dotnet.edb_core.dotnet.database import Database
53
54
  from pyedb.dotnet.edb_core.dotnet.layout import LayoutDotNet
@@ -93,10 +94,10 @@ from pyedb.dotnet.edb_core.nets import EdbNets
93
94
  from pyedb.dotnet.edb_core.padstack import EdbPadstacks
94
95
  from pyedb.dotnet.edb_core.siwave import EdbSiwave
95
96
  from pyedb.dotnet.edb_core.stackup import Stackup
96
- from pyedb.dotnet.edb_core.utilities.simulation_setup import (
97
- HfssSimulationSetup,
97
+ from pyedb.dotnet.edb_core.utilities.hfss_simulation_setup import HfssSimulationSetup
98
+ from pyedb.dotnet.edb_core.utilities.siwave_simulation_setup import (
98
99
  SiwaveDCSimulationSetup,
99
- SiwaveSYZSimulationSetup,
100
+ SiwaveSimulationSetup,
100
101
  )
101
102
  from pyedb.generic.constants import AEDT_UNITS, SolverType
102
103
  from pyedb.generic.general_methods import (
@@ -510,6 +511,15 @@ class Edb(Database):
510
511
  terms = [term for term in self.layout.terminals if int(term.GetBoundaryType()) in [3, 4, 7]]
511
512
  return {ter.GetName(): ExcitationSources(self, ter) for ter in terms}
512
513
 
514
+ @property
515
+ def voltage_regulator_modules(self):
516
+ """Get all voltage regulator modules"""
517
+ vrms = [VoltageRegulator(self, edb_object) for edb_object in list(self.active_layout.VoltageRegulators)]
518
+ _vrms = {}
519
+ for vrm in vrms:
520
+ _vrms[vrm.GetName()] = vrm
521
+ return _vrms
522
+
513
523
  @property
514
524
  def probes(self):
515
525
  """Get all layout probes."""
@@ -3556,7 +3566,7 @@ class Edb(Database):
3556
3566
  if i.GetType() == self.edb_api.utility.utility.SimulationSetupType.kHFSS:
3557
3567
  setups[i.GetName()] = HfssSimulationSetup(self, i)
3558
3568
  elif i.GetType() == self.edb_api.utility.utility.SimulationSetupType.kSIWave:
3559
- setups[i.GetName()] = SiwaveSYZSimulationSetup(self, i)
3569
+ setups[i.GetName()] = SiwaveSimulationSetup(self, i)
3560
3570
  elif i.GetType() == self.edb_api.utility.utility.SimulationSetupType.kSIWaveDCIR:
3561
3571
  setups[i.GetName()] = SiwaveDCSimulationSetup(self, i)
3562
3572
  elif i.GetType() == self.edb_api.utility.utility.SimulationSetupType.kRaptorX:
@@ -3594,7 +3604,7 @@ class Edb(Database):
3594
3604
  -------
3595
3605
  Dict[str, :class:`legacy.edb_core.edb_data.siwave_simulation_setup_data.SiwaveSYZSimulationSetup`]
3596
3606
  """
3597
- return {name: i for name, i in self.setups.items() if isinstance(i, SiwaveSYZSimulationSetup)}
3607
+ return {name: i for name, i in self.setups.items() if isinstance(i, SiwaveSimulationSetup)}
3598
3608
 
3599
3609
  def create_hfss_setup(self, name=None):
3600
3610
  """Create an HFSS simulation setup from a template.
@@ -3620,7 +3630,7 @@ class Edb(Database):
3620
3630
  return False
3621
3631
  elif not name:
3622
3632
  name = generate_unique_name("setup")
3623
- setup = HfssSimulationSetup(self).create(name)
3633
+ setup = HfssSimulationSetup(self, name=name)
3624
3634
  setup.set_solution_single_frequency("1GΗz")
3625
3635
  return setup
3626
3636
 
@@ -3698,7 +3708,7 @@ class Edb(Database):
3698
3708
  name = generate_unique_name("Siwave_SYZ")
3699
3709
  if name in self.setups:
3700
3710
  return False
3701
- SiwaveSYZSimulationSetup(self).create(name)
3711
+ setup = SiwaveSimulationSetup(self, name=name)
3702
3712
  return self.setups[name]
3703
3713
 
3704
3714
  def create_siwave_dc_setup(self, name=None):
@@ -3725,7 +3735,7 @@ class Edb(Database):
3725
3735
  name = generate_unique_name("Siwave_DC")
3726
3736
  if name in self.setups:
3727
3737
  return False
3728
- setup = SiwaveDCSimulationSetup(self).create(name)
3738
+ setup = SiwaveDCSimulationSetup(self, name=name)
3729
3739
  return setup
3730
3740
 
3731
3741
  def calculate_initial_extent(self, expansion_factor):
File without changes
@@ -0,0 +1,148 @@
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.edb_core.cell.layout_obj import Connectable
24
+ from pyedb.dotnet.edb_core.edb_data.padstacks_data import EDBPadstackInstance
25
+
26
+
27
+ class VoltageRegulator(Connectable):
28
+ """Class managing EDB voltage regulator."""
29
+
30
+ def __init__(self, pedb, edb_object=None):
31
+ super().__init__(pedb, edb_object)
32
+
33
+ @property
34
+ def component(self):
35
+ """Retrieve voltage regulator component"""
36
+ if not self._edb_object.GetComponent().IsNull():
37
+ ref_des = self._edb_object.GetComponent().GetName()
38
+ if not ref_des:
39
+ return False
40
+ return self._pedb.components.instances[ref_des]
41
+ self._pedb.logger.warning("No voltage regulator component.")
42
+ return False
43
+
44
+ @component.setter
45
+ def component(self, value):
46
+ if not isinstance(value, str):
47
+ self._pedb.logger.error("refdes name must be provided to set vrm component")
48
+ return
49
+ if value not in self._pedb.components.instances:
50
+ self._pedb.logger.error(f"component {value} not found in layout")
51
+ return
52
+ self._edb_object.SetGroup(self._pedb.components.instances[value].edbcomponent)
53
+
54
+ @property
55
+ def id(self):
56
+ """Retrieve voltage regulator ID."""
57
+ return self._edb_object.GetId()
58
+
59
+ @property
60
+ def load_regulator_current(self):
61
+ """Retrieve load regulator current value"""
62
+ return self._edb_object.GetLoadRegulationCurrent().ToDouble()
63
+
64
+ @load_regulator_current.setter
65
+ def load_regulator_current(self, value):
66
+ _value = self._pedb.edb_value(value)
67
+ self._edb_object.SetLoadRegulationCurrent(_value)
68
+
69
+ @property
70
+ def load_regulation_percent(self):
71
+ """Retrieve load regulation percent value."""
72
+ return self._edb_object.GetLoadRegulationPercent().ToDouble()
73
+
74
+ @load_regulation_percent.setter
75
+ def load_regulation_percent(self, value):
76
+ _value = self._edb_object.edb_value(value)
77
+ self._edb_object.SetLoadRegulationPercent(_value)
78
+
79
+ @property
80
+ def name(self):
81
+ """Retrieve voltage regulator name."""
82
+ return self._edb_object.GetName()
83
+
84
+ @name.setter
85
+ def name(self, value):
86
+ if isinstance(value, str):
87
+ self._edb_object.SetName(value)
88
+
89
+ @property
90
+ def negative_remote_sense_pin(self):
91
+ """Retrieve negative remote sense pin."""
92
+ edb_pin = self._edb_object.GetNegRemoteSensePin()
93
+ return self._pedb.padstacks.instances[edb_pin.GetId()]
94
+
95
+ @negative_remote_sense_pin.setter
96
+ def negative_remote_sense_pin(self, value):
97
+ if isinstance(value, int):
98
+ if value in self._pedb.padsatcks.instances:
99
+ _inst = self._pedb.padsatcks.instances[value]
100
+ if self._edb_object.SetNegRemoteSensePin(_inst._edb_object):
101
+ self._negative_remote_sense_pin = _inst
102
+ elif isinstance(value, EDBPadstackInstance):
103
+ if self._edb_object.SetNegRemoteSensePin(value._edb_object):
104
+ self._negative_remote_sense_pin = value
105
+
106
+ @property
107
+ def positive_remote_sense_pin(self):
108
+ """Retrieve positive remote sense pin."""
109
+ edb_pin = self._edb_object.GetPosRemoteSensePin()
110
+ return self._pedb.padstacks.instances[edb_pin.GetId()]
111
+
112
+ @positive_remote_sense_pin.setter
113
+ def positive_remote_sense_pin(self, value):
114
+ if isinstance(value, int):
115
+ if value in self._pedb.padsatcks.instances:
116
+ _inst = self._pedb.padsatcks.instances[value]
117
+ if self._edb_object.SetPosRemoteSensePin(_inst._edb_object):
118
+ self._positive_remote_sense_pin = _inst
119
+ if not self.component:
120
+ self.component = _inst._edb_object.GetComponent().GetName()
121
+ elif isinstance(value, EDBPadstackInstance):
122
+ if self._edb_object.SetPosRemoteSensePin(value._edb_object):
123
+ self._positive_remote_sense_pin = value
124
+ if not self.component:
125
+ self.component = value._edb_object.GetComponent().GetName()
126
+
127
+ @property
128
+ def voltage(self):
129
+ """Retrieve voltage value."""
130
+ return self._edb_object.GetVoltage().ToDouble()
131
+
132
+ @voltage.setter
133
+ def voltage(self, value):
134
+ self._edb_object.SetVoltage(self._pedb.edb_value(value))
135
+
136
+ @property
137
+ def is_active(self):
138
+ """Check is voltage regulator is active."""
139
+ return self._edb_object.IsActive()
140
+
141
+ @is_active.setter
142
+ def is_active(self, value):
143
+ if isinstance(value, bool):
144
+ self._edb_object.SetIsActive(value)
145
+
146
+ @property
147
+ def is_null(self):
148
+ return self._edb_object.IsNull()
@@ -45,7 +45,7 @@ class AdaptiveSettings(object):
45
45
  -------
46
46
  :class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.AdaptiveSettings`
47
47
  """
48
- return self._parent.get_sim_setup_info.SimulationSettings.AdaptiveSettings
48
+ return self._parent.sim_setup_info.simulation_settings.AdaptiveSettings
49
49
 
50
50
  @property
51
51
  def adaptive_frequency_data_list(self):
@@ -0,0 +1,81 @@
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.edb_core.sim_setup_data.data.sweep_data import SweepData
24
+
25
+
26
+ class SimSetupInfo:
27
+ def __init__(
28
+ self,
29
+ pedb,
30
+ sim_setup,
31
+ edb_object=None,
32
+ setup_type: str = None,
33
+ name: str = None,
34
+ ):
35
+ self._pedb = pedb
36
+ self.sim_setup = sim_setup
37
+ simulation_setup_type = {
38
+ "kHFSS": self._pedb.simsetupdata.HFSSSimulationSettings,
39
+ "kPEM": None,
40
+ "kSIwave": self._pedb.simsetupdata.SIwave.SIWSimulationSettings,
41
+ "kLNA": None,
42
+ "kTransient": None,
43
+ "kQEye": None,
44
+ "kVEye": None,
45
+ "kAMI": None,
46
+ "kAnalysisOption": None,
47
+ "kSIwaveDCIR": self._pedb.simsetupdata.SIwave.SIWDCIRSimulationSettings,
48
+ "kSIwaveEMI": None,
49
+ "kHFSSPI": None,
50
+ "kDDRwizard": None,
51
+ "kQ3D": None,
52
+ "kNumSetupTypes": None,
53
+ }
54
+
55
+ if edb_object is None:
56
+ self._edb_object = self._pedb.simsetupdata.SimSetupInfo[simulation_setup_type[setup_type]]()
57
+ self._edb_object.Name = name
58
+ else:
59
+ self._edb_object = edb_object
60
+
61
+ @property
62
+ def position(self):
63
+ return self._edb_object.Position
64
+
65
+ @property
66
+ def sim_setup_type(self):
67
+ return self._edb_object.SimSetupType
68
+
69
+ @property
70
+ def simulation_settings(self):
71
+ return self._edb_object.SimulationSettings
72
+
73
+ @property
74
+ def sweep_data_list(self):
75
+ return [
76
+ SweepData(self._pedb, edb_object=i, sim_setup=self.sim_setup) for i in list(self._edb_object.SweepDataList)
77
+ ]
78
+
79
+ def add_sweep_data(self, sweep_data):
80
+ sweep_data.sim_setup = self.sim_setup
81
+ self._edb_object.SweepDataList.Add(sweep_data._edb_object)
@@ -0,0 +1,67 @@
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
+
24
+ class BaseSimulationSettings:
25
+ def __init__(self, pedb, sim_setup, edb_object):
26
+ self._pedb = pedb
27
+ self.sim_setup = sim_setup
28
+ self._edb_object = edb_object
29
+ self.t_sim_setup_type = {
30
+ "kHFSS": self._pedb.simsetupdata.HFSSSimulationSettings,
31
+ "kPEM": None,
32
+ "kSIwave": self._pedb.simsetupdata.SIwave.SIWSimulationSettings,
33
+ "kLNA": None,
34
+ "kTransient": None,
35
+ "kQEye": None,
36
+ "kVEye": None,
37
+ "kAMI": None,
38
+ "kAnalysisOption": None,
39
+ "kSIwaveDCIR": self._pedb.simsetupdata.SIwave.SIWDCIRSimulationSettings,
40
+ "kSIwaveEMI": None,
41
+ "kHFSSPI": None,
42
+ "kDDRwizard": None,
43
+ "kQ3D": None,
44
+ "kNumSetupTypes": None,
45
+ }
46
+
47
+ @property
48
+ def enabled(self):
49
+ return self._edb_object.Enabled
50
+
51
+ @enabled.setter
52
+ def enabled(self, value):
53
+ self._edb_object.Enabled = value
54
+
55
+
56
+ class SimulationSettings(BaseSimulationSettings):
57
+ def __init__(self, pedb, sim_setup, edb_object):
58
+ super().__init__(pedb, sim_setup, edb_object)
59
+
60
+
61
+ class HFSSSimulationSettings(SimulationSettings):
62
+ def __init__(self, pedb, sim_setup, edb_object):
63
+ super().__init__(pedb, sim_setup, edb_object)
64
+
65
+ @property
66
+ def mesh_operations(self):
67
+ return self._edb_object.MeshOperations