Skip to content

Commit 2c30142

Browse files
authored
Expose the 'Parameter' option when reading the Touchstone file. (#967)
* dll_path variable is never used. * Test circuit setup name. * Improve docstring for method existing_analysis_setups. * Provide the name of the primitive objects deleted in the log. * Remove unused variable in application analysis. * Docstring example was incorrect in ModelPlotter() class in the plot module. * Use if a not in my_object instead of if not a in my_object. * Remove the antipad property that was duplicated in the class PDSLayer. * The 'Parameter' option was not read properly when reading the Touchstone file. * Test the TouchstoneParser with verbose option enabled.
1 parent efd119b commit 2c30142

File tree

9 files changed

+13
-16
lines changed

9 files changed

+13
-16
lines changed

_unittest/test_21_Circuit.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_05c_create_component(self):
8383
def test_06a_create_setup(self):
8484
setup_name = "LNA"
8585
LNA_setup = self.aedtapp.create_setup(setup_name)
86-
assert LNA_setup
86+
assert LNA_setup.name == "LNA"
8787

8888
def test_06b_add_3dlayout_component(self):
8989
myedb = self.aedtapp.modeler.schematic.add_subcircuit_3dlayout("Galileo_G87173_204")
@@ -177,6 +177,10 @@ def test_16_read_touchstone(self):
177177
assert data.data_imag()
178178
assert data.data_db()
179179

180+
data_with_verbose = read_touchstone(os.path.join(self.local_scratch.path, touchstone), verbose=True)
181+
assert max(data_with_verbose.data_magnitude()) > 0.37
182+
assert max(data_with_verbose.data_magnitude()) < 0.38
183+
180184
def test_17_create_setup(self):
181185
setup_name = "Dom_LNA"
182186
LNA_setup = self.aedtapp.create_setup(setup_name)

pyaedt/application/Analysis.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,6 @@ def get_output_variable(self, variable):
13671367
"""
13681368
assert variable in self.output_variables, "Output variable {} does not exist.".format(variable)
13691369
nominal_variation = self.odesign.GetNominalVariation()
1370-
sol_type = self.solution_type
13711370
value = self.ooutput_variable.GetOutputVariableValue(
13721371
variable, nominal_variation, self.existing_analysis_sweeps[0], self.solution_type, []
13731372
)

pyaedt/application/AnalysisTwinBuilder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AnalysisTwinBuilder(Analysis):
2121

2222
@property
2323
def existing_analysis_setups(self):
24-
"""Existing analysis setups.
24+
"""Get all analysis solution setups.
2525
2626
References
2727
----------

pyaedt/edb.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,6 @@ def open_edb_inside_aedt(self, init_dlls=False):
385385
)
386386
if self._active_cell is None:
387387
self._active_cell = list(self._db.TopCircuitCells)[0]
388-
dllpath = os.path.join(os.path.abspath(os.path.dirname(__file__)), "dlls", "EDBLib")
389388
if self._db and self._active_cell:
390389
if not os.path.exists(self.edbpath):
391390
os.makedirs(self.edbpath)

pyaedt/generic/TouchstoneParser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,11 +687,11 @@ def _parse_option_line(file, verbose=False):
687687

688688
if verbose:
689689
print(" Frequency unit: %g Hz" % frequnit)
690-
print(" Parameter: %s" % type)
690+
print(" Parameter: %s" % parameter)
691691
print(" Format: %s" % format)
692692
print(" Reference R: %g" % z0)
693693

694-
return (frequnit, type, format, z0)
694+
return (frequnit, parameter, format, z0)
695695

696696

697697
def _get_next_line_data(file):

pyaedt/generic/plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ class ModelPlotter(object):
393393
>>> model.add_object(r'D:\Simulation\antenna.obj', (200,20,255), 0.6, "in")
394394
>>> model.add_object(r'D:\Simulation\helix.obj', (0,255,0), 0.5, "in")
395395
>>> frames = [r'D:\Simulation\helic_antenna.csv', r'D:\Simulation\helic_antenna_10.fld',
396-
>>> r'D:\Simulation\helic_antenna_20.fld', r'D:\Simulation\helic_antenna_30.fld',
397-
>>> r'D:\Simulation\helic_antenna_40.fld']
396+
... r'D:\Simulation\helic_antenna_20.fld', r'D:\Simulation\helic_antenna_30.fld',
397+
... r'D:\Simulation\helic_antenna_40.fld']
398398
>>> model.gif_file = r"D:\Simulation\animation.gif"
399399
>>> model.animate()
400400
"""

pyaedt/generic/process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def solve(self):
194194
if os.path.exists(exec_file):
195195
with open(exec_file, "r+") as f:
196196
content = f.readlines()
197-
if not "SetNumCpus" in content:
197+
if "SetNumCpus" not in content:
198198
f.writelines(str.format("SetNumCpus {}", str(self.nbcores)) + "\n")
199199
f.writelines("SaveSiw")
200200
else:

pyaedt/modeler/Object3d.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,11 +2201,6 @@ def pad(self, value=None):
22012201
else:
22022202
self._pad = Padstack.PDSHole(holetype="None", sizes=[])
22032203

2204-
@property
2205-
def antipad(self):
2206-
"""Antipad."""
2207-
return self._antipad
2208-
22092204
@antipad.setter
22102205
def antipad(self, value=None):
22112206
if value:

pyaedt/modeler/Primitives.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@ def delete(self, objects=None):
17331733
try:
17341734
self._oeditor.Delete(arg)
17351735
except:
1736-
self.logger.warning("Failed to delete {}".format(objects_str))
1736+
self.logger.warning("Failed to delete {}.".format(objects_str))
17371737
remaining -= slice
17381738
if remaining > 0:
17391739
objects = objects[slice:]
@@ -1742,7 +1742,7 @@ def delete(self, objects=None):
17421742

17431743
if len(objects) > 0:
17441744
self.cleanup_objects()
1745-
self.logger.info("Deleted {} Objects".format(num_objects, objects_str))
1745+
self.logger.info("Deleted {} Objects: {}.".format(num_objects, objects_str))
17461746
return True
17471747

17481748
@pyaedt_function_handler()

0 commit comments

Comments
 (0)