pyedb 0.37.0__py3-none-any.whl → 0.39.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 (208) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/common/nets.py +53 -139
  3. pyedb/configuration/cfg_common.py +1 -1
  4. pyedb/configuration/cfg_components.py +229 -201
  5. pyedb/configuration/cfg_data.py +3 -1
  6. pyedb/configuration/cfg_general.py +4 -2
  7. pyedb/configuration/cfg_modeler.py +7 -7
  8. pyedb/configuration/cfg_package_definition.py +1 -1
  9. pyedb/configuration/cfg_padstacks.py +346 -290
  10. pyedb/configuration/cfg_ports_sources.py +243 -65
  11. pyedb/configuration/configuration.py +23 -3
  12. pyedb/dotnet/{application → database}/Variables.py +21 -21
  13. pyedb/dotnet/{edb_core → database}/cell/connectable.py +5 -5
  14. pyedb/dotnet/{edb_core → database}/cell/hierarchy/component.py +11 -11
  15. pyedb/dotnet/{edb_core → database}/cell/hierarchy/hierarchy_obj.py +1 -1
  16. pyedb/dotnet/{edb_core → database}/cell/hierarchy/model.py +1 -1
  17. pyedb/dotnet/{edb_core → database}/cell/layout.py +19 -19
  18. pyedb/dotnet/{edb_core → database}/cell/layout_obj.py +3 -3
  19. pyedb/dotnet/{edb_core → database}/cell/primitive/bondwire.py +1 -1
  20. pyedb/dotnet/{edb_core → database}/cell/primitive/path.py +4 -4
  21. pyedb/dotnet/{edb_core → database}/cell/primitive/primitive.py +14 -14
  22. pyedb/dotnet/{edb_core → database}/cell/terminal/bundle_terminal.py +2 -2
  23. pyedb/dotnet/{edb_core → database}/cell/terminal/edge_terminal.py +4 -4
  24. pyedb/dotnet/{edb_core → database}/cell/terminal/padstack_instance_terminal.py +2 -2
  25. pyedb/dotnet/{edb_core → database}/cell/terminal/pingroup_terminal.py +2 -2
  26. pyedb/dotnet/{edb_core → database}/cell/terminal/point_terminal.py +2 -2
  27. pyedb/dotnet/{edb_core → database}/cell/terminal/terminal.py +11 -11
  28. pyedb/dotnet/{edb_core → database}/cell/voltage_regulator.py +2 -2
  29. pyedb/dotnet/{edb_core → database}/components.py +101 -124
  30. pyedb/dotnet/{edb_core → database}/definition/component_def.py +5 -5
  31. pyedb/dotnet/{edb_core → database}/definition/component_model.py +1 -1
  32. pyedb/dotnet/{edb_core → database}/definition/definition_obj.py +1 -1
  33. pyedb/dotnet/{edb_core → database}/definition/definitions.py +2 -2
  34. pyedb/dotnet/{edb_core → database}/definition/package_def.py +4 -4
  35. pyedb/dotnet/{edb_core → database}/dotnet/database.py +8 -8
  36. pyedb/dotnet/{edb_core → database}/dotnet/primitive.py +9 -9
  37. pyedb/dotnet/{edb_core → database}/edb_data/control_file.py +12 -12
  38. pyedb/dotnet/{edb_core → database}/edb_data/hfss_extent_info.py +7 -7
  39. pyedb/dotnet/{edb_core → database}/edb_data/nets_data.py +10 -13
  40. pyedb/dotnet/{edb_core → database}/edb_data/padstacks_data.py +60 -73
  41. pyedb/dotnet/{edb_core → database}/edb_data/ports.py +4 -4
  42. pyedb/dotnet/{edb_core → database}/edb_data/primitives_data.py +5 -5
  43. pyedb/dotnet/{edb_core → database}/edb_data/raptor_x_simulation_setup_data.py +4 -4
  44. pyedb/dotnet/{edb_core → database}/edb_data/simulation_configuration.py +10 -10
  45. pyedb/dotnet/{edb_core → database}/edb_data/sources.py +4 -4
  46. pyedb/dotnet/{edb_core → database}/edb_data/variables.py +1 -1
  47. pyedb/dotnet/{edb_core → database}/geometry/polygon_data.py +4 -4
  48. pyedb/dotnet/{edb_core → database}/hfss.py +8 -8
  49. pyedb/dotnet/{edb_core → database}/layout_obj_instance.py +1 -1
  50. pyedb/dotnet/{edb_core → database}/layout_validation.py +2 -2
  51. pyedb/dotnet/{edb_core → database}/materials.py +23 -8
  52. pyedb/dotnet/{edb_core → database}/modeler.py +27 -27
  53. pyedb/dotnet/{edb_core → database}/net_class.py +8 -8
  54. pyedb/dotnet/{edb_core → database}/nets.py +12 -12
  55. pyedb/dotnet/{edb_core → database}/padstack.py +17 -16
  56. pyedb/dotnet/{edb_core → database}/sim_setup_data/data/mesh_operation.py +1 -1
  57. pyedb/dotnet/{edb_core → database}/sim_setup_data/data/settings.py +18 -3
  58. pyedb/dotnet/{edb_core → database}/sim_setup_data/data/sim_setup_info.py +2 -2
  59. pyedb/dotnet/{edb_core → database}/sim_setup_data/data/simulation_settings.py +1 -1
  60. pyedb/dotnet/{edb_core → database}/sim_setup_data/data/siw_dc_ir_settings.py +1 -1
  61. pyedb/dotnet/{edb_core → database}/sim_setup_data/data/sweep_data.py +4 -4
  62. pyedb/dotnet/{edb_core → database}/siwave.py +10 -10
  63. pyedb/dotnet/{edb_core → database}/stackup.py +12 -12
  64. pyedb/dotnet/{edb_core → database}/utilities/hfss_simulation_setup.py +15 -15
  65. pyedb/dotnet/{edb_core → database}/utilities/obj_base.py +1 -1
  66. pyedb/dotnet/{edb_core → database}/utilities/simulation_setup.py +4 -3
  67. pyedb/dotnet/{edb_core → database}/utilities/siwave_simulation_setup.py +6 -6
  68. pyedb/dotnet/edb.py +118 -113
  69. pyedb/extensions/pre_layout_design_toolkit/via_design.py +1151 -0
  70. pyedb/generic/design_types.py +26 -19
  71. pyedb/generic/general_methods.py +1 -1
  72. pyedb/generic/plot.py +0 -2
  73. pyedb/grpc/database/__init__.py +1 -0
  74. pyedb/grpc/database/components.py +2354 -0
  75. pyedb/grpc/database/control_file.py +1277 -0
  76. pyedb/grpc/database/definition/component_def.py +218 -0
  77. pyedb/grpc/database/definition/component_model.py +39 -0
  78. pyedb/grpc/database/definition/component_pin.py +32 -0
  79. pyedb/grpc/database/definition/materials.py +1207 -0
  80. pyedb/grpc/database/definition/n_port_component_model.py +34 -0
  81. pyedb/grpc/database/definition/package_def.py +227 -0
  82. pyedb/grpc/database/definition/padstack_def.py +842 -0
  83. pyedb/grpc/database/definitions.py +70 -0
  84. pyedb/grpc/database/general.py +43 -0
  85. pyedb/grpc/database/geometry/__init__.py +0 -0
  86. pyedb/grpc/database/geometry/arc_data.py +93 -0
  87. pyedb/grpc/database/geometry/point_3d_data.py +79 -0
  88. pyedb/grpc/database/geometry/point_data.py +30 -0
  89. pyedb/grpc/database/geometry/polygon_data.py +133 -0
  90. pyedb/grpc/database/hfss.py +1279 -0
  91. pyedb/grpc/database/hierarchy/__init__.py +0 -0
  92. pyedb/grpc/database/hierarchy/component.py +1301 -0
  93. pyedb/grpc/database/hierarchy/model.py +31 -0
  94. pyedb/grpc/database/hierarchy/netlist_model.py +30 -0
  95. pyedb/grpc/database/hierarchy/pin_pair_model.py +128 -0
  96. pyedb/grpc/database/hierarchy/pingroup.py +245 -0
  97. pyedb/grpc/database/hierarchy/s_parameter_model.py +33 -0
  98. pyedb/grpc/database/hierarchy/spice_model.py +48 -0
  99. pyedb/grpc/database/layers/__init__.py +0 -0
  100. pyedb/grpc/database/layers/layer.py +57 -0
  101. pyedb/grpc/database/layers/stackup_layer.py +410 -0
  102. pyedb/grpc/database/layout/__init__.py +0 -0
  103. pyedb/grpc/database/layout/cell.py +30 -0
  104. pyedb/grpc/database/layout/layout.py +196 -0
  105. pyedb/grpc/database/layout/voltage_regulator.py +149 -0
  106. pyedb/grpc/database/layout_validation.py +319 -0
  107. pyedb/grpc/database/modeler.py +1468 -0
  108. pyedb/grpc/database/net/__init__.py +0 -0
  109. pyedb/grpc/database/net/differential_pair.py +138 -0
  110. pyedb/grpc/database/net/extended_net.py +340 -0
  111. pyedb/grpc/database/net/net.py +198 -0
  112. pyedb/grpc/database/net/net_class.py +93 -0
  113. pyedb/grpc/database/nets.py +633 -0
  114. pyedb/grpc/database/padstacks.py +1500 -0
  115. pyedb/grpc/database/ports/__init__.py +0 -0
  116. pyedb/grpc/database/ports/ports.py +396 -0
  117. pyedb/grpc/database/primitive/__init__.py +3 -0
  118. pyedb/grpc/database/primitive/bondwire.py +181 -0
  119. pyedb/grpc/database/primitive/circle.py +75 -0
  120. pyedb/grpc/database/primitive/padstack_instance.py +1116 -0
  121. pyedb/grpc/database/primitive/path.py +346 -0
  122. pyedb/grpc/database/primitive/polygon.py +276 -0
  123. pyedb/grpc/database/primitive/primitive.py +739 -0
  124. pyedb/grpc/database/primitive/rectangle.py +146 -0
  125. pyedb/grpc/database/simulation_setup/__init__.py +0 -0
  126. pyedb/grpc/database/simulation_setup/adaptive_frequency.py +33 -0
  127. pyedb/grpc/database/simulation_setup/hfss_advanced_meshing_settings.py +32 -0
  128. pyedb/grpc/database/simulation_setup/hfss_advanced_settings.py +59 -0
  129. pyedb/grpc/database/simulation_setup/hfss_dcr_settings.py +35 -0
  130. pyedb/grpc/database/simulation_setup/hfss_general_settings.py +61 -0
  131. pyedb/grpc/database/simulation_setup/hfss_settings_options.py +78 -0
  132. pyedb/grpc/database/simulation_setup/hfss_simulation_settings.py +118 -0
  133. pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +355 -0
  134. pyedb/grpc/database/simulation_setup/hfss_solver_settings.py +34 -0
  135. pyedb/grpc/database/simulation_setup/mesh_operation.py +34 -0
  136. pyedb/grpc/database/simulation_setup/raptor_x_advanced_settings.py +34 -0
  137. pyedb/grpc/database/simulation_setup/raptor_x_general_settings.py +33 -0
  138. pyedb/grpc/database/simulation_setup/raptor_x_simulation_settings.py +64 -0
  139. pyedb/grpc/database/simulation_setup/raptor_x_simulation_setup.py +125 -0
  140. pyedb/grpc/database/simulation_setup/siwave_dcir_simulation_setup.py +34 -0
  141. pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +119 -0
  142. pyedb/grpc/database/simulation_setup/sweep_data.py +32 -0
  143. pyedb/grpc/database/siwave.py +1023 -0
  144. pyedb/grpc/database/source_excitations.py +2572 -0
  145. pyedb/grpc/database/stackup.py +2574 -0
  146. pyedb/grpc/database/terminal/__init__.py +0 -0
  147. pyedb/grpc/database/terminal/bundle_terminal.py +218 -0
  148. pyedb/grpc/database/terminal/edge_terminal.py +51 -0
  149. pyedb/grpc/database/terminal/padstack_instance_terminal.py +171 -0
  150. pyedb/grpc/database/terminal/pingroup_terminal.py +162 -0
  151. pyedb/grpc/database/terminal/point_terminal.py +99 -0
  152. pyedb/grpc/database/terminal/terminal.py +470 -0
  153. pyedb/grpc/database/utility/__init__.py +3 -0
  154. pyedb/grpc/database/utility/constants.py +25 -0
  155. pyedb/grpc/database/utility/heat_sink.py +124 -0
  156. pyedb/grpc/database/utility/hfss_extent_info.py +448 -0
  157. pyedb/grpc/database/utility/layout_statistics.py +277 -0
  158. pyedb/grpc/database/utility/rlc.py +80 -0
  159. pyedb/grpc/database/utility/simulation_configuration.py +3305 -0
  160. pyedb/grpc/database/utility/sources.py +388 -0
  161. pyedb/grpc/database/utility/sweep_data_distribution.py +83 -0
  162. pyedb/grpc/database/utility/xml_control_file.py +1277 -0
  163. pyedb/grpc/edb.py +4151 -0
  164. pyedb/grpc/edb_init.py +481 -0
  165. pyedb/grpc/rpc_session.py +177 -0
  166. pyedb/ipc2581/ecad/cad_data/assembly_drawing.py +3 -2
  167. pyedb/ipc2581/ecad/cad_data/feature.py +4 -3
  168. pyedb/ipc2581/ecad/cad_data/layer_feature.py +32 -20
  169. pyedb/ipc2581/ecad/cad_data/outline.py +3 -2
  170. pyedb/ipc2581/ecad/cad_data/package.py +4 -3
  171. pyedb/ipc2581/ecad/cad_data/path.py +82 -31
  172. pyedb/ipc2581/ecad/cad_data/polygon.py +122 -60
  173. pyedb/ipc2581/ecad/cad_data/profile.py +13 -12
  174. pyedb/ipc2581/ecad/cad_data/step.py +52 -20
  175. pyedb/ipc2581/ipc2581.py +47 -49
  176. pyedb/modeler/geometry_operators.py +1 -1
  177. {pyedb-0.37.0.dist-info → pyedb-0.39.0.dist-info}/METADATA +9 -6
  178. pyedb-0.39.0.dist-info/RECORD +288 -0
  179. pyedb-0.37.0.dist-info/RECORD +0 -194
  180. /pyedb/dotnet/{edb_core → database}/__init__.py +0 -0
  181. /pyedb/dotnet/{application → database/cell}/__init__.py +0 -0
  182. /pyedb/dotnet/{edb_core/cell → database/cell/hierarchy}/__init__.py +0 -0
  183. /pyedb/dotnet/{edb_core → database}/cell/hierarchy/netlist_model.py +0 -0
  184. /pyedb/dotnet/{edb_core → database}/cell/hierarchy/pin_pair_model.py +0 -0
  185. /pyedb/dotnet/{edb_core → database}/cell/hierarchy/s_parameter_model.py +0 -0
  186. /pyedb/dotnet/{edb_core → database}/cell/hierarchy/spice_model.py +0 -0
  187. /pyedb/dotnet/{edb_core → database}/cell/primitive/__init__.py +0 -0
  188. /pyedb/dotnet/{edb_core/cell/hierarchy → database/cell/terminal}/__init__.py +0 -0
  189. /pyedb/dotnet/{edb_core/cell/terminal → database/definition}/__init__.py +0 -0
  190. /pyedb/dotnet/{edb_core/definition → database/dotnet}/__init__.py +0 -0
  191. /pyedb/dotnet/{edb_core/dotnet → database/edb_data}/__init__.py +0 -0
  192. /pyedb/dotnet/{edb_core → database}/edb_data/design_options.py +0 -0
  193. /pyedb/dotnet/{edb_core → database}/edb_data/edbvalue.py +0 -0
  194. /pyedb/dotnet/{edb_core → database}/edb_data/layer_data.py +0 -0
  195. /pyedb/dotnet/{edb_core → database}/edb_data/utilities.py +0 -0
  196. /pyedb/dotnet/{edb_core → database}/general.py +0 -0
  197. /pyedb/dotnet/{edb_core/edb_data → database/geometry}/__init__.py +0 -0
  198. /pyedb/dotnet/{edb_core → database}/geometry/point_data.py +0 -0
  199. /pyedb/dotnet/{edb_core → database}/sim_setup_data/__init__.py +0 -0
  200. /pyedb/dotnet/{edb_core → database}/sim_setup_data/data/__init__.py +0 -0
  201. /pyedb/dotnet/{edb_core → database}/sim_setup_data/data/adaptive_frequency_data.py +0 -0
  202. /pyedb/dotnet/{edb_core/geometry → database/sim_setup_data/io}/__init__.py +0 -0
  203. /pyedb/dotnet/{edb_core → database}/sim_setup_data/io/siwave.py +0 -0
  204. /pyedb/dotnet/{edb_core → database}/utilities/__init__.py +0 -0
  205. /pyedb/dotnet/{edb_core → database}/utilities/heatsink.py +0 -0
  206. /pyedb/{dotnet/edb_core/sim_setup_data/io → grpc/database/definition}/__init__.py +0 -0
  207. {pyedb-0.37.0.dist-info → pyedb-0.39.0.dist-info}/LICENSE +0 -0
  208. {pyedb-0.37.0.dist-info → pyedb-0.39.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,388 @@
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
+ from pyedb.generic.constants import NodeType, SourceType
25
+ from pyedb.grpc.database.hierarchy.pingroup import PinGroup
26
+
27
+
28
+ class Node(object):
29
+ """Provides for handling nodes for Siwave sources."""
30
+
31
+ def __init__(self):
32
+ self._component = None
33
+ self._net = None
34
+ self._node_type = NodeType.Positive
35
+ self._name = ""
36
+
37
+ @property
38
+ def component(self): # pragma: no cover
39
+ """Component name containing the node."""
40
+ return self._component
41
+
42
+ @component.setter
43
+ def component(self, value): # pragma: no cover
44
+ if isinstance(value, str):
45
+ self._component = value
46
+
47
+ @property
48
+ def net(self): # pragma: no cover
49
+ """Net of the node."""
50
+ return self._net
51
+
52
+ @net.setter
53
+ def net(self, value): # pragma: no cover
54
+ if isinstance(value, str):
55
+ self._net = value
56
+
57
+ @property
58
+ def node_type(self): # pragma: no cover
59
+ """Type of the node."""
60
+ return self._node_type
61
+
62
+ @node_type.setter
63
+ def node_type(self, value): # pragma: no cover
64
+ if isinstance(value, int):
65
+ self._node_type = value
66
+
67
+ @property
68
+ def name(self): # pragma: no cover
69
+ """Name of the node."""
70
+ return self._name
71
+
72
+ @name.setter
73
+ def name(self, value): # pragma: no cover
74
+ if isinstance(value, str):
75
+ self._name = value
76
+
77
+ def _json_format(self): # pragma: no cover
78
+ dict_out = {}
79
+ for k, v in self.__dict__.items():
80
+ dict_out[k[1:]] = v
81
+ return dict_out
82
+
83
+ def _read_json(self, node_dict): # pragma: no cover
84
+ for k, v in node_dict.items():
85
+ self.__setattr__(k, v)
86
+
87
+
88
+ class Source(object):
89
+ """Provides for handling Siwave sources."""
90
+
91
+ def __init__(self, pedb):
92
+ self._pedb = pedb
93
+ self._name = ""
94
+ self._source_type = SourceType.Vsource
95
+ self._positive_node = PinGroup(self._pedb)
96
+ self._negative_node = PinGroup(self._pedb)
97
+ self._amplitude = 1.0
98
+ self._phase = 0.0
99
+ self._impedance = 1.0
100
+ self._r = 1.0
101
+ self._l = 0.0
102
+ self._c = 0.0
103
+ self._create_physical_resistor = True
104
+ self._positive_node.node_type = int(NodeType.Positive)
105
+ self._positive_node.name = "pos_term"
106
+ self._negative_node.node_type = int(NodeType.Negative)
107
+ self._negative_node.name = "neg_term"
108
+
109
+ @property
110
+ def name(self): # pragma: no cover
111
+ """Source name."""
112
+ return self._name
113
+
114
+ @name.setter
115
+ def name(self, value): # pragma: no cover
116
+ if isinstance(value, str):
117
+ self._name = value
118
+
119
+ @property
120
+ def source_type(self): # pragma: no cover
121
+ """Source type."""
122
+ return self._source_type
123
+
124
+ @source_type.setter
125
+ def source_type(self, value): # pragma: no cover
126
+ if isinstance(value, int):
127
+ self._source_type = value
128
+ if value == 3:
129
+ self._impedance = 1e-6
130
+ if value == 4:
131
+ self._impedance = 5e7
132
+ if value == 5:
133
+ self._r = 1.0
134
+ self._l = 0.0
135
+ self._c = 0.0
136
+
137
+ @property
138
+ def positive_node(self): # pragma: no cover
139
+ """Positive node of the source."""
140
+ return self._positive_node
141
+
142
+ @positive_node.setter
143
+ def positive_node(self, value): # pragma: no cover
144
+ if isinstance(value, (Node, PinGroup)):
145
+ self._positive_node = value
146
+
147
+ @property
148
+ def negative_node(self): # pragma: no cover
149
+ """Negative node of the source."""
150
+ return self._negative_node
151
+
152
+ @negative_node.setter
153
+ def negative_node(self, value): # pragma: no cover
154
+ if isinstance(value, (Node, PinGroup)):
155
+ self._negative_node = value
156
+ #
157
+
158
+ @property
159
+ def amplitude(self): # pragma: no cover
160
+ """Amplitude value of the source. Either amperes for current source or volts for
161
+ voltage source."""
162
+ return self._amplitude
163
+
164
+ @amplitude.setter
165
+ def amplitude(self, value): # pragma: no cover
166
+ if isinstance(float(value), float):
167
+ self._amplitude = value
168
+
169
+ @property
170
+ def phase(self): # pragma: no cover
171
+ """Phase of the source."""
172
+ return self._phase
173
+
174
+ @phase.setter
175
+ def phase(self, value): # pragma: no cover
176
+ if isinstance(float(value), float):
177
+ self._phase = value
178
+
179
+ @property
180
+ def impedance(self): # pragma: no cover
181
+ """Impedance values of the source."""
182
+ return self._impedance
183
+
184
+ @impedance.setter
185
+ def impedance(self, value): # pragma: no cover
186
+ if isinstance(float(value), float):
187
+ self._impedance = value
188
+
189
+ @property
190
+ def r_value(self):
191
+ return self._r
192
+
193
+ @r_value.setter
194
+ def r_value(self, value):
195
+ if isinstance(float(value), float):
196
+ self._r = value
197
+
198
+ @property
199
+ def l_value(self):
200
+ return self._l
201
+
202
+ @l_value.setter
203
+ def l_value(self, value):
204
+ if isinstance(float(value), float):
205
+ self._l = value
206
+
207
+ @property
208
+ def c_value(self):
209
+ return self._c
210
+
211
+ @c_value.setter
212
+ def c_value(self, value):
213
+ if isinstance(float(value), float):
214
+ self._c = value
215
+
216
+ @property
217
+ def create_physical_resistor(self):
218
+ return self._create_physical_resistor
219
+
220
+ @create_physical_resistor.setter
221
+ def create_physical_resistor(self, value):
222
+ if isinstance(value, bool):
223
+ self._create_physical_resistor = value
224
+
225
+ def _json_format(self): # pragma: no cover
226
+ dict_out = {}
227
+ for k, v in self.__dict__.items():
228
+ if k == "_positive_node" or k == "_negative_node":
229
+ nodes = v._json_format()
230
+ dict_out[k[1:]] = nodes
231
+ else:
232
+ dict_out[k[1:]] = v
233
+ return dict_out
234
+
235
+ def _read_json(self, source_dict): # pragma: no cover
236
+ for k, v in source_dict.items():
237
+ if k == "positive_node":
238
+ self.positive_node._read_json(v)
239
+ elif k == "negative_node":
240
+ self.negative_node._read_json(v)
241
+ else:
242
+ self.__setattr__(k, v)
243
+
244
+
245
+ class CircuitPort(Source):
246
+ """Manages a circuit port."""
247
+
248
+ def __init__(self, pedb, impedance="50"):
249
+ self._impedance = impedance
250
+ super().__init__(self)
251
+ self._source_type = SourceType.CircPort
252
+
253
+ @property
254
+ def impedance(self):
255
+ """Impedance."""
256
+ return self._impedance
257
+
258
+ @impedance.setter
259
+ def impedance(self, value):
260
+ self._impedance = value
261
+
262
+ @property
263
+ def get_type(self):
264
+ """Get type."""
265
+ return self._source_type
266
+
267
+
268
+ class VoltageSource(Source):
269
+ """Manages a voltage source."""
270
+
271
+ def __init__(self):
272
+ super(VoltageSource, self).__init__()
273
+ self._magnitude = "1V"
274
+ self._phase = "0Deg"
275
+ self._impedance = "0.05"
276
+ self._source_type = SourceType.Vsource
277
+
278
+ @property
279
+ def magnitude(self):
280
+ """Magnitude."""
281
+ return self._magnitude
282
+
283
+ @magnitude.setter
284
+ def magnitude(self, value):
285
+ self._magnitude = value
286
+
287
+ @property
288
+ def phase(self):
289
+ """Phase."""
290
+ return self._phase
291
+
292
+ @phase.setter
293
+ def phase(self, value):
294
+ self._phase = value
295
+
296
+ @property
297
+ def impedance(self):
298
+ """Impedance."""
299
+ return self._impedance
300
+
301
+ @impedance.setter
302
+ def impedance(self, value):
303
+ self._impedance = value
304
+
305
+ @property
306
+ def source_type(self):
307
+ """Source type."""
308
+ return self._source_type
309
+
310
+
311
+ class CurrentSource(Source):
312
+ """Manages a current source."""
313
+
314
+ def __init__(self):
315
+ super(CurrentSource, self).__init__()
316
+ self._magnitude = "0.1A"
317
+ self._phase = "0Deg"
318
+ self._impedance = "1e7"
319
+ self._source_type = SourceType.Isource
320
+
321
+ @property
322
+ def magnitude(self):
323
+ """Magnitude."""
324
+ return self._magnitude
325
+
326
+ @magnitude.setter
327
+ def magnitude(self, value):
328
+ self._magnitude = value
329
+
330
+ @property
331
+ def phase(self):
332
+ """Phase."""
333
+ return self._phase
334
+
335
+ @phase.setter
336
+ def phase(self, value):
337
+ self._phase = value
338
+
339
+ @property
340
+ def impedance(self):
341
+ """Impedance."""
342
+ return self._impedance
343
+
344
+ @impedance.setter
345
+ def impedance(self, value):
346
+ self._impedance = value
347
+
348
+ @property
349
+ def source_type(self):
350
+ """Source type."""
351
+ return self._source_type
352
+
353
+
354
+ class DCTerminal(Source):
355
+ """Manages a dc terminal source."""
356
+
357
+ def __init__(self):
358
+ super(DCTerminal, self).__init__()
359
+
360
+ self._source_type = SourceType.DcTerminal
361
+
362
+ @property
363
+ def source_type(self):
364
+ """Source type."""
365
+ return self._source_type
366
+
367
+
368
+ class ResistorSource(Source):
369
+ """Manages a resistor source."""
370
+
371
+ def __init__(self):
372
+ super(ResistorSource, self).__init__()
373
+ self._rvalue = "50"
374
+ self._source_type = SourceType.Rlc
375
+
376
+ @property
377
+ def rvalue(self):
378
+ """Resistance value."""
379
+ return self._rvalue
380
+
381
+ @rvalue.setter
382
+ def rvalue(self, value):
383
+ self._rvalue = value
384
+
385
+ @property
386
+ def source_type(self):
387
+ """Source type."""
388
+ return self._source_type
@@ -0,0 +1,83 @@
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
+ # FITNE SS 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 ansys.edb.core.utility.value import Value as GrpcValue
24
+
25
+
26
+ class SweepDataDistribution:
27
+ @staticmethod
28
+ def get_distribution(
29
+ sweep_type="linear", start="0Ghz", stop="10GHz", step="10MHz", count=10, decade_number=6, octave_number=5
30
+ ):
31
+ """Return the Sweep data distribution.
32
+
33
+ Parameters
34
+ ----------
35
+ sweep_type : str
36
+ Sweep type. Supported values : `"linear"`, `"linear_count"`, `"exponential"`, `"decade_count"`,
37
+ `"octave_count"`
38
+ start : str, float
39
+ Start frequency.
40
+ stop : str, float
41
+ Stop frequency
42
+ step : str, float
43
+ Step frequency
44
+ count : int
45
+ Count number
46
+ decade_number : int
47
+ Decade number
48
+ octave_number : int
49
+ Octave number
50
+
51
+ Return
52
+ ------
53
+ str
54
+ Sweep Data distribution.
55
+
56
+ """
57
+ if sweep_type.lower() == "linear":
58
+ if isinstance(start, str) and isinstance(stop, str) and isinstance(step, str):
59
+ return f"LIN {start} {stop} {step}"
60
+ else:
61
+ return f"LIN {GrpcValue(start).value} {GrpcValue(stop).value} {GrpcValue(step).value}"
62
+ elif sweep_type.lower() == "linear_count":
63
+ if isinstance(start, str) and isinstance(stop, str) and isinstance(count, int):
64
+ return f"LINC {start} {stop} {count}"
65
+ else:
66
+ return f"LINC {GrpcValue(start).value} {GrpcValue(stop).value} {int(GrpcValue(count).value)}"
67
+ elif sweep_type.lower() == "exponential":
68
+ if isinstance(start, str) and isinstance(stop, str) and isinstance(count, int):
69
+ return f"ESTP {start} {stop} {count}"
70
+ else:
71
+ return f"ESTP {GrpcValue(start).value} {GrpcValue(stop).value} {int(GrpcValue(count).value)}"
72
+ elif sweep_type.lower() == "decade_count":
73
+ if isinstance(start, str) and isinstance(stop, str) and isinstance(decade_number, int):
74
+ return f"DEC {start} {stop} {decade_number}"
75
+ else:
76
+ return f"DEC {GrpcValue(start).value} {GrpcValue(stop).value} {int(GrpcValue(decade_number).value)}"
77
+ elif sweep_type.lower() == "octave_count":
78
+ if isinstance(start, str) and isinstance(stop, str) and isinstance(octave_number, int):
79
+ return f"OCT {start} {stop} {octave_number}"
80
+ else:
81
+ return f"OCT {GrpcValue(start).value} {GrpcValue(stop).value} {int(GrpcValue(octave_number).value)}"
82
+ else:
83
+ return ""