Skip to content

Commit 811806b

Browse files
FIX: fix a bug in the reduce method (#6204)
Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
1 parent d02f4d2 commit 811806b

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

doc/changelog.d/6204.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fix a bug in the reduce method

src/ansys/aedt/core/visualization/advanced/touchstone_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ def reduce(self, ports, output_file=None, reordered=True):
134134
elif isinstance(p, int) and p < len(self.port_names):
135135
reduced.append(p)
136136
reduced_names.append(self.port_names[p])
137-
138-
reduced_network = network.subnetwork(sorted(reduced))
139137
if reordered and reduced != sorted(reduced):
140-
reduced_network = reduced_network.renumbered(reduced, sorted(reduced))
138+
network = network.renumbered(reduced, sorted(reduced))
139+
reduced_network = network.subnetwork(sorted(reduced))
140+
141141
if not output_file:
142142
output_file = temp_touch[:-4] + f"_reduced.s{len(reduced)}p"
143143
elif f"s{len(reduced)}p" not in output_file:

0 commit comments

Comments
 (0)