Skip to content

Commit a24bfdb

Browse files
maxcapodi78Samuelopez-ansysPipKat
authored
REFACTOR: added missing images (#4874)
Co-authored-by: maxcapodi78 <Shark78> Co-authored-by: Samuel Lopez <[email protected]> Co-authored-by: Kathy Pippert <[email protected]>
1 parent e74bc88 commit a24bfdb

File tree

8 files changed

+69
-23
lines changed

8 files changed

+69
-23
lines changed

doc/source/API/Visualization.rst

+33-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,43 @@ models and 3D plots.
3434
ModelPlotter
3535

3636

37-
The class TouchstoneData instead, is based on `scikit-rf <https://scikit-rf.readthedocs.io/en/latest/>`_,
37+
The following methods allows to read and check touchstone files.
38+
39+
.. currentmodule:: pyaedt.generic.touchstone_parser
40+
41+
.. autosummary::
42+
:toctree: _autosummary
43+
:nosignatures:
44+
45+
read_touchstone
46+
check_touchstone_files
47+
48+
49+
50+
Using the above methods you are getting an object of a class TouchstoneData.
51+
The class TouchstoneData is based on `scikit-rf <https://scikit-rf.readthedocs.io/en/latest/>`_,
52+
Additional methods are added to provide easy access to touchstone curves.
3853

3954

4055
.. currentmodule:: pyaedt.generic.touchstone_parser
4156

42-
.. autoclass:: TouchstoneData
57+
.. autosummary::
58+
:toctree: _autosummary
59+
:nosignatures:
60+
61+
TouchstoneData.get_insertion_loss_index
62+
TouchstoneData.plot_insertion_losses
63+
TouchstoneData.plot
64+
TouchstoneData.plot_return_losses
65+
TouchstoneData.get_mixed_mode_touchstone_data
66+
TouchstoneData.get_return_loss_index
67+
TouchstoneData.get_insertion_loss_index_from_prefix
68+
TouchstoneData.get_next_xtalk_index
69+
TouchstoneData.get_fext_xtalk_index_from_prefix
70+
TouchstoneData.plot_next_xtalk_losses
71+
TouchstoneData.plot_fext_xtalk_losses
72+
TouchstoneData.get_worst_curve
73+
4374

4475

4576
Here an example on how to use TouchstoneData class.
Loading
Loading

examples/07-Circuit/Reports.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,14 @@
8787
###############################################################################
8888
# Create transient report
8989
# ~~~~~~~~~~~~~~~~~~~~~~~
90-
# Property dictionary can be customized in any aspect and new report can be created easily.
91-
# In this example the curve name is customized.
90+
# You can customize any aspect of the property dictionary and easily create a new report.
91+
# The following code customizes the curve name.
92+
# The expressions key can be a list of expressions as follows or a dictionary containing the expressions to plot and line properties.
93+
# props["expressions"] = { "V(Battery)" :
94+
# {"color": [0, 255, 0], "trace_style": "Solid", "width": 1, "trace_type": "Continuous"}}
9295

93-
props["expressions"] = {"V(Battery)": {}, "V(U1_VDD)": {}}
96+
97+
props["expressions"] = ["V(Battery)", "V(U1_VDD)"]
9498
props["plot_name"] = "Battery Voltage"
9599
report3 = cir.post.create_report_from_configuration(report_settings=props, solution_name="NexximTransient")
96100
out = cir.post.export_report_to_jpg(cir.working_directory, report3.plot_name)

pyaedt/generic/touchstone_parser.py

+11-14
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ def plot_insertion_losses(self, threshold=-3, plot=True):
149149
----------
150150
threshold : float, int, optional
151151
Threshold to determine shorted ports in dB.
152-
plot: bool
153-
Whether to plot.
152+
plot : bool, optional
153+
Whether to plot. The default is ``True``.
154154
155155
Returns
156156
-------
@@ -171,7 +171,7 @@ def plot(self, index_couples=None, show=True):
171171
----------
172172
index_couples : list, optional
173173
List of indexes couple to plot. Default is ``None`` to plot all ``port_tuples``.
174-
show: bool
174+
show : bool
175175
Whether to plot. Default is ``True``.
176176
177177
Returns
@@ -191,8 +191,6 @@ def plot(self, index_couples=None, show=True):
191191
def plot_return_losses(self): # pragma: no cover
192192
"""Plot all return losses.
193193
194-
Parameters
195-
----------
196194
Returns
197195
-------
198196
bool
@@ -344,7 +342,7 @@ def get_next_xtalk_index(self, tx_prefix=""):
344342
Returns
345343
-------
346344
list
347-
list of index couples representing Near End XTalks
345+
List of index couples representing Near End XTalks.
348346
349347
"""
350348
if tx_prefix:
@@ -432,27 +430,26 @@ def plot_fext_xtalk_losses(self, tx_prefix, rx_prefix, skip_same_index_couples=T
432430

433431
@pyaedt_function_handler()
434432
def get_worst_curve(self, freq_min=None, freq_max=None, worst_is_higher=True, curve_list=None, plot=True):
435-
"""This method analyze a solution data object with multiple curves and
436-
find the worst curve returning its name and an ordered dictionary with each curve mean.
437-
Actual algorithm simply takes the mean of the magnitude over the frequency range.
433+
"""Analyze a solution data object with multiple curves and find the worst curve.
434+
Take the mean of the magnitude over the frequency range.
438435
439436
Parameters
440437
----------
441438
freq_min : float, optional
442-
minimum frequency to analyze in GHz (None to 0). Default value is ``None``.
439+
Minimum frequency to analyze in GHz (None to 0). Default value is ``None``.
443440
freq_max : float, optional
444-
maximum frequency to analyze in GHz (None to max freq). Default value is ``None``.
441+
Maximum frequency to analyze in GHz (None to max freq). Default value is ``None``.
445442
worst_is_higher : bool
446-
boolean. if True, the worst curve is the one with higher mean value. Default value is ``None``.
443+
Worst curve is the one with higher mean value. Default value is ``True``.
447444
curve_list : list
448445
List of [m,n] index of curves on which to search. None to search on all curves. Default value is ``None``.
449446
plot : bool, optional
450447
Whether to plot or not the chart.
451448
452449
Returns
453450
-------
454-
type
455-
worst element str, dictionary of ordered expression and their mean
451+
tuple
452+
Worst element, dictionary of ordered expression.
456453
457454
"""
458455

pyaedt/modules/PostProcessor.py

+8
Original file line numberDiff line numberDiff line change
@@ -2243,6 +2243,14 @@ def create_report_from_configuration(self, input_file=None, report_settings=None
22432243
props = read_configuration_file(input_file)
22442244
else:
22452245
props = report_settings
2246+
if (
2247+
isinstance(props.get("expressions", {}), list)
2248+
and props["expressions"]
2249+
and isinstance(props["expressions"][0], str)
2250+
): # pragma: no cover
2251+
props["expressions"] = {i: {} for i in props["expressions"]}
2252+
elif isinstance(props.get("expressions", {}), str): # pragma: no cover
2253+
props["expressions"] = {props["expressions"]: {}}
22462254
_dict_items_to_list_items(props, "expressions")
22472255
if not solution_name:
22482256
solution_name = self._app.nominal_sweep

pyaedt/modules/report_templates.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -634,15 +634,15 @@ def _update_traces(self):
634634
)
635635
self.eye_mask(
636636
points=eye_points,
637-
xunits=eye_xunits,
638-
yunits=eye_yunits,
637+
x_units=eye_xunits,
638+
y_units=eye_yunits,
639639
enable_limits=eye_enable,
640640
upper_limit=eye_upper,
641641
lower_limit=eye_lower,
642642
color=eye_color,
643643
transparency=eye_transparency,
644-
xoffset=eye_xoffset,
645-
yoffset=eye_yoffset,
644+
x_offset=eye_xoffset,
645+
y_offset=eye_yoffset,
646646
)
647647
if "limitLines" in self.props and self.report_category not in ["Eye Diagram", "Statistical Eye"]:
648648
for line in self.props["limitLines"].values():

pyaedt/workflows/project/create_report.py

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import pyaedt
2828
from pyaedt import get_pyaedt_app
29+
from pyaedt.generic.general_methods import is_windows
2930
from pyaedt.generic.pdf import AnsysReport
3031
from pyaedt.workflows.misc import get_aedt_version
3132
from pyaedt.workflows.misc import get_arguments
@@ -77,6 +78,11 @@ def main(extension_args):
7778
report.add_toc()
7879
out = report.save_pdf(aedtapp.working_directory, "AEDT_Results.pdf")
7980
aedtapp.logger.info(f"Report Generated. {out}")
81+
if is_windows and not extension_args["is_test"]: # pragma: no cover
82+
try: # nosec
83+
os.startfile(out)
84+
except Exception: # pragma: no cover
85+
aedtapp.logger.warning(f"Failed to open {out}")
8086

8187
if not extension_args["is_test"]: # pragma: no cover
8288
app.release_desktop(False, False)

0 commit comments

Comments
 (0)