pyedb 0.2.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 (128) hide show
  1. pyedb/__init__.py +17 -0
  2. pyedb/dotnet/__init__.py +0 -0
  3. pyedb/dotnet/application/Variables.py +2261 -0
  4. pyedb/dotnet/application/__init__.py +0 -0
  5. pyedb/dotnet/clr_module.py +103 -0
  6. pyedb/dotnet/edb.py +4237 -0
  7. pyedb/dotnet/edb_core/__init__.py +1 -0
  8. pyedb/dotnet/edb_core/cell/__init__.py +0 -0
  9. pyedb/dotnet/edb_core/cell/hierarchy/__init__.py +0 -0
  10. pyedb/dotnet/edb_core/cell/hierarchy/model.py +66 -0
  11. pyedb/dotnet/edb_core/components.py +2669 -0
  12. pyedb/dotnet/edb_core/configuration.py +423 -0
  13. pyedb/dotnet/edb_core/definition/__init__.py +0 -0
  14. pyedb/dotnet/edb_core/definition/component_def.py +166 -0
  15. pyedb/dotnet/edb_core/definition/component_model.py +30 -0
  16. pyedb/dotnet/edb_core/definition/definition_obj.py +18 -0
  17. pyedb/dotnet/edb_core/definition/definitions.py +12 -0
  18. pyedb/dotnet/edb_core/dotnet/__init__.py +0 -0
  19. pyedb/dotnet/edb_core/dotnet/database.py +1218 -0
  20. pyedb/dotnet/edb_core/dotnet/layout.py +238 -0
  21. pyedb/dotnet/edb_core/dotnet/primitive.py +1517 -0
  22. pyedb/dotnet/edb_core/edb_data/__init__.py +0 -0
  23. pyedb/dotnet/edb_core/edb_data/components_data.py +938 -0
  24. pyedb/dotnet/edb_core/edb_data/connectable.py +113 -0
  25. pyedb/dotnet/edb_core/edb_data/control_file.py +1268 -0
  26. pyedb/dotnet/edb_core/edb_data/design_options.py +35 -0
  27. pyedb/dotnet/edb_core/edb_data/edbvalue.py +45 -0
  28. pyedb/dotnet/edb_core/edb_data/hfss_extent_info.py +330 -0
  29. pyedb/dotnet/edb_core/edb_data/hfss_simulation_setup_data.py +1607 -0
  30. pyedb/dotnet/edb_core/edb_data/layer_data.py +576 -0
  31. pyedb/dotnet/edb_core/edb_data/nets_data.py +281 -0
  32. pyedb/dotnet/edb_core/edb_data/obj_base.py +19 -0
  33. pyedb/dotnet/edb_core/edb_data/padstacks_data.py +2080 -0
  34. pyedb/dotnet/edb_core/edb_data/ports.py +287 -0
  35. pyedb/dotnet/edb_core/edb_data/primitives_data.py +1397 -0
  36. pyedb/dotnet/edb_core/edb_data/simulation_configuration.py +2914 -0
  37. pyedb/dotnet/edb_core/edb_data/simulation_setup.py +716 -0
  38. pyedb/dotnet/edb_core/edb_data/siwave_simulation_setup_data.py +1205 -0
  39. pyedb/dotnet/edb_core/edb_data/sources.py +514 -0
  40. pyedb/dotnet/edb_core/edb_data/terminals.py +632 -0
  41. pyedb/dotnet/edb_core/edb_data/utilities.py +148 -0
  42. pyedb/dotnet/edb_core/edb_data/variables.py +91 -0
  43. pyedb/dotnet/edb_core/general.py +181 -0
  44. pyedb/dotnet/edb_core/hfss.py +1646 -0
  45. pyedb/dotnet/edb_core/layout.py +1244 -0
  46. pyedb/dotnet/edb_core/layout_validation.py +272 -0
  47. pyedb/dotnet/edb_core/materials.py +939 -0
  48. pyedb/dotnet/edb_core/net_class.py +335 -0
  49. pyedb/dotnet/edb_core/nets.py +1215 -0
  50. pyedb/dotnet/edb_core/padstack.py +1389 -0
  51. pyedb/dotnet/edb_core/siwave.py +1427 -0
  52. pyedb/dotnet/edb_core/stackup.py +2703 -0
  53. pyedb/edb_logger.py +396 -0
  54. pyedb/generic/__init__.py +0 -0
  55. pyedb/generic/constants.py +1063 -0
  56. pyedb/generic/data_handlers.py +320 -0
  57. pyedb/generic/design_types.py +104 -0
  58. pyedb/generic/filesystem.py +150 -0
  59. pyedb/generic/general_methods.py +1535 -0
  60. pyedb/generic/plot.py +1840 -0
  61. pyedb/generic/process.py +285 -0
  62. pyedb/generic/settings.py +224 -0
  63. pyedb/ipc2581/__init__.py +0 -0
  64. pyedb/ipc2581/bom/__init__.py +0 -0
  65. pyedb/ipc2581/bom/bom.py +21 -0
  66. pyedb/ipc2581/bom/bom_item.py +32 -0
  67. pyedb/ipc2581/bom/characteristics.py +37 -0
  68. pyedb/ipc2581/bom/refdes.py +16 -0
  69. pyedb/ipc2581/content/__init__.py +0 -0
  70. pyedb/ipc2581/content/color.py +38 -0
  71. pyedb/ipc2581/content/content.py +55 -0
  72. pyedb/ipc2581/content/dictionary_color.py +29 -0
  73. pyedb/ipc2581/content/dictionary_fill.py +28 -0
  74. pyedb/ipc2581/content/dictionary_line.py +30 -0
  75. pyedb/ipc2581/content/entry_color.py +13 -0
  76. pyedb/ipc2581/content/entry_line.py +14 -0
  77. pyedb/ipc2581/content/fill.py +15 -0
  78. pyedb/ipc2581/content/layer_ref.py +10 -0
  79. pyedb/ipc2581/content/standard_geometries_dictionary.py +72 -0
  80. pyedb/ipc2581/ecad/__init__.py +0 -0
  81. pyedb/ipc2581/ecad/cad_data/__init__.py +0 -0
  82. pyedb/ipc2581/ecad/cad_data/assembly_drawing.py +26 -0
  83. pyedb/ipc2581/ecad/cad_data/cad_data.py +37 -0
  84. pyedb/ipc2581/ecad/cad_data/component.py +41 -0
  85. pyedb/ipc2581/ecad/cad_data/drill.py +30 -0
  86. pyedb/ipc2581/ecad/cad_data/feature.py +54 -0
  87. pyedb/ipc2581/ecad/cad_data/layer.py +41 -0
  88. pyedb/ipc2581/ecad/cad_data/layer_feature.py +151 -0
  89. pyedb/ipc2581/ecad/cad_data/logical_net.py +32 -0
  90. pyedb/ipc2581/ecad/cad_data/outline.py +25 -0
  91. pyedb/ipc2581/ecad/cad_data/package.py +104 -0
  92. pyedb/ipc2581/ecad/cad_data/padstack_def.py +38 -0
  93. pyedb/ipc2581/ecad/cad_data/padstack_hole_def.py +24 -0
  94. pyedb/ipc2581/ecad/cad_data/padstack_instance.py +62 -0
  95. pyedb/ipc2581/ecad/cad_data/padstack_pad_def.py +26 -0
  96. pyedb/ipc2581/ecad/cad_data/path.py +89 -0
  97. pyedb/ipc2581/ecad/cad_data/phy_net.py +80 -0
  98. pyedb/ipc2581/ecad/cad_data/pin.py +31 -0
  99. pyedb/ipc2581/ecad/cad_data/polygon.py +169 -0
  100. pyedb/ipc2581/ecad/cad_data/profile.py +40 -0
  101. pyedb/ipc2581/ecad/cad_data/stackup.py +31 -0
  102. pyedb/ipc2581/ecad/cad_data/stackup_group.py +42 -0
  103. pyedb/ipc2581/ecad/cad_data/stackup_layer.py +21 -0
  104. pyedb/ipc2581/ecad/cad_data/step.py +275 -0
  105. pyedb/ipc2581/ecad/cad_header.py +33 -0
  106. pyedb/ipc2581/ecad/ecad.py +19 -0
  107. pyedb/ipc2581/ecad/spec.py +46 -0
  108. pyedb/ipc2581/history_record.py +37 -0
  109. pyedb/ipc2581/ipc2581.py +387 -0
  110. pyedb/ipc2581/logistic_header.py +25 -0
  111. pyedb/misc/__init__.py +0 -0
  112. pyedb/misc/aedtlib_personalib_install.py +14 -0
  113. pyedb/misc/downloads.py +322 -0
  114. pyedb/misc/misc.py +67 -0
  115. pyedb/misc/pyedb.runtimeconfig.json +13 -0
  116. pyedb/misc/siw_feature_config/__init__.py +0 -0
  117. pyedb/misc/siw_feature_config/emc/__init__.py +0 -0
  118. pyedb/misc/siw_feature_config/emc/component_tags.py +46 -0
  119. pyedb/misc/siw_feature_config/emc/net_tags.py +37 -0
  120. pyedb/misc/siw_feature_config/emc/tag_library.py +62 -0
  121. pyedb/misc/siw_feature_config/emc/xml_generic.py +78 -0
  122. pyedb/misc/siw_feature_config/emc_rule_checker_settings.py +179 -0
  123. pyedb/misc/utilities.py +27 -0
  124. pyedb/modeler/geometry_operators.py +2082 -0
  125. pyedb-0.2.0.dist-info/LICENSE +21 -0
  126. pyedb-0.2.0.dist-info/METADATA +208 -0
  127. pyedb-0.2.0.dist-info/RECORD +128 -0
  128. pyedb-0.2.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,716 @@
1
+ from pyedb.generic.general_methods import generate_unique_name, pyedb_function_handler
2
+
3
+
4
+ class BaseSimulationSetup(object):
5
+ """Provide base simulation setup.
6
+
7
+ Parameters
8
+ ----------
9
+ pedb : :class:`pyedb.dotnet.edb.Edb`
10
+ Inherited object.
11
+ edb_object : :class:`Ansys.Ansoft.Edb.Utility.SIWaveSimulationSetup`,
12
+ :class:`Ansys.Ansoft.Edb.Utility.SIWDCIRSimulationSettings`,
13
+ :class:`Ansys.Ansoft.Edb.Utility.HFSSSimulationSettings`
14
+ EDB object.
15
+ """
16
+
17
+ def __init__(self, pedb, edb_setup=None):
18
+ self._pedb = pedb
19
+ self._edb_object = edb_setup
20
+ self._setup_type = ""
21
+ self._setup_type_mapping = {
22
+ "kHFSS": self._pedb.simsetupdata.HFSSSimulationSettings,
23
+ "kPEM": None,
24
+ "kSIwave": self._pedb.simsetupdata.SIwave.SIWSimulationSettings,
25
+ "kLNA": None,
26
+ "kTransient": None,
27
+ "kQEye": None,
28
+ "kVEye": None,
29
+ "kAMI": None,
30
+ "kAnalysisOption": None,
31
+ "kSIwaveDCIR": self._pedb.simsetupdata.SIwave.SIWDCIRSimulationSettings,
32
+ "kSIwaveEMI": None,
33
+ "kHFSSPI": None,
34
+ "kDDRwizard": None,
35
+ "kQ3D": None,
36
+ "kNumSetupTypes": None,
37
+ }
38
+ if self._edb_object:
39
+ self._name = self._edb_object.GetName()
40
+
41
+ self._sweep_list = {}
42
+
43
+ @pyedb_function_handler
44
+ def _create(self, name=None):
45
+ """Create a simulation setup."""
46
+ if not name:
47
+ name = generate_unique_name(self.setup_type)
48
+ self._name = name
49
+
50
+ setup_type = self._setup_type_mapping[self._setup_type]
51
+ edb_setup_info = self._pedb.simsetupdata.SimSetupInfo[setup_type]()
52
+ edb_setup_info.Name = name
53
+ self._edb_object = self._set_edb_setup_info(edb_setup_info)
54
+ self._update_setup()
55
+
56
+ @pyedb_function_handler
57
+ def _set_edb_setup_info(self, edb_setup_info):
58
+ """Create a setup object from a setup information object."""
59
+ utility = self._pedb._edb.Utility
60
+ setup_type_mapping = {
61
+ "kHFSS": utility.HFSSSimulationSetup,
62
+ "kPEM": None,
63
+ "kSIwave": utility.SIWaveSimulationSetup,
64
+ "kLNA": None,
65
+ "kTransient": None,
66
+ "kQEye": None,
67
+ "kVEye": None,
68
+ "kAMI": None,
69
+ "kAnalysisOption": None,
70
+ "kSIwaveDCIR": utility.SIWaveDCIRSimulationSetup,
71
+ "kSIwaveEMI": None,
72
+ "kHFSSPI": None,
73
+ "kDDRwizard": None,
74
+ "kQ3D": None,
75
+ "kNumSetupTypes": None,
76
+ }
77
+ setup_utility = setup_type_mapping[self._setup_type]
78
+ return setup_utility(edb_setup_info)
79
+
80
+ @pyedb_function_handler()
81
+ def _update_setup(self):
82
+ """Update setup in EDB."""
83
+ if self._setup_type == "kHFSS":
84
+ mesh_operations = self.get_sim_setup_info.SimulationSettings.MeshOperations
85
+ mesh_operations.Clear()
86
+ for mop in self.mesh_operations.values():
87
+ mesh_operations.Add(mop.mesh_operation)
88
+
89
+ if self._name in self._pedb.setups:
90
+ self._pedb.layout.cell.DeleteSimulationSetup(self._name)
91
+ if not self._pedb.layout.cell.AddSimulationSetup(self._edb_object):
92
+ raise Exception("Updating setup {} failed.".format(self._name))
93
+ else:
94
+ return True
95
+
96
+ @property
97
+ def enabled(self):
98
+ """Flag indicating if the setup is enabled."""
99
+ return self.get_sim_setup_info.SimulationSettings.Enabled
100
+
101
+ @enabled.setter
102
+ def enabled(self, value):
103
+ edb_setup_info = self.get_sim_setup_info
104
+ edb_setup_info.SimulationSettings.Enabled = value
105
+ self._edb_object = self._set_edb_setup_info(edb_setup_info)
106
+ self._update_setup()
107
+
108
+ @property
109
+ def name(self):
110
+ """Name of the setup."""
111
+ return self._edb_object.GetName()
112
+
113
+ @name.setter
114
+ def name(self, value):
115
+ self._pedb.layout.cell.DeleteSimulationSetup(self.name)
116
+ edb_setup_info = self.get_sim_setup_info
117
+ edb_setup_info.Name = value
118
+ self._name = value
119
+ self._edb_object = self._set_edb_setup_info(edb_setup_info)
120
+ self._update_setup()
121
+
122
+ @property
123
+ def position(self):
124
+ """Position in the setup list."""
125
+ return self.get_sim_setup_info.Position
126
+
127
+ @position.setter
128
+ def position(self, value):
129
+ edb_setup_info = self.get_sim_setup_info.SimulationSettings
130
+ edb_setup_info.Position = value
131
+ self._set_edb_setup_info(edb_setup_info)
132
+ self._update_setup()
133
+
134
+ @property
135
+ def setup_type(self):
136
+ """Type of the setup."""
137
+ return self.get_sim_setup_info.SimSetupType.ToString()
138
+
139
+ @property
140
+ def frequency_sweeps(self):
141
+ """List of frequency sweeps."""
142
+ temp = {}
143
+ for i in list(self.get_sim_setup_info.SweepDataList):
144
+ temp[i.Name] = EdbFrequencySweep(self, None, i.Name, i)
145
+ return temp
146
+
147
+ @pyedb_function_handler
148
+ def _add_frequency_sweep(self, sweep_data):
149
+ """Add a frequency sweep.
150
+
151
+ Parameters
152
+ ----------
153
+ sweep_data: EdbFrequencySweep
154
+ """
155
+ self._sweep_list[sweep_data.name] = sweep_data
156
+ edb_setup_info = self.get_sim_setup_info
157
+
158
+ if self._setup_type in ["kSIwave", "kHFSS"]:
159
+ for _, v in self._sweep_list.items():
160
+ edb_setup_info.SweepDataList.Add(v._edb_object)
161
+
162
+ self._edb_object = self._set_edb_setup_info(edb_setup_info)
163
+ self._update_setup()
164
+
165
+ @pyedb_function_handler
166
+ def delete_frequency_sweep(self, sweep_data):
167
+ """Delete a frequency sweep.
168
+
169
+ Parameters
170
+ ----------
171
+ sweep_data : EdbFrequencySweep.
172
+ """
173
+ name = sweep_data.name
174
+ if name in self._sweep_list:
175
+ self._sweep_list.pop(name)
176
+
177
+ fsweep = []
178
+ for k, val in self.frequency_sweeps.items():
179
+ if not k == name:
180
+ fsweep.append(val)
181
+ self.get_sim_setup_info.SweepDataList.Clear()
182
+ for i in fsweep:
183
+ self.get_sim_setup_info.SweepDataList.Add(i._edb_object)
184
+ self._update_setup()
185
+ return True if name in self.frequency_sweeps else False
186
+
187
+ @pyedb_function_handler()
188
+ def add_frequency_sweep(self, name=None, frequency_sweep=None):
189
+ """Add frequency sweep.
190
+
191
+ Parameters
192
+ ----------
193
+ name : str, optional
194
+ Name of the frequency sweep. The default is ``None``.
195
+ frequency_sweep : list, optional
196
+ List of frequency points. The default is ``None``.
197
+
198
+ Returns
199
+ -------
200
+ :class:`pyedb.dotnet.edb_core.edb_data.simulation_setup_data.EdbFrequencySweep`
201
+
202
+ Examples
203
+ --------
204
+ >>> setup1 = edbapp.create_siwave_syz_setup("setup1")
205
+ >>> setup1.add_frequency_sweep(frequency_sweep=[
206
+ ... ["linear count", "0", "1kHz", 1],
207
+ ... ["log scale", "1kHz", "0.1GHz", 10],
208
+ ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"],
209
+ ... ])
210
+ """
211
+ if name in self.frequency_sweeps:
212
+ return False
213
+
214
+ if not frequency_sweep:
215
+ frequency_sweep = [["linear scale", "0.1GHz", "10GHz", "0.1GHz"]]
216
+ elif not isinstance(frequency_sweep[0], list):
217
+ frequency_sweep = [frequency_sweep]
218
+
219
+ if not name:
220
+ name = generate_unique_name("sweep")
221
+ sweep = EdbFrequencySweep(self, frequency_sweep, name)
222
+ self._add_frequency_sweep(sweep)
223
+ self._update_setup()
224
+ return sweep
225
+
226
+
227
+ class EdbFrequencySweep(object):
228
+ """Manages EDB methods for a frequency sweep.
229
+
230
+ Parameters
231
+ ----------
232
+ sim_setup : :class:`pyedb.dotnet.edb_core.edb_data.siwave_simulation_setup_data.SiwaveSYZSimulationSetup`
233
+ name : str, optional
234
+ Name of the frequency sweep.
235
+ edb_sweep_data : :class:`Ansys.Ansoft.Edb.Utility.SIWDCIRSimulationSettings`, optional
236
+ EDB object. The default is ``None``.
237
+ """
238
+
239
+ def __init__(self, sim_setup, frequency_sweep=None, name=None, edb_sweep_data=None):
240
+ self._sim_setup = sim_setup
241
+
242
+ if edb_sweep_data:
243
+ self._edb_sweep_data = edb_sweep_data
244
+ self._name = self._edb_sweep_data.Name
245
+ else:
246
+ if not name:
247
+ self._name = generate_unique_name("sweep")
248
+ else:
249
+ self._name = name
250
+ self._edb_sweep_data = self._pedb.simsetupdata.SweepData(self._name)
251
+ self.set_frequencies(frequency_sweep)
252
+
253
+ @property
254
+ def _edb_object(self):
255
+ return self._edb_sweep_data
256
+
257
+ @property
258
+ def _pedb(self):
259
+ """EDB."""
260
+ return self._sim_setup._pedb
261
+
262
+ @pyedb_function_handler()
263
+ def _update_sweep(self):
264
+ """Update the sweep."""
265
+ self._sim_setup.delete_frequency_sweep(self)
266
+ self._sim_setup._add_frequency_sweep(self)
267
+ return
268
+
269
+ @property
270
+ def name(self):
271
+ """Name of the sweep."""
272
+ return self._edb_sweep_data.Name
273
+
274
+ @name.setter
275
+ def name(self, value):
276
+ self._edb_sweep_data.Name = value
277
+ self._update_sweep()
278
+
279
+ @property
280
+ def sweep_type(self):
281
+ """Sweep type."""
282
+ return
283
+
284
+ @property
285
+ def frequencies(self):
286
+ """List of frequency points."""
287
+ return list(self._edb_sweep_data.Frequencies)
288
+
289
+ @property
290
+ def adaptive_sampling(self):
291
+ """Flag indicating if adaptive sampling is turned on.
292
+
293
+ Returns
294
+ -------
295
+ bool
296
+ ``True`` if adaptive sampling is used, ``False`` otherwise.
297
+ """
298
+ return self._edb_sweep_data.AdaptiveSampling
299
+
300
+ @property
301
+ def adv_dc_extrapolation(self):
302
+ """Flag indicating if advanced DC extrapolation is turned on.
303
+
304
+ Returns
305
+ -------
306
+ bool
307
+ ``True`` if advanced DC Extrapolation is used, ``False`` otherwise.
308
+ """
309
+ return self._edb_sweep_data.AdvDCExtrapolation
310
+
311
+ @property
312
+ def compute_dc_point(self):
313
+ """Flag indicating if computing the exact DC point is turned on."""
314
+ return self._edb_sweep_data.ComputeDCPoint
315
+
316
+ @compute_dc_point.setter
317
+ def compute_dc_point(self, value):
318
+ self._edb_sweep_data.ComputeDCPoint = value
319
+ self._update_sweep()
320
+
321
+ @property
322
+ def auto_s_mat_only_solve(self):
323
+ """Flag indicating if Auto SMatrix only solve is turned on."""
324
+ return self._edb_sweep_data.AutoSMatOnlySolve
325
+
326
+ @property
327
+ def enforce_causality(self):
328
+ """Flag indicating if causality is enforced.
329
+
330
+ Returns
331
+ -------
332
+ bool
333
+ ``True`` if enforce causality is used, ``False`` otherwise.
334
+ """
335
+ return self._edb_sweep_data.EnforceCausality
336
+
337
+ @property
338
+ def enforce_dc_and_causality(self):
339
+ """Flag indicating if DC point and causality are enforced.
340
+
341
+ Returns
342
+ -------
343
+ bool
344
+ ``True`` if enforce dc point and causality is used, ``False`` otherwise.
345
+ """
346
+ return self._edb_sweep_data.EnforceDCAndCausality
347
+
348
+ @property
349
+ def enforce_passivity(self):
350
+ """Flag indicating if passivity is enforced.
351
+
352
+ Returns
353
+ -------
354
+ bool
355
+ ``True`` if enforce passivity is used, ``False`` otherwise.
356
+ """
357
+ return self._edb_sweep_data.EnforcePassivity
358
+
359
+ @property
360
+ def freq_sweep_type(self):
361
+ """Sweep type.
362
+
363
+ Options are:
364
+ - ``"kInterpolatingSweep"``
365
+ - ``"kDiscreteSweep"``
366
+ - ``"kBroadbandFastSweep"``
367
+
368
+ Returns
369
+ -------
370
+ str
371
+ Sweep type.
372
+ """
373
+ return self._edb_sweep_data.FreqSweepType.ToString()
374
+
375
+ @property
376
+ def interpolation_use_full_basis(self):
377
+ """Flag indicating if full-basis elements is used.
378
+
379
+ Returns
380
+ -------
381
+ bool
382
+ ``True`` if full basis interpolation is used, ``False`` otherwise.
383
+ """
384
+ return self._edb_sweep_data.InterpUseFullBasis
385
+
386
+ @property
387
+ def interpolation_use_port_impedance(self):
388
+ """Flag indicating if port impedance interpolation is turned on.
389
+
390
+ Returns
391
+ -------
392
+ bool
393
+ ``True`` if port impedance is used, ``False`` otherwise.
394
+ """
395
+ return self._edb_sweep_data.InterpUsePortImpedance
396
+
397
+ @property
398
+ def interpolation_use_prop_const(self):
399
+ """Flag indicating if propagation constants are used.
400
+
401
+ Returns
402
+ -------
403
+ bool
404
+ ``True`` if propagation constants are used, ``False`` otherwise.
405
+ """
406
+ return self._edb_sweep_data.InterpUsePropConst
407
+
408
+ @property
409
+ def interpolation_use_s_matrix(self):
410
+ """Flag indicating if the S matrix is used.
411
+
412
+ Returns
413
+ -------
414
+ bool
415
+ ``True`` if S matrix are used, ``False`` otherwise.
416
+ """
417
+ return self._edb_sweep_data.InterpUseSMatrix
418
+
419
+ @property
420
+ def max_solutions(self):
421
+ """Number of maximum solutions.
422
+
423
+ Returns
424
+ -------
425
+ int
426
+ """
427
+ return self._edb_sweep_data.MaxSolutions
428
+
429
+ @property
430
+ def min_freq_s_mat_only_solve(self):
431
+ """Minimum frequency SMatrix only solve.
432
+
433
+ Returns
434
+ -------
435
+ str
436
+ Frequency with units.
437
+ """
438
+ return self._edb_sweep_data.MinFreqSMatOnlySolve
439
+
440
+ @property
441
+ def min_solved_freq(self):
442
+ """Minimum solved frequency with units.
443
+
444
+ Returns
445
+ -------
446
+ str
447
+ Frequency with units.
448
+ """
449
+ return self._edb_sweep_data.MinSolvedFreq
450
+
451
+ @property
452
+ def passivity_tolerance(self):
453
+ """Tolerance for passivity enforcement.
454
+
455
+ Returns
456
+ -------
457
+ float
458
+ """
459
+ return self._edb_sweep_data.PassivityTolerance
460
+
461
+ @property
462
+ def relative_s_error(self):
463
+ """S-parameter error tolerance.
464
+
465
+ Returns
466
+ -------
467
+ float
468
+ """
469
+ return self._edb_sweep_data.RelativeSError
470
+
471
+ @property
472
+ def save_fields(self):
473
+ """Flag indicating if the extraction of surface current data is turned on.
474
+
475
+ Returns
476
+ -------
477
+ bool
478
+ ``True`` if save fields is enabled, ``False`` otherwise.
479
+ """
480
+ return self._edb_sweep_data.SaveFields
481
+
482
+ @property
483
+ def save_rad_fields_only(self):
484
+ """Flag indicating if the saving of only radiated fields is turned on.
485
+
486
+ Returns
487
+ -------
488
+ bool
489
+ ``True`` if save radiated field only is used, ``False`` otherwise.
490
+ """
491
+ return self._edb_sweep_data.SaveRadFieldsOnly
492
+
493
+ @property
494
+ def use_q3d_for_dc(self):
495
+ """Flag indicating if the Q3D solver is used for DC point extraction.
496
+
497
+ Returns
498
+ -------
499
+ bool
500
+ ``True`` if Q3d for DC point is used, ``False`` otherwise.
501
+ """
502
+ return self._edb_sweep_data.UseQ3DForDC
503
+
504
+ @adaptive_sampling.setter
505
+ def adaptive_sampling(self, value):
506
+ self._edb_sweep_data.AdaptiveSampling = value
507
+ self._update_sweep()
508
+
509
+ @adv_dc_extrapolation.setter
510
+ def adv_dc_extrapolation(self, value):
511
+ self._edb_sweep_data.AdvDCExtrapolation = value
512
+ self._update_sweep()
513
+
514
+ @auto_s_mat_only_solve.setter
515
+ def auto_s_mat_only_solve(self, value):
516
+ self._edb_sweep_data.AutoSMatOnlySolve = value
517
+ self._update_sweep()
518
+
519
+ @enforce_causality.setter
520
+ def enforce_causality(self, value):
521
+ self._edb_sweep_data.EnforceCausality = value
522
+ self._update_sweep()
523
+
524
+ @enforce_dc_and_causality.setter
525
+ def enforce_dc_and_causality(self, value):
526
+ self._edb_sweep_data.EnforceDCAndCausality = value
527
+ self._update_sweep()
528
+
529
+ @enforce_passivity.setter
530
+ def enforce_passivity(self, value):
531
+ self._edb_sweep_data.EnforcePassivity = value
532
+ self._update_sweep()
533
+
534
+ @freq_sweep_type.setter
535
+ def freq_sweep_type(self, value):
536
+ edb_freq_sweep_type = self._edb_sweep_data.TFreqSweepType
537
+ if value in [0, "kInterpolatingSweep"]:
538
+ self._edb_sweep_data.FreqSweepType = edb_freq_sweep_type.kInterpolatingSweep
539
+ elif value in [1, "kDiscreteSweep"]:
540
+ self._edb_sweep_data.FreqSweepType = edb_freq_sweep_type.kDiscreteSweep
541
+ elif value in [2, "kBroadbandFastSweep"]:
542
+ self._edb_sweep_data.FreqSweepType = edb_freq_sweep_type.kBroadbandFastSweep
543
+ elif value in [3, "kNumSweepTypes"]:
544
+ self._edb_sweep_data.FreqSweepType = edb_freq_sweep_type.kNumSweepTypes
545
+ self._edb_sweep_data.FreqSweepType.ToString()
546
+
547
+ @interpolation_use_full_basis.setter
548
+ def interpolation_use_full_basis(self, value):
549
+ self._edb_sweep_data.InterpUseFullBasis = value
550
+ self._update_sweep()
551
+
552
+ @interpolation_use_port_impedance.setter
553
+ def interpolation_use_port_impedance(self, value):
554
+ self._edb_sweep_data.InterpUsePortImpedance = value
555
+ self._update_sweep()
556
+
557
+ @interpolation_use_prop_const.setter
558
+ def interpolation_use_prop_const(self, value):
559
+ self._edb_sweep_data.InterpUsePropConst = value
560
+ self._update_sweep()
561
+
562
+ @interpolation_use_s_matrix.setter
563
+ def interpolation_use_s_matrix(self, value):
564
+ self._edb_sweep_data.InterpUseSMatrix = value
565
+ self._update_sweep()
566
+
567
+ @max_solutions.setter
568
+ def max_solutions(self, value):
569
+ self._edb_sweep_data.MaxSolutions = value
570
+ self._update_sweep()
571
+
572
+ @min_freq_s_mat_only_solve.setter
573
+ def min_freq_s_mat_only_solve(self, value):
574
+ self._edb_sweep_data.MinFreqSMatOnlySolve = value
575
+ self._update_sweep()
576
+
577
+ @min_solved_freq.setter
578
+ def min_solved_freq(self, value):
579
+ self._edb_sweep_data.MinSolvedFreq = value
580
+ self._update_sweep()
581
+
582
+ @passivity_tolerance.setter
583
+ def passivity_tolerance(self, value):
584
+ self._edb_sweep_data.PassivityTolerance = value
585
+ self._update_sweep()
586
+
587
+ @relative_s_error.setter
588
+ def relative_s_error(self, value):
589
+ self._edb_sweep_data.RelativeSError = value
590
+ self._update_sweep()
591
+
592
+ @save_fields.setter
593
+ def save_fields(self, value):
594
+ self._edb_sweep_data.SaveFields = value
595
+ self._update_sweep()
596
+
597
+ @save_rad_fields_only.setter
598
+ def save_rad_fields_only(self, value):
599
+ self._edb_sweep_data.SaveRadFieldsOnly = value
600
+ self._update_sweep()
601
+
602
+ @use_q3d_for_dc.setter
603
+ def use_q3d_for_dc(self, value):
604
+ self._edb_sweep_data.UseQ3DForDC = value
605
+ self._update_sweep()
606
+
607
+ @pyedb_function_handler()
608
+ def _set_frequencies(self, freq_sweep_string="Linear Step: 0GHz to 20GHz, step=0.05GHz"):
609
+ self._edb_sweep_data.SetFrequencies(freq_sweep_string)
610
+ self._update_sweep()
611
+
612
+ @pyedb_function_handler()
613
+ def set_frequencies_linear_scale(self, start="0.1GHz", stop="20GHz", step="50MHz"):
614
+ """Set a linear scale frequency sweep.
615
+
616
+ Parameters
617
+ ----------
618
+ start : str, float, optional
619
+ Start frequency. The default is ``"0.1GHz"``.
620
+ stop : str, float, optional
621
+ Stop frequency. The default is ``"20GHz"``.
622
+ step : str, float, optional
623
+ Step frequency. The default is ``"50MHz"``.
624
+
625
+ Returns
626
+ -------
627
+ bool
628
+ ``True`` if correctly executed, ``False`` otherwise.
629
+ """
630
+ self._edb_sweep_data.Frequencies = self._edb_sweep_data.SetFrequencies(start, stop, step)
631
+ return self._update_sweep()
632
+
633
+ @pyedb_function_handler()
634
+ def set_frequencies_linear_count(self, start="1kHz", stop="0.1GHz", count=10):
635
+ """Set a linear count frequency sweep.
636
+
637
+ Parameters
638
+ ----------
639
+ start : str, float, optional
640
+ Start frequency. The default is ``"1kHz"``.
641
+ stop : str, float, optional
642
+ Stop frequency. The default is ``"0.1GHz"``.
643
+ count : int, optional
644
+ Step frequency. The default is ``10``.
645
+
646
+ Returns
647
+ -------
648
+ bool
649
+ ``True`` if correctly executed, ``False`` otherwise.
650
+ """
651
+ start = self._sim_setup._pedb.arg_to_dim(start, "Hz")
652
+ stop = self._sim_setup._pedb.arg_to_dim(stop, "Hz")
653
+ self._edb_sweep_data.Frequencies = self._edb_sweep_data.SetFrequencies(start, stop, count)
654
+ return self._update_sweep()
655
+
656
+ @pyedb_function_handler()
657
+ def set_frequencies_log_scale(self, start="1kHz", stop="0.1GHz", samples=10):
658
+ """Set a log-count frequency sweep.
659
+
660
+ Parameters
661
+ ----------
662
+ start : str, float, optional
663
+ Start frequency. The default is ``"1kHz"``.
664
+ stop : str, float, optional
665
+ Stop frequency. The default is ``"0.1GHz"``.
666
+ samples : int, optional
667
+ Step frequency. The default is ``10``.
668
+
669
+ Returns
670
+ -------
671
+ bool
672
+ ``True`` if correctly executed, ``False`` otherwise.
673
+ """
674
+ start = self._sim_setup._pedb.arg_to_dim(start, "Hz")
675
+ stop = self._sim_setup._pedb.arg_to_dim(stop, "Hz")
676
+ self._edb_sweep_data.Frequencies = self._edb_sweep_data.SetLogFrequencies(start, stop, samples)
677
+ return self._update_sweep()
678
+
679
+ @pyedb_function_handler()
680
+ def set_frequencies(self, frequency_list=None, update=True):
681
+ """Set frequency list to the sweep frequencies.
682
+
683
+ Parameters
684
+ ----------
685
+ frequency_list : list, optional
686
+ List of lists with four elements. The default is ``None``. If provided, each list must contain:
687
+ 1 - frequency type (``"linear count"``, ``"log scale"``, or ``"linear scale"``)
688
+ 2 - start frequency
689
+ 3 - stop frequency
690
+ 4 - step frequency or count
691
+ Returns
692
+ -------
693
+ bool
694
+ ``True`` if correctly executed, ``False`` otherwise.
695
+ """
696
+ if not frequency_list:
697
+ frequency_list = [
698
+ ["linear count", "0", "1kHz", 1],
699
+ ["log scale", "1kHz", "0.1GHz", 10],
700
+ ["linear scale", "0.1GHz", "10GHz", "0.1GHz"],
701
+ ]
702
+ temp = []
703
+ for i in frequency_list:
704
+ if i[0] == "linear count":
705
+ temp.extend(list(self._edb_sweep_data.SetFrequencies(i[1], i[2], i[3])))
706
+ elif i[0] == "linear scale":
707
+ temp.extend(list(self._edb_sweep_data.SetFrequencies(i[1], i[2], i[3])))
708
+ elif i[0] == "log scale":
709
+ temp.extend(list(self._edb_sweep_data.SetLogFrequencies(i[1], i[2], i[3])))
710
+ else:
711
+ return False
712
+ self._edb_sweep_data.Frequencies.Clear()
713
+ for i in temp:
714
+ self._edb_sweep_data.Frequencies.Add(i)
715
+ if update:
716
+ return self._update_sweep()