Skip to content

Commit

Permalink
Do not use files directly, copy them into scratch folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys committed Mar 8, 2025
1 parent d6b2a1c commit ca4763b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 32 deletions.
10 changes: 0 additions & 10 deletions tests/system/visualization/example_models/T44/_causality.txt

This file was deleted.

17 changes: 0 additions & 17 deletions tests/system/visualization/example_models/T44/_fwslog.txt

This file was deleted.

17 changes: 12 additions & 5 deletions tests/system/visualization/test_44_TouchstoneParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import logging
import os
import shutil

from ansys.aedt.core import Hfss3dLayout
from ansys.aedt.core.visualization.advanced.touchstone_parser import TouchstoneData
Expand Down Expand Up @@ -60,20 +61,26 @@ def test_01_get_touchstone_data(self):
assert ts_data.get_next_xtalk_index()
assert ts_data.get_fext_xtalk_index_from_prefix("diff1", "diff2")

def test_02_read_ts_file(self):
def test_02_read_ts_file(self, local_scratch):

ts1 = TouchstoneData(touchstone_file=os.path.join(test_T44_dir, "port_order_1234.s8p"))
sp = os.path.join(local_scratch.path, "port_order_1234.s8p")
shutil.copy(os.path.join(test_T44_dir, "port_order_1234.s8p"), sp)

ts1 = TouchstoneData(touchstone_file=sp)
assert ts1.get_mixed_mode_touchstone_data()
ts2 = TouchstoneData(touchstone_file=os.path.join(test_T44_dir, "port_order_1324.s8p"))
ts2 = TouchstoneData(touchstone_file=sp)
assert ts2.get_mixed_mode_touchstone_data(port_ordering="1324")

assert ts1.plot_insertion_losses(plot=False)
assert ts1.get_worst_curve(curve_list=ts1.get_return_loss_index(), plot=False)

def test_03_check_touchstone_file(self):
def test_03_check_touchstone_file(self, local_scratch):
from ansys.aedt.core.visualization.advanced.touchstone_parser import check_touchstone_files

check = check_touchstone_files(input_dir=test_T44_dir)
input_dir = os.path.join(local_scratch.path, "touchstone_files")
local_scratch.copyfolder(test_T44_dir, input_dir)

check = check_touchstone_files(input_dir=input_dir)
assert check
for k, v in check.items():
if v and v[0] == "passivity":
Expand Down

0 comments on commit ca4763b

Please sign in to comment.