Skip to content

Commit

Permalink
Shallow copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys committed Nov 21, 2023
1 parent d02940b commit 31e3fc3
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions pyaedt/generic/touchstone_parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from copy import deepcopy
from copy import copy
import itertools
import os
import re
Expand Down Expand Up @@ -86,18 +86,6 @@ def __init__(self, solution_data=None, touchstone_file=None):
rf.Network.__init__(self, touchstone_file)
self.log_x = True

def __deepcopy__(self, memo):
cls = self.__class__
result = cls.__new__(cls)
memo[id(self)] = result

for key, value in self.__dict__.items():
if key == "solution_data":
setattr(result, key, value)
else:
setattr(result, key, deepcopy(value, memo))
return result

@pyaedt_function_handler()
def get_insertion_loss_index(self, threshold=-3):
"""Get all insertion losses. The first frequency point is used to determine whether two
Expand Down Expand Up @@ -226,7 +214,7 @@ def get_mixed_mode_touchstone_data(self, num_of_diff_ports=None, port_ordering="
TouchstoneData
"""
ts_diff = deepcopy(self)
ts_diff = copy(self)
port_count = len(ts_diff.port_names)

if num_of_diff_ports is None:
Expand Down

0 comments on commit 31e3fc3

Please sign in to comment.