From 799a79caba3783973afd67612221e1bf96ada076 Mon Sep 17 00:00:00 2001 From: Jan Petermann <jpeterma@physnet.uni-hamburg.de> Date: Fri, 6 Dec 2019 13:38:05 +0100 Subject: [PATCH] Resolve "refactor tests" --- .gitignore | 2 +- src/openqlab/analysis/__init__.py | 8 ++--- src/openqlab/analysis/gaussian_beam.py | 4 +-- src/openqlab/plots/__init__.py | 10 ++++-- .../test_cavity}/opo_scan.csv | 0 .../test_cavity}/opo_scan_zoom.csv | 0 .../test_analysis/test_cavity/test_finesse.py | 22 +++++++++++++ .../test_cavity/test_modematching.py} | 30 +++++------------- .../test_phase}/test_phase.py | 0 .../test_servo_design}/fra_3.csv | 0 .../test_servo_design}/test_servo_design.py | 10 +++--- .../test_human_readable.py} | 0 .../test_wavelength}/test_wavelength.py | 0 .../test_keysight_csv/.DS_Store | Bin 6148 -> 0 bytes .../test_rhode_schwarz/.DS_Store | Bin 6148 -> 0 bytes .../test_importers/test_tektronix/.DS_Store | Bin 6148 -> 0 bytes src/tests/test_io/gzip_data_files/.DS_Store | Bin 6148 -> 0 bytes .../test_io/{ => test___init__}/test_read.py | 16 ++++++---- .../test_io/{ => test___init__}/test_reads.py | 14 +++++--- .../test_data_container.py | 0 .../test_importers/data_files/ASCII/dig0.TXT | 0 .../test_importers/data_files/ASCII/dig1.TXT | 0 .../test_importers/data_files/ASCII/dig2.TXT | 0 .../test_importers/data_files/ASCII/dig3.TXT | 0 .../test_importers/data_files/ASCII/dig4.TXT | 0 .../test_importers/data_files/ASCII/dig5.TXT | 0 .../data_files/ASCII/flipper1.TXT | 0 .../data_files/ASCII/flipper2.TXT | 0 .../data_files/ASCII/flipper3.TXT | 0 .../data_files/ASCII_Header/header_#.csv | 0 .../ASCII_Header/header_#_comma.csv | 0 .../data_files/ASCII_Header/header_$.csv | 0 .../data_files/ASCII_Header/header_%.csv | 0 .../DataContainerCSV/data_container_csv.csv | 0 .../data_files/Gwinstek/ALL0001_detail.csv | 0 .../data_files/Gwinstek/ALL0001_fast.csv | 0 .../data_files/Gwinstek/mode_detail.csv | 0 .../data_files/Gwinstek/mode_detail_2.CSV | 0 .../data_files/Gwinstek/mode_detail_3.CSV | 0 .../data_files/Gwinstek/mode_detail_4.CSV | 0 .../data_files/Gwinstek/mode_fast.csv | 0 .../data_files/Gwinstek/mode_fast_2.CSV | 0 .../data_files/Gwinstek/mode_fast_3.CSV | 0 .../data_files/Gwinstek/mode_fast_4.CSV | 0 .../data_files/Gwinstek_LSF/bottom.LSF | Bin .../data_files/Gwinstek_LSF/mode_binary_2.LSF | Bin .../data_files/Gwinstek_LSF/mode_binary_4.LSF | Bin .../data_files/Gwinstek_LSF/top.LSF | Bin .../data_files/HP4395A/ADDHAG.txt | 0 .../data_files/HP4395A/transfer_function.txt | 0 .../KeysightBinary/keysight_binary.bin | Bin .../data_files/KeysightCSV/20180606_001.csv | 0 .../data_files/KeysightCSV/20180606_002.csv | 0 .../data_files/KeysightCSV/20180606_003.csv | 0 .../data_files/KeysightCSV/20180606_004_1.csv | 0 .../data_files/KeysightCSV/20180606_004_2.csv | 0 .../data_files/KeysightCSV/20180606_004_3.csv | 0 .../data_files/KeysightCSV/20180606_004_4.csv | 0 .../data_files/KeysightCSV/20180606_005_1.csv | 0 .../data_files/KeysightCSV/20180606_005_2.csv | 0 .../data_files/KeysightCSV/20180606_005_3.csv | 0 .../data_files/KeysightCSV/20180606_005_4.csv | 0 .../data_files/KeysightFRA/scope_0_comma.csv | 0 .../KeysightFRA/scope_1_semicolon.csv | 0 .../data_files/RhodeSchwarz/2010830P_001 | 0 .../data_files/RhodeSchwarz/2010830P_002 | 0 .../data_files/RhodeSchwarz/2010830P_003 | 0 .../data_files/RhodeSchwarz/2010830RD_001 | 0 .../data_files/RhodeSchwarz/2010830RD_002 | 0 .../data_files/RhodeSchwarz/2010830RD_003 | 0 .../data_files/RhodeSchwarz/2010830RD_004 | 0 .../data_files/RhodeSchwarz/20180605_001 | 0 .../data_files/RhodeSchwarz/20180605_002 | 0 .../data_files/RhodeSchwarz/20180822_004 | 0 .../RhodeSchwarz/FSV-4_multitrace_comma.DAT | 0 .../RhodeSchwarz/FSV-4_multitrace_dot.DAT | 0 .../RhodeSchwarz/FSV-4_singletrace_comma.DAT | 0 .../RhodeSchwarz/FSV-4_singletrace_dot.DAT | 0 .../RhodeSchwarz/FSVR-7_singletrace_comma.DAT | 0 .../RhodeSchwarz/FSVR-7_singletrace_dot.DAT | 0 .../data_files/RhodeSchwarz/fsvr-7.DAT | 0 .../data_files/RhodeSchwarz/multitrace.DAT | 0 .../data_files/Tektronix/0001.csv | 0 .../data_files/Tektronix/0004.csv | 0 .../test_importers/data_files/Tektronix/1.csv | 0 .../data_files/Tektronix/1112.csv | 0 .../data_files/Tektronix/20007.csv | 0 .../data_files/Tektronix/25.csv | 0 .../data_files/Tektronix/30003_multitrace.csv | 0 .../Tektronix/TektronixRSA5103B_Spectrum.csv | 0 .../cable_resonance_115_singletrace.csv | 0 .../data_files/Tektronix/tr1 (0.75 mW).csv | 0 .../data_files/TektronixDPX/0001.csv | 0 .../data_files/TektronixSpectrogram/test2.mat | Bin .../test_importers/test_ascii/test_ascii.py | 0 .../test_ascii_header/test_ascii_header.py | 4 +-- .../test_base_importer/test_base_importer.py | 0 .../data_container_csv.csv | 0 .../test_data_container_csv.py | 4 +-- .../test_gwinstek/missing_data.csv | 0 .../test_gwinstek/missing_data_1.csv | 0 .../test_gwinstek/missing_savemode.csv | 0 .../test_gwinstek/test_gwinstek.py | 12 +++---- .../test_gwinstek/wrong_savemode.csv | 0 .../test_gwinstek_LSF/test_gwinstek_LSF.py | 4 +-- .../test_hp4395a/missing_data.txt | 0 .../test_hp4395a/test_hp4395a.py | 6 ++-- .../test_keysight_binary.py | 4 +-- .../test_keysight_csv/missing_data.csv | 0 .../test_keysight_csv/test_keysight_csv.py | 6 ++-- .../test_keysight_fra/missing_data.csv | 0 .../test_keysight_fra/test_keysight_fra.py | 6 ++-- .../test_rhode_schwarz/missing_data.csv | 0 .../test_rhode_schwarz/missing_xUnit | 0 .../test_rhode_schwarz/test_rhode_schwarz.py | 8 ++--- .../different_frequency_axis.csv | 0 .../test_tektronix/missing_data.csv | 0 .../test_tektronix/test_tektronix.py | 10 +++--- .../test_tektronix/wrong_number_points.csv | 0 .../test_tektronix_dpx/test_tektronix_dpx.py | 4 +-- .../test_tektronix_spectrogram.py | 6 ++-- src/tests/{ => test_plots}/test_plots.py | 0 122 files changed, 106 insertions(+), 84 deletions(-) rename src/tests/{modematching => test_analysis/test_cavity}/opo_scan.csv (100%) rename src/tests/{modematching => test_analysis/test_cavity}/opo_scan_zoom.csv (100%) create mode 100644 src/tests/test_analysis/test_cavity/test_finesse.py rename src/tests/{test_cavity.py => test_analysis/test_cavity/test_modematching.py} (70%) rename src/tests/{ => test_analysis/test_phase}/test_phase.py (100%) rename src/tests/{servo_design => test_analysis/test_servo_design}/fra_3.csv (100%) rename src/tests/{ => test_analysis/test_servo_design}/test_servo_design.py (97%) rename src/tests/test_conversion/{test_utils_human_readable.py => test_utils/test_human_readable.py} (100%) rename src/tests/{ => test_conversion/test_wavelength}/test_wavelength.py (100%) delete mode 100644 src/tests/test_importers/test_keysight_csv/.DS_Store delete mode 100644 src/tests/test_importers/test_rhode_schwarz/.DS_Store delete mode 100644 src/tests/test_importers/test_tektronix/.DS_Store delete mode 100644 src/tests/test_io/gzip_data_files/.DS_Store rename src/tests/test_io/{ => test___init__}/test_read.py (86%) rename src/tests/test_io/{ => test___init__}/test_reads.py (90%) rename src/tests/{ => test_io}/test_data_container/test_data_container.py (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII/dig0.TXT (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII/dig1.TXT (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII/dig2.TXT (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII/dig3.TXT (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII/dig4.TXT (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII/dig5.TXT (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII/flipper1.TXT (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII/flipper2.TXT (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII/flipper3.TXT (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII_Header/header_#.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII_Header/header_#_comma.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII_Header/header_$.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/ASCII_Header/header_%.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/DataContainerCSV/data_container_csv.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek/ALL0001_detail.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek/ALL0001_fast.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek/mode_detail.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek/mode_detail_2.CSV (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek/mode_detail_3.CSV (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek/mode_detail_4.CSV (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek/mode_fast.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek/mode_fast_2.CSV (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek/mode_fast_3.CSV (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek/mode_fast_4.CSV (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek_LSF/bottom.LSF (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek_LSF/mode_binary_2.LSF (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek_LSF/mode_binary_4.LSF (100%) rename src/tests/{ => test_io}/test_importers/data_files/Gwinstek_LSF/top.LSF (100%) rename src/tests/{ => test_io}/test_importers/data_files/HP4395A/ADDHAG.txt (100%) rename src/tests/{ => test_io}/test_importers/data_files/HP4395A/transfer_function.txt (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightBinary/keysight_binary.bin (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightCSV/20180606_001.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightCSV/20180606_002.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightCSV/20180606_003.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightCSV/20180606_004_1.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightCSV/20180606_004_2.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightCSV/20180606_004_3.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightCSV/20180606_004_4.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightCSV/20180606_005_1.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightCSV/20180606_005_2.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightCSV/20180606_005_3.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightCSV/20180606_005_4.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightFRA/scope_0_comma.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/KeysightFRA/scope_1_semicolon.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/2010830P_001 (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/2010830P_002 (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/2010830P_003 (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/2010830RD_001 (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/2010830RD_002 (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/2010830RD_003 (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/2010830RD_004 (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/20180605_001 (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/20180605_002 (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/20180822_004 (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/FSV-4_multitrace_comma.DAT (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/FSV-4_multitrace_dot.DAT (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/FSV-4_singletrace_comma.DAT (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/FSV-4_singletrace_dot.DAT (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/FSVR-7_singletrace_comma.DAT (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/FSVR-7_singletrace_dot.DAT (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/fsvr-7.DAT (100%) rename src/tests/{ => test_io}/test_importers/data_files/RhodeSchwarz/multitrace.DAT (100%) rename src/tests/{ => test_io}/test_importers/data_files/Tektronix/0001.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Tektronix/0004.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Tektronix/1.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Tektronix/1112.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Tektronix/20007.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Tektronix/25.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Tektronix/30003_multitrace.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Tektronix/TektronixRSA5103B_Spectrum.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Tektronix/cable_resonance_115_singletrace.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/Tektronix/tr1 (0.75 mW).csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/TektronixDPX/0001.csv (100%) rename src/tests/{ => test_io}/test_importers/data_files/TektronixSpectrogram/test2.mat (100%) rename src/tests/{ => test_io}/test_importers/test_ascii/test_ascii.py (100%) rename src/tests/{ => test_io}/test_importers/test_ascii_header/test_ascii_header.py (97%) rename src/tests/{ => test_io}/test_importers/test_base_importer/test_base_importer.py (100%) rename src/tests/{ => test_io}/test_importers/test_data_container_csv/data_container_csv.csv (100%) rename src/tests/{ => test_io}/test_importers/test_data_container_csv/test_data_container_csv.py (93%) rename src/tests/{ => test_io}/test_importers/test_gwinstek/missing_data.csv (100%) rename src/tests/{ => test_io}/test_importers/test_gwinstek/missing_data_1.csv (100%) rename src/tests/{ => test_io}/test_importers/test_gwinstek/missing_savemode.csv (100%) rename src/tests/{ => test_io}/test_importers/test_gwinstek/test_gwinstek.py (94%) rename src/tests/{ => test_io}/test_importers/test_gwinstek/wrong_savemode.csv (100%) rename src/tests/{ => test_io}/test_importers/test_gwinstek_LSF/test_gwinstek_LSF.py (95%) rename src/tests/{ => test_io}/test_importers/test_hp4395a/missing_data.txt (100%) rename src/tests/{ => test_io}/test_importers/test_hp4395a/test_hp4395a.py (94%) rename src/tests/{ => test_io}/test_importers/test_keysight_binary/test_keysight_binary.py (94%) rename src/tests/{ => test_io}/test_importers/test_keysight_csv/missing_data.csv (100%) rename src/tests/{ => test_io}/test_importers/test_keysight_csv/test_keysight_csv.py (95%) rename src/tests/{ => test_io}/test_importers/test_keysight_fra/missing_data.csv (100%) rename src/tests/{ => test_io}/test_importers/test_keysight_fra/test_keysight_fra.py (92%) rename src/tests/{ => test_io}/test_importers/test_rhode_schwarz/missing_data.csv (100%) rename src/tests/{ => test_io}/test_importers/test_rhode_schwarz/missing_xUnit (100%) rename src/tests/{ => test_io}/test_importers/test_rhode_schwarz/test_rhode_schwarz.py (93%) rename src/tests/{ => test_io}/test_importers/test_tektronix/different_frequency_axis.csv (100%) rename src/tests/{ => test_io}/test_importers/test_tektronix/missing_data.csv (100%) rename src/tests/{ => test_io}/test_importers/test_tektronix/test_tektronix.py (93%) rename src/tests/{ => test_io}/test_importers/test_tektronix/wrong_number_points.csv (100%) rename src/tests/{ => test_io}/test_importers/test_tektronix_dpx/test_tektronix_dpx.py (97%) rename src/tests/{ => test_io}/test_importers/test_tektronix_spectrogram/test_tektronix_spectrogram.py (95%) rename src/tests/{ => test_plots}/test_plots.py (100%) diff --git a/.gitignore b/.gitignore index c079c2f..341dcec 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ htmlcov .venv .mypy_cache -src/tests/test_io/gzip_data_files/ +#src/tests/test_io/test___init__/gzip_data_files/ *.gz diff --git a/src/openqlab/analysis/__init__.py b/src/openqlab/analysis/__init__.py index 80354e0..c0cbf9a 100644 --- a/src/openqlab/analysis/__init__.py +++ b/src/openqlab/analysis/__init__.py @@ -1,4 +1,4 @@ -from .servo_design import ServoDesign -from .gaussian_beam import fit_beam_data, GaussianBeam -from ..conversion import db -from . import phase, cavity +from openqlab.analysis import cavity, phase +from openqlab.analysis.gaussian_beam import GaussianBeam, fit_beam_data +from openqlab.analysis.servo_design import ServoDesign +from openqlab.conversion import db diff --git a/src/openqlab/analysis/gaussian_beam.py b/src/openqlab/analysis/gaussian_beam.py index 16c1a95..61ac336 100644 --- a/src/openqlab/analysis/gaussian_beam.py +++ b/src/openqlab/analysis/gaussian_beam.py @@ -4,8 +4,8 @@ import numpy as np import pandas as pd from scipy.optimize import curve_fit -from ..conversion.utils import human_readable -from ..plots import beam_profile +from openqlab.conversion.utils import human_readable +from openqlab.plots.gaussian_beam import beam_profile class GaussianBeam: diff --git a/src/openqlab/plots/__init__.py b/src/openqlab/plots/__init__.py index 6f90523..bea255b 100644 --- a/src/openqlab/plots/__init__.py +++ b/src/openqlab/plots/__init__.py @@ -1,3 +1,7 @@ -from .time_domain import zero_span, scope -from .frequency_domain import amplitude_phase, power_spectrum, relative_input_noise -from .gaussian_beam import beam_profile +from openqlab.plots.frequency_domain import ( + amplitude_phase, + power_spectrum, + relative_input_noise, +) +from openqlab.plots.gaussian_beam import beam_profile +from openqlab.plots.time_domain import scope, zero_span diff --git a/src/tests/modematching/opo_scan.csv b/src/tests/test_analysis/test_cavity/opo_scan.csv similarity index 100% rename from src/tests/modematching/opo_scan.csv rename to src/tests/test_analysis/test_cavity/opo_scan.csv diff --git a/src/tests/modematching/opo_scan_zoom.csv b/src/tests/test_analysis/test_cavity/opo_scan_zoom.csv similarity index 100% rename from src/tests/modematching/opo_scan_zoom.csv rename to src/tests/test_analysis/test_cavity/opo_scan_zoom.csv diff --git a/src/tests/test_analysis/test_cavity/test_finesse.py b/src/tests/test_analysis/test_cavity/test_finesse.py new file mode 100644 index 0000000..390ec34 --- /dev/null +++ b/src/tests/test_analysis/test_cavity/test_finesse.py @@ -0,0 +1,22 @@ +import unittest + +import matplotlib.pyplot as plt + +from openqlab import io +from openqlab.analysis.cavity import finesse + + +class TestFinesse(unittest.TestCase): + def setUp(self): + self.data = io.read( + "test_analysis/test_cavity/opo_scan.csv", importer="KeysightCSV" + ) + plt.figure() + + def test_finesse_calculation(self): + result = finesse(self.data["opo_scan_2"]) + self.assertAlmostEqual(result[0], 54.27, places=1) + self.assertAlmostEqual(result[1], 67.45, places=1) + + def test_finesse_plot(self): + finesse(self.data["opo_scan_2"], plot=True) diff --git a/src/tests/test_cavity.py b/src/tests/test_analysis/test_cavity/test_modematching.py similarity index 70% rename from src/tests/test_cavity.py rename to src/tests/test_analysis/test_cavity/test_modematching.py index 82ae337..1e3bebb 100644 --- a/src/tests/test_cavity.py +++ b/src/tests/test_analysis/test_cavity/test_modematching.py @@ -2,13 +2,15 @@ import unittest import matplotlib.pyplot as plt -from openqlab import analysis, io -from openqlab.analysis.cavity import finesse, modematching +from openqlab import io +from openqlab.analysis.cavity import modematching class TestModematching(unittest.TestCase): def setUp(self): - self.data = io.read("modematching/opo_scan.csv", importer="KeysightCSV") + self.data = io.read( + "test_analysis/test_cavity/opo_scan.csv", importer="KeysightCSV" + ) plt.figure() def test_default_inverted(self): @@ -53,7 +55,9 @@ class TestModematching(unittest.TestCase): modematching(self.data["opo_scan_2"], without_main_peaks=True) def test_cropped_main_peak(self): - data = io.read("modematching/opo_scan_zoom.csv", importer="KeysightCSV") + data = io.read( + "test_analysis/test_cavity/opo_scan_zoom.csv", importer="KeysightCSV" + ) mm = modematching( data["opo_scan_zoom_2"].loc[0.0015:0.0155], offset=-0.015, @@ -63,21 +67,3 @@ class TestModematching(unittest.TestCase): without_main_peaks=True, ) self.assertAlmostEqual(mm, 0.92, places=2) - - -class TestFinesse(unittest.TestCase): - def setUp(self): - self.data = io.read("modematching/opo_scan.csv", importer="KeysightCSV") - plt.figure() - - def test_finesse_calculation(self): - result = finesse(self.data["opo_scan_2"]) - self.assertAlmostEqual(result[0], 54.27, places=1) - self.assertAlmostEqual(result[1], 67.45, places=1) - - def test_finesse_plot(self): - finesse(self.data["opo_scan_2"], plot=True) - - def test_finesse_raises_wrong_data(self): - with self.assertRaises(ValueError): - finesse(self.data) diff --git a/src/tests/test_phase.py b/src/tests/test_analysis/test_phase/test_phase.py similarity index 100% rename from src/tests/test_phase.py rename to src/tests/test_analysis/test_phase/test_phase.py diff --git a/src/tests/servo_design/fra_3.csv b/src/tests/test_analysis/test_servo_design/fra_3.csv similarity index 100% rename from src/tests/servo_design/fra_3.csv rename to src/tests/test_analysis/test_servo_design/fra_3.csv diff --git a/src/tests/test_servo_design.py b/src/tests/test_analysis/test_servo_design/test_servo_design.py similarity index 97% rename from src/tests/test_servo_design.py rename to src/tests/test_analysis/test_servo_design/test_servo_design.py index 53e0e95..54ed233 100644 --- a/src/tests/test_servo_design.py +++ b/src/tests/test_analysis/test_servo_design/test_servo_design.py @@ -214,7 +214,7 @@ class TestServoDesign(unittest.TestCase): self.sd.plant = 8 columns = ["Gain (dB)", "Phase (deg)"] - fra = io.read("servo_design/fra_3.csv") + fra = io.read("test_analysis/test_servo_design/fra_3.csv") self.sd.plant = fra self.assertListEqual(self.sd.plant.columns.tolist(), columns) @@ -253,7 +253,7 @@ class TestServoDesign(unittest.TestCase): def test_plot_with_plant(self): if self.display_available: self.sd.differentiator(390) - self.sd.plant = io.read("servo_design/fra_3.csv") + self.sd.plant = io.read("test_analysis/test_servo_design/fra_3.csv") plt = self.sd.plot() self.assertIsInstance(plt, mp.figure.Figure) ax = plt.axes[0] @@ -267,7 +267,7 @@ class TestServoDesign(unittest.TestCase): columns = ["Servo A", "Servo P"] self.assertListEqual(df.columns.tolist(), columns) - self.sd.plant = io.read("servo_design/fra_3.csv") + self.sd.plant = io.read("test_analysis/test_servo_design/fra_3.csv") df = self.sd.plot(plot=False) self.assertIsInstance(df, DataFrame) columns = ["Servo A", "Servo P", "Servo+TF A", "Servo+TF P"] @@ -321,7 +321,7 @@ class TestServoDesign(unittest.TestCase): ) def test_correct_latency(self): - self.sd.plant = io.read("servo_design/fra_3.csv") + self.sd.plant = io.read("test_analysis/test_servo_design/fra_3.csv") df = self.sd.plot(plot=False, correct_latency=False) df_corrected = self.sd.plot(plot=False, correct_latency=True) columns = ["Servo A", "Servo P", "Servo+TF A", "Servo+TF P"] @@ -388,7 +388,7 @@ class TestServoDesign(unittest.TestCase): self.assertEqual(self.sd.__str__(), sd.__str__()) # Encode and decode with plant - fra = io.read("servo_design/fra_3.csv") + fra = io.read("test_analysis/test_servo_design/fra_3.csv") self.sd.plant = fra sdjson = jsonpickle.encode(self.sd) sd = jsonpickle.decode(sdjson) diff --git a/src/tests/test_conversion/test_utils_human_readable.py b/src/tests/test_conversion/test_utils/test_human_readable.py similarity index 100% rename from src/tests/test_conversion/test_utils_human_readable.py rename to src/tests/test_conversion/test_utils/test_human_readable.py diff --git a/src/tests/test_wavelength.py b/src/tests/test_conversion/test_wavelength/test_wavelength.py similarity index 100% rename from src/tests/test_wavelength.py rename to src/tests/test_conversion/test_wavelength/test_wavelength.py diff --git a/src/tests/test_importers/test_keysight_csv/.DS_Store b/src/tests/test_importers/test_keysight_csv/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmZQzU|@7AO)+F(5MW?n;9!8z45|!R0Z1N%F(jFgL>QrFAPJ2!M?+vV1V%$(Gz3ON zU^D~<VF)ln+{D2Rp-0Kl5Eu=C(GY-#0H}OW0QD6Z7#JL&bOVG2Nii@oFo3%Nj0_Ac zFio(203!nfNGnJUNGpg2X=PvpvA|}4wK6b5wK9UcAq)(R;4TS>25V<v1ltVagS9g- zf^BACV1#IAV1(Mt2<@RTf_gL{^C8+97{Ru~TsKOOhQMeDz(Rl-!Vmz}|E>%SxcdJP zRior+2#kinunYl47MEZbCs3t{!+W4QHvuXKVuPw;Mo^s$(F3lEVT}ML$bg~*R5_@+ b2Uo?6kTwK}57Iu`5P${HC_Nei0}uiLNUI8I diff --git a/src/tests/test_importers/test_rhode_schwarz/.DS_Store b/src/tests/test_importers/test_rhode_schwarz/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmZQzU|@7AO)+F(5MW?n;9!8z45|!R0Z1N%F(jFgL>QrFAPJ2!M?+vV1V%$(Gz3ON zU^D~<VF)ln+{D2Rp-0Kl5Eu=C(GY-#0H}OW0QD6Z7#JL&bOVG2Nii@oFo3%Nj0_Ac zFio(203!nfNGnJUNGpg2X=PvpvA|}4wK6b5wK9UcAq)(R;4TS>25V<v1ltVagS9g- zf^BACV1#IAV1(Mt2<@RTf_gL{^C8+97{Ru~TsKOOhQMeDz(Rl-!Vmz}|E>%SxcdJP zRior+2#kinunYl47MEZbCs3t{!+W4QHvuXKVuPw;Mo^s$(F3lEVT}ML$bg~*R5_@+ b2Uo?6kTwK}57Iu`5P${HC_Nei0}uiLNUI8I diff --git a/src/tests/test_importers/test_tektronix/.DS_Store b/src/tests/test_importers/test_tektronix/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmZQzU|@7AO)+F(5MW?n;9!8z45|!R0Z1N%F(jFgL>QrFAPJ2!M?+vV1V%$(Gz3ON zU^D~<VF)ln+{D2Rp-0Kl5Eu=C(GY-#0H}OW0QD6Z7#JL&bOVG2Nii@oFo3%Nj0_Ac zFio(203!nfNGnJUNGpg2X=PvpvA|}4wK6b5wK9UcAq)(R;4TS>25V<v1ltVagS9g- zf^BACV1#IAV1(Mt2<@RTf_gL{^C8+97{Ru~TsKOOhQMeDz(Rl-!Vmz}|E>%SxcdJP zRior+2#kinunYl47MEZbCs3t{!+W4QHvuXKVuPw;Mo^s$(F3lEVT}ML$bg~*R5_@+ b2Uo?6kTwK}57Iu`5P${HC_Nei0}uiLNUI8I diff --git a/src/tests/test_io/gzip_data_files/.DS_Store b/src/tests/test_io/gzip_data_files/.DS_Store deleted file mode 100644 index 167f6ade087b62508a911a54613d8f7569b38af7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmZQzU|@7AO)+F(5MW?n;9!8z3~dZp0Z1N%F(jFwB8(vOz-D-s1sCPz<maVBWe8Is zy{rt548aV}44w?g`av>;^^d9;4S~@R7!85Z5Eu=C(GVal1fVr62RCWjMpci7z-S1J zfDizc4+@aBJ%a<3Zh+7rDF#Lc25=XEk%55)795P=egFeV4x|-CgS3KZkX8mp5DRPu zSSte~R4XI68v@b?>XLwHuyzJUu+1PoSUUqF*k%R>Mu>I>MySn<&>jjSL^}f`L^}f` z*mjufM(NQI7!3hf2rxq!0-*Zem4N|Q{~w}ilpGC#(GVDxA;8Gu671pxu9UI+4^-EJ z>eB?MngdW}jG%fMA_h_ds@lQTF%x7^Q39$ABo5LJqQTWMBLf4tHXm&az(Q!09t{Ed Gh5!K53={YO diff --git a/src/tests/test_io/test_read.py b/src/tests/test_io/test___init__/test_read.py similarity index 86% rename from src/tests/test_io/test_read.py rename to src/tests/test_io/test___init__/test_read.py index 9a1606f..1d9f688 100644 --- a/src/tests/test_io/test_read.py +++ b/src/tests/test_io/test___init__/test_read.py @@ -11,8 +11,8 @@ class TestRead(unittest.TestCase): Test files starting with a dot (".") will be ignored. """ - files_path = Path(r"./test_importers/data_files") - gzip_files_path = Path(r"./test_io/gzip_data_files") + files_path = Path(r"test_io/test_importers/data_files") + gzip_files_path = Path(r"test_io/test___init__/gzip_data_files") @classmethod def setUpClass(cls): @@ -25,13 +25,17 @@ class TestRead(unittest.TestCase): cls.files = [file for file in cls.files if not file.stem.startswith(".")] cls.binary_files = [ - Path(r"./test_importers/data_files/KeysightBinary/keysight_binary.bin"), - Path(r"./test_importers/data_files/TektronixSpectrogram/test2.mat"), + Path( + r"test_io/test_importers/data_files/KeysightBinary/keysight_binary.bin" + ), + Path(r"test_io/test_importers/data_files/TektronixSpectrogram/test2.mat"), ] cls.ignore_text_files = [ - Path(r"./test_importers/data_files/KeysightFRA/scope_0_comma.csv"), - Path(r"./test_importers/data_files/KeysightFRA/scope_1_semicolon.csv"), + Path(r"test_io/test_importers/data_files/KeysightFRA/scope_0_comma.csv"), + Path( + r"test_io/test_importers/data_files/KeysightFRA/scope_1_semicolon.csv" + ), ] cls.text_files = [ file diff --git a/src/tests/test_io/test_reads.py b/src/tests/test_io/test___init__/test_reads.py similarity index 90% rename from src/tests/test_io/test_reads.py rename to src/tests/test_io/test___init__/test_reads.py index f211996..9c17ff2 100644 --- a/src/tests/test_io/test_reads.py +++ b/src/tests/test_io/test___init__/test_reads.py @@ -10,7 +10,7 @@ class TestReads(unittest.TestCase): Test files starting with a dot (".") will be ignored. """ - files_path = Path(r"./test_importers/data_files") + files_path = Path(r"test_io/test_importers/data_files") @classmethod def setUpClass(cls): @@ -21,13 +21,17 @@ class TestReads(unittest.TestCase): cls.files = [file for file in cls.files if not file.stem.startswith(".")] cls.binary_files = [ - Path(r"./test_importers/data_files/KeysightBinary/keysight_binary.bin"), - Path(r"./test_importers/data_files/TektronixSpectrogram/test2.mat"), + Path( + r"test_io/test_importers/data_files/KeysightBinary/keysight_binary.bin" + ), + Path(r"test_io/test_importers/data_files/TektronixSpectrogram/test2.mat"), ] + list((cls.files_path / "Gwinstek_LSF").glob("*")) cls.ignore_text_files = [ - Path(r"./test_importers/data_files/KeysightFRA/scope_0_comma.csv"), - Path(r"./test_importers/data_files/KeysightFRA/scope_1_semicolon.csv"), + Path(r"test_io/test_importers/data_files/KeysightFRA/scope_0_comma.csv"), + Path( + r"test_io/test_importers/data_files/KeysightFRA/scope_1_semicolon.csv" + ), ] cls.text_files = [ file diff --git a/src/tests/test_data_container/test_data_container.py b/src/tests/test_io/test_data_container/test_data_container.py similarity index 100% rename from src/tests/test_data_container/test_data_container.py rename to src/tests/test_io/test_data_container/test_data_container.py diff --git a/src/tests/test_importers/data_files/ASCII/dig0.TXT b/src/tests/test_io/test_importers/data_files/ASCII/dig0.TXT similarity index 100% rename from src/tests/test_importers/data_files/ASCII/dig0.TXT rename to src/tests/test_io/test_importers/data_files/ASCII/dig0.TXT diff --git a/src/tests/test_importers/data_files/ASCII/dig1.TXT b/src/tests/test_io/test_importers/data_files/ASCII/dig1.TXT similarity index 100% rename from src/tests/test_importers/data_files/ASCII/dig1.TXT rename to src/tests/test_io/test_importers/data_files/ASCII/dig1.TXT diff --git a/src/tests/test_importers/data_files/ASCII/dig2.TXT b/src/tests/test_io/test_importers/data_files/ASCII/dig2.TXT similarity index 100% rename from src/tests/test_importers/data_files/ASCII/dig2.TXT rename to src/tests/test_io/test_importers/data_files/ASCII/dig2.TXT diff --git a/src/tests/test_importers/data_files/ASCII/dig3.TXT b/src/tests/test_io/test_importers/data_files/ASCII/dig3.TXT similarity index 100% rename from src/tests/test_importers/data_files/ASCII/dig3.TXT rename to src/tests/test_io/test_importers/data_files/ASCII/dig3.TXT diff --git a/src/tests/test_importers/data_files/ASCII/dig4.TXT b/src/tests/test_io/test_importers/data_files/ASCII/dig4.TXT similarity index 100% rename from src/tests/test_importers/data_files/ASCII/dig4.TXT rename to src/tests/test_io/test_importers/data_files/ASCII/dig4.TXT diff --git a/src/tests/test_importers/data_files/ASCII/dig5.TXT b/src/tests/test_io/test_importers/data_files/ASCII/dig5.TXT similarity index 100% rename from src/tests/test_importers/data_files/ASCII/dig5.TXT rename to src/tests/test_io/test_importers/data_files/ASCII/dig5.TXT diff --git a/src/tests/test_importers/data_files/ASCII/flipper1.TXT b/src/tests/test_io/test_importers/data_files/ASCII/flipper1.TXT similarity index 100% rename from src/tests/test_importers/data_files/ASCII/flipper1.TXT rename to src/tests/test_io/test_importers/data_files/ASCII/flipper1.TXT diff --git a/src/tests/test_importers/data_files/ASCII/flipper2.TXT b/src/tests/test_io/test_importers/data_files/ASCII/flipper2.TXT similarity index 100% rename from src/tests/test_importers/data_files/ASCII/flipper2.TXT rename to src/tests/test_io/test_importers/data_files/ASCII/flipper2.TXT diff --git a/src/tests/test_importers/data_files/ASCII/flipper3.TXT b/src/tests/test_io/test_importers/data_files/ASCII/flipper3.TXT similarity index 100% rename from src/tests/test_importers/data_files/ASCII/flipper3.TXT rename to src/tests/test_io/test_importers/data_files/ASCII/flipper3.TXT diff --git a/src/tests/test_importers/data_files/ASCII_Header/header_#.csv b/src/tests/test_io/test_importers/data_files/ASCII_Header/header_#.csv similarity index 100% rename from src/tests/test_importers/data_files/ASCII_Header/header_#.csv rename to src/tests/test_io/test_importers/data_files/ASCII_Header/header_#.csv diff --git a/src/tests/test_importers/data_files/ASCII_Header/header_#_comma.csv b/src/tests/test_io/test_importers/data_files/ASCII_Header/header_#_comma.csv similarity index 100% rename from src/tests/test_importers/data_files/ASCII_Header/header_#_comma.csv rename to src/tests/test_io/test_importers/data_files/ASCII_Header/header_#_comma.csv diff --git a/src/tests/test_importers/data_files/ASCII_Header/header_$.csv b/src/tests/test_io/test_importers/data_files/ASCII_Header/header_$.csv similarity index 100% rename from src/tests/test_importers/data_files/ASCII_Header/header_$.csv rename to src/tests/test_io/test_importers/data_files/ASCII_Header/header_$.csv diff --git a/src/tests/test_importers/data_files/ASCII_Header/header_%.csv b/src/tests/test_io/test_importers/data_files/ASCII_Header/header_%.csv similarity index 100% rename from src/tests/test_importers/data_files/ASCII_Header/header_%.csv rename to src/tests/test_io/test_importers/data_files/ASCII_Header/header_%.csv diff --git a/src/tests/test_importers/data_files/DataContainerCSV/data_container_csv.csv b/src/tests/test_io/test_importers/data_files/DataContainerCSV/data_container_csv.csv similarity index 100% rename from src/tests/test_importers/data_files/DataContainerCSV/data_container_csv.csv rename to src/tests/test_io/test_importers/data_files/DataContainerCSV/data_container_csv.csv diff --git a/src/tests/test_importers/data_files/Gwinstek/ALL0001_detail.csv b/src/tests/test_io/test_importers/data_files/Gwinstek/ALL0001_detail.csv similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek/ALL0001_detail.csv rename to src/tests/test_io/test_importers/data_files/Gwinstek/ALL0001_detail.csv diff --git a/src/tests/test_importers/data_files/Gwinstek/ALL0001_fast.csv b/src/tests/test_io/test_importers/data_files/Gwinstek/ALL0001_fast.csv similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek/ALL0001_fast.csv rename to src/tests/test_io/test_importers/data_files/Gwinstek/ALL0001_fast.csv diff --git a/src/tests/test_importers/data_files/Gwinstek/mode_detail.csv b/src/tests/test_io/test_importers/data_files/Gwinstek/mode_detail.csv similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek/mode_detail.csv rename to src/tests/test_io/test_importers/data_files/Gwinstek/mode_detail.csv diff --git a/src/tests/test_importers/data_files/Gwinstek/mode_detail_2.CSV b/src/tests/test_io/test_importers/data_files/Gwinstek/mode_detail_2.CSV similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek/mode_detail_2.CSV rename to src/tests/test_io/test_importers/data_files/Gwinstek/mode_detail_2.CSV diff --git a/src/tests/test_importers/data_files/Gwinstek/mode_detail_3.CSV b/src/tests/test_io/test_importers/data_files/Gwinstek/mode_detail_3.CSV similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek/mode_detail_3.CSV rename to src/tests/test_io/test_importers/data_files/Gwinstek/mode_detail_3.CSV diff --git a/src/tests/test_importers/data_files/Gwinstek/mode_detail_4.CSV b/src/tests/test_io/test_importers/data_files/Gwinstek/mode_detail_4.CSV similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek/mode_detail_4.CSV rename to src/tests/test_io/test_importers/data_files/Gwinstek/mode_detail_4.CSV diff --git a/src/tests/test_importers/data_files/Gwinstek/mode_fast.csv b/src/tests/test_io/test_importers/data_files/Gwinstek/mode_fast.csv similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek/mode_fast.csv rename to src/tests/test_io/test_importers/data_files/Gwinstek/mode_fast.csv diff --git a/src/tests/test_importers/data_files/Gwinstek/mode_fast_2.CSV b/src/tests/test_io/test_importers/data_files/Gwinstek/mode_fast_2.CSV similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek/mode_fast_2.CSV rename to src/tests/test_io/test_importers/data_files/Gwinstek/mode_fast_2.CSV diff --git a/src/tests/test_importers/data_files/Gwinstek/mode_fast_3.CSV b/src/tests/test_io/test_importers/data_files/Gwinstek/mode_fast_3.CSV similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek/mode_fast_3.CSV rename to src/tests/test_io/test_importers/data_files/Gwinstek/mode_fast_3.CSV diff --git a/src/tests/test_importers/data_files/Gwinstek/mode_fast_4.CSV b/src/tests/test_io/test_importers/data_files/Gwinstek/mode_fast_4.CSV similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek/mode_fast_4.CSV rename to src/tests/test_io/test_importers/data_files/Gwinstek/mode_fast_4.CSV diff --git a/src/tests/test_importers/data_files/Gwinstek_LSF/bottom.LSF b/src/tests/test_io/test_importers/data_files/Gwinstek_LSF/bottom.LSF similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek_LSF/bottom.LSF rename to src/tests/test_io/test_importers/data_files/Gwinstek_LSF/bottom.LSF diff --git a/src/tests/test_importers/data_files/Gwinstek_LSF/mode_binary_2.LSF b/src/tests/test_io/test_importers/data_files/Gwinstek_LSF/mode_binary_2.LSF similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek_LSF/mode_binary_2.LSF rename to src/tests/test_io/test_importers/data_files/Gwinstek_LSF/mode_binary_2.LSF diff --git a/src/tests/test_importers/data_files/Gwinstek_LSF/mode_binary_4.LSF b/src/tests/test_io/test_importers/data_files/Gwinstek_LSF/mode_binary_4.LSF similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek_LSF/mode_binary_4.LSF rename to src/tests/test_io/test_importers/data_files/Gwinstek_LSF/mode_binary_4.LSF diff --git a/src/tests/test_importers/data_files/Gwinstek_LSF/top.LSF b/src/tests/test_io/test_importers/data_files/Gwinstek_LSF/top.LSF similarity index 100% rename from src/tests/test_importers/data_files/Gwinstek_LSF/top.LSF rename to src/tests/test_io/test_importers/data_files/Gwinstek_LSF/top.LSF diff --git a/src/tests/test_importers/data_files/HP4395A/ADDHAG.txt b/src/tests/test_io/test_importers/data_files/HP4395A/ADDHAG.txt similarity index 100% rename from src/tests/test_importers/data_files/HP4395A/ADDHAG.txt rename to src/tests/test_io/test_importers/data_files/HP4395A/ADDHAG.txt diff --git a/src/tests/test_importers/data_files/HP4395A/transfer_function.txt b/src/tests/test_io/test_importers/data_files/HP4395A/transfer_function.txt similarity index 100% rename from src/tests/test_importers/data_files/HP4395A/transfer_function.txt rename to src/tests/test_io/test_importers/data_files/HP4395A/transfer_function.txt diff --git a/src/tests/test_importers/data_files/KeysightBinary/keysight_binary.bin b/src/tests/test_io/test_importers/data_files/KeysightBinary/keysight_binary.bin similarity index 100% rename from src/tests/test_importers/data_files/KeysightBinary/keysight_binary.bin rename to src/tests/test_io/test_importers/data_files/KeysightBinary/keysight_binary.bin diff --git a/src/tests/test_importers/data_files/KeysightCSV/20180606_001.csv b/src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_001.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightCSV/20180606_001.csv rename to src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_001.csv diff --git a/src/tests/test_importers/data_files/KeysightCSV/20180606_002.csv b/src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_002.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightCSV/20180606_002.csv rename to src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_002.csv diff --git a/src/tests/test_importers/data_files/KeysightCSV/20180606_003.csv b/src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_003.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightCSV/20180606_003.csv rename to src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_003.csv diff --git a/src/tests/test_importers/data_files/KeysightCSV/20180606_004_1.csv b/src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_004_1.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightCSV/20180606_004_1.csv rename to src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_004_1.csv diff --git a/src/tests/test_importers/data_files/KeysightCSV/20180606_004_2.csv b/src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_004_2.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightCSV/20180606_004_2.csv rename to src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_004_2.csv diff --git a/src/tests/test_importers/data_files/KeysightCSV/20180606_004_3.csv b/src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_004_3.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightCSV/20180606_004_3.csv rename to src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_004_3.csv diff --git a/src/tests/test_importers/data_files/KeysightCSV/20180606_004_4.csv b/src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_004_4.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightCSV/20180606_004_4.csv rename to src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_004_4.csv diff --git a/src/tests/test_importers/data_files/KeysightCSV/20180606_005_1.csv b/src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_005_1.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightCSV/20180606_005_1.csv rename to src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_005_1.csv diff --git a/src/tests/test_importers/data_files/KeysightCSV/20180606_005_2.csv b/src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_005_2.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightCSV/20180606_005_2.csv rename to src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_005_2.csv diff --git a/src/tests/test_importers/data_files/KeysightCSV/20180606_005_3.csv b/src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_005_3.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightCSV/20180606_005_3.csv rename to src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_005_3.csv diff --git a/src/tests/test_importers/data_files/KeysightCSV/20180606_005_4.csv b/src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_005_4.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightCSV/20180606_005_4.csv rename to src/tests/test_io/test_importers/data_files/KeysightCSV/20180606_005_4.csv diff --git a/src/tests/test_importers/data_files/KeysightFRA/scope_0_comma.csv b/src/tests/test_io/test_importers/data_files/KeysightFRA/scope_0_comma.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightFRA/scope_0_comma.csv rename to src/tests/test_io/test_importers/data_files/KeysightFRA/scope_0_comma.csv diff --git a/src/tests/test_importers/data_files/KeysightFRA/scope_1_semicolon.csv b/src/tests/test_io/test_importers/data_files/KeysightFRA/scope_1_semicolon.csv similarity index 100% rename from src/tests/test_importers/data_files/KeysightFRA/scope_1_semicolon.csv rename to src/tests/test_io/test_importers/data_files/KeysightFRA/scope_1_semicolon.csv diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/2010830P_001 b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830P_001 similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/2010830P_001 rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830P_001 diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/2010830P_002 b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830P_002 similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/2010830P_002 rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830P_002 diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/2010830P_003 b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830P_003 similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/2010830P_003 rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830P_003 diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/2010830RD_001 b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830RD_001 similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/2010830RD_001 rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830RD_001 diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/2010830RD_002 b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830RD_002 similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/2010830RD_002 rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830RD_002 diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/2010830RD_003 b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830RD_003 similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/2010830RD_003 rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830RD_003 diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/2010830RD_004 b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830RD_004 similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/2010830RD_004 rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/2010830RD_004 diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/20180605_001 b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/20180605_001 similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/20180605_001 rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/20180605_001 diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/20180605_002 b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/20180605_002 similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/20180605_002 rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/20180605_002 diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/20180822_004 b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/20180822_004 similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/20180822_004 rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/20180822_004 diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/FSV-4_multitrace_comma.DAT b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/FSV-4_multitrace_comma.DAT similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/FSV-4_multitrace_comma.DAT rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/FSV-4_multitrace_comma.DAT diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/FSV-4_multitrace_dot.DAT b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/FSV-4_multitrace_dot.DAT similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/FSV-4_multitrace_dot.DAT rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/FSV-4_multitrace_dot.DAT diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/FSV-4_singletrace_comma.DAT b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/FSV-4_singletrace_comma.DAT similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/FSV-4_singletrace_comma.DAT rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/FSV-4_singletrace_comma.DAT diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/FSV-4_singletrace_dot.DAT b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/FSV-4_singletrace_dot.DAT similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/FSV-4_singletrace_dot.DAT rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/FSV-4_singletrace_dot.DAT diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/FSVR-7_singletrace_comma.DAT b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/FSVR-7_singletrace_comma.DAT similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/FSVR-7_singletrace_comma.DAT rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/FSVR-7_singletrace_comma.DAT diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/FSVR-7_singletrace_dot.DAT b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/FSVR-7_singletrace_dot.DAT similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/FSVR-7_singletrace_dot.DAT rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/FSVR-7_singletrace_dot.DAT diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/fsvr-7.DAT b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/fsvr-7.DAT similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/fsvr-7.DAT rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/fsvr-7.DAT diff --git a/src/tests/test_importers/data_files/RhodeSchwarz/multitrace.DAT b/src/tests/test_io/test_importers/data_files/RhodeSchwarz/multitrace.DAT similarity index 100% rename from src/tests/test_importers/data_files/RhodeSchwarz/multitrace.DAT rename to src/tests/test_io/test_importers/data_files/RhodeSchwarz/multitrace.DAT diff --git a/src/tests/test_importers/data_files/Tektronix/0001.csv b/src/tests/test_io/test_importers/data_files/Tektronix/0001.csv similarity index 100% rename from src/tests/test_importers/data_files/Tektronix/0001.csv rename to src/tests/test_io/test_importers/data_files/Tektronix/0001.csv diff --git a/src/tests/test_importers/data_files/Tektronix/0004.csv b/src/tests/test_io/test_importers/data_files/Tektronix/0004.csv similarity index 100% rename from src/tests/test_importers/data_files/Tektronix/0004.csv rename to src/tests/test_io/test_importers/data_files/Tektronix/0004.csv diff --git a/src/tests/test_importers/data_files/Tektronix/1.csv b/src/tests/test_io/test_importers/data_files/Tektronix/1.csv similarity index 100% rename from src/tests/test_importers/data_files/Tektronix/1.csv rename to src/tests/test_io/test_importers/data_files/Tektronix/1.csv diff --git a/src/tests/test_importers/data_files/Tektronix/1112.csv b/src/tests/test_io/test_importers/data_files/Tektronix/1112.csv similarity index 100% rename from src/tests/test_importers/data_files/Tektronix/1112.csv rename to src/tests/test_io/test_importers/data_files/Tektronix/1112.csv diff --git a/src/tests/test_importers/data_files/Tektronix/20007.csv b/src/tests/test_io/test_importers/data_files/Tektronix/20007.csv similarity index 100% rename from src/tests/test_importers/data_files/Tektronix/20007.csv rename to src/tests/test_io/test_importers/data_files/Tektronix/20007.csv diff --git a/src/tests/test_importers/data_files/Tektronix/25.csv b/src/tests/test_io/test_importers/data_files/Tektronix/25.csv similarity index 100% rename from src/tests/test_importers/data_files/Tektronix/25.csv rename to src/tests/test_io/test_importers/data_files/Tektronix/25.csv diff --git a/src/tests/test_importers/data_files/Tektronix/30003_multitrace.csv b/src/tests/test_io/test_importers/data_files/Tektronix/30003_multitrace.csv similarity index 100% rename from src/tests/test_importers/data_files/Tektronix/30003_multitrace.csv rename to src/tests/test_io/test_importers/data_files/Tektronix/30003_multitrace.csv diff --git a/src/tests/test_importers/data_files/Tektronix/TektronixRSA5103B_Spectrum.csv b/src/tests/test_io/test_importers/data_files/Tektronix/TektronixRSA5103B_Spectrum.csv similarity index 100% rename from src/tests/test_importers/data_files/Tektronix/TektronixRSA5103B_Spectrum.csv rename to src/tests/test_io/test_importers/data_files/Tektronix/TektronixRSA5103B_Spectrum.csv diff --git a/src/tests/test_importers/data_files/Tektronix/cable_resonance_115_singletrace.csv b/src/tests/test_io/test_importers/data_files/Tektronix/cable_resonance_115_singletrace.csv similarity index 100% rename from src/tests/test_importers/data_files/Tektronix/cable_resonance_115_singletrace.csv rename to src/tests/test_io/test_importers/data_files/Tektronix/cable_resonance_115_singletrace.csv diff --git a/src/tests/test_importers/data_files/Tektronix/tr1 (0.75 mW).csv b/src/tests/test_io/test_importers/data_files/Tektronix/tr1 (0.75 mW).csv similarity index 100% rename from src/tests/test_importers/data_files/Tektronix/tr1 (0.75 mW).csv rename to src/tests/test_io/test_importers/data_files/Tektronix/tr1 (0.75 mW).csv diff --git a/src/tests/test_importers/data_files/TektronixDPX/0001.csv b/src/tests/test_io/test_importers/data_files/TektronixDPX/0001.csv similarity index 100% rename from src/tests/test_importers/data_files/TektronixDPX/0001.csv rename to src/tests/test_io/test_importers/data_files/TektronixDPX/0001.csv diff --git a/src/tests/test_importers/data_files/TektronixSpectrogram/test2.mat b/src/tests/test_io/test_importers/data_files/TektronixSpectrogram/test2.mat similarity index 100% rename from src/tests/test_importers/data_files/TektronixSpectrogram/test2.mat rename to src/tests/test_io/test_importers/data_files/TektronixSpectrogram/test2.mat diff --git a/src/tests/test_importers/test_ascii/test_ascii.py b/src/tests/test_io/test_importers/test_ascii/test_ascii.py similarity index 100% rename from src/tests/test_importers/test_ascii/test_ascii.py rename to src/tests/test_io/test_importers/test_ascii/test_ascii.py diff --git a/src/tests/test_importers/test_ascii_header/test_ascii_header.py b/src/tests/test_io/test_importers/test_ascii_header/test_ascii_header.py similarity index 97% rename from src/tests/test_importers/test_ascii_header/test_ascii_header.py rename to src/tests/test_io/test_importers/test_ascii_header/test_ascii_header.py index f5f1227..2f51932 100644 --- a/src/tests/test_importers/test_ascii_header/test_ascii_header.py +++ b/src/tests/test_io/test_importers/test_ascii_header/test_ascii_header.py @@ -8,8 +8,8 @@ from openqlab.io.importers.utils import UnknownFileType class TestASCII_Header(unittest.TestCase): importer = ASCII_Header - files_path = Path(r"./test_importers/data_files") - supported_files_path = Path(r"./test_importers/data_files/ASCII_Header") + files_path = Path(r"test_io/test_importers/data_files") + supported_files_path = Path(r"test_io/test_importers/data_files/ASCII_Header") multiline_comment = "This is a multiline comment.\nIt continues at the next line.\nAnd another line\nwith newline." def read_file(self, file): diff --git a/src/tests/test_importers/test_base_importer/test_base_importer.py b/src/tests/test_io/test_importers/test_base_importer/test_base_importer.py similarity index 100% rename from src/tests/test_importers/test_base_importer/test_base_importer.py rename to src/tests/test_io/test_importers/test_base_importer/test_base_importer.py diff --git a/src/tests/test_importers/test_data_container_csv/data_container_csv.csv b/src/tests/test_io/test_importers/test_data_container_csv/data_container_csv.csv similarity index 100% rename from src/tests/test_importers/test_data_container_csv/data_container_csv.csv rename to src/tests/test_io/test_importers/test_data_container_csv/data_container_csv.csv diff --git a/src/tests/test_importers/test_data_container_csv/test_data_container_csv.py b/src/tests/test_io/test_importers/test_data_container_csv/test_data_container_csv.py similarity index 93% rename from src/tests/test_importers/test_data_container_csv/test_data_container_csv.py rename to src/tests/test_io/test_importers/test_data_container_csv/test_data_container_csv.py index 98c16b9..890d04a 100644 --- a/src/tests/test_importers/test_data_container_csv/test_data_container_csv.py +++ b/src/tests/test_io/test_importers/test_data_container_csv/test_data_container_csv.py @@ -10,8 +10,8 @@ from openqlab.io.importers.utils import ImportFailed, UnknownFileType class TestDataContainerCSV(unittest.TestCase): importer = DataContainerCSV - files_path = Path(r"./test_importers/data_files") - supported_files_path = Path(r"./test_importers/data_files/DataContainerCSV") + files_path = Path(r"test_io/test_importers/data_files") + supported_files_path = Path(r"test_io/test_importers/data_files/DataContainerCSV") def read_file(self, file): try: diff --git a/src/tests/test_importers/test_gwinstek/missing_data.csv b/src/tests/test_io/test_importers/test_gwinstek/missing_data.csv similarity index 100% rename from src/tests/test_importers/test_gwinstek/missing_data.csv rename to src/tests/test_io/test_importers/test_gwinstek/missing_data.csv diff --git a/src/tests/test_importers/test_gwinstek/missing_data_1.csv b/src/tests/test_io/test_importers/test_gwinstek/missing_data_1.csv similarity index 100% rename from src/tests/test_importers/test_gwinstek/missing_data_1.csv rename to src/tests/test_io/test_importers/test_gwinstek/missing_data_1.csv diff --git a/src/tests/test_importers/test_gwinstek/missing_savemode.csv b/src/tests/test_io/test_importers/test_gwinstek/missing_savemode.csv similarity index 100% rename from src/tests/test_importers/test_gwinstek/missing_savemode.csv rename to src/tests/test_io/test_importers/test_gwinstek/missing_savemode.csv diff --git a/src/tests/test_importers/test_gwinstek/test_gwinstek.py b/src/tests/test_io/test_importers/test_gwinstek/test_gwinstek.py similarity index 94% rename from src/tests/test_importers/test_gwinstek/test_gwinstek.py rename to src/tests/test_io/test_importers/test_gwinstek/test_gwinstek.py index d9c11af..0938f60 100644 --- a/src/tests/test_importers/test_gwinstek/test_gwinstek.py +++ b/src/tests/test_io/test_importers/test_gwinstek/test_gwinstek.py @@ -10,8 +10,8 @@ from openqlab.io.importers.utils import ImportFailed, UnknownFileType class TestGwinstek(unittest.TestCase): importer = Gwinstek - files_path = Path(r"./test_importers/data_files") - supported_files_path = Path(r"./test_importers/data_files/Gwinstek") + files_path = Path(r"test_io/test_importers/data_files") + supported_files_path = Path(r"test_io/test_importers/data_files/Gwinstek") def read_file(self, file): try: @@ -52,8 +52,8 @@ class TestGwinstek(unittest.TestCase): def test_missing_data(self): files = [ - r"./test_importers/test_gwinstek/missing_data.csv", - r"./test_importers/test_gwinstek/missing_data_1.csv", + r"test_io/test_importers/test_gwinstek/missing_data.csv", + r"test_io/test_importers/test_gwinstek/missing_data_1.csv", ] for file in files: try: @@ -63,7 +63,7 @@ class TestGwinstek(unittest.TestCase): raise AssertionError(f"{file} did not raise {EmptyDataError}") from e def test_wrong_savemode(self): - file = r"./test_importers/test_gwinstek/wrong_savemode.csv" + file = r"test_io/test_importers/test_gwinstek/wrong_savemode.csv" try: with self.assertRaises(ImportFailed): self.read_file(file) @@ -71,7 +71,7 @@ class TestGwinstek(unittest.TestCase): raise AssertionError(f"{file} did not raise {ImportFailed}") from e def test_missing_savemode(self): - file = r"./test_importers/test_gwinstek/missing_savemode.csv" + file = r"test_io/test_importers/test_gwinstek/missing_savemode.csv" try: with self.assertRaises(ImportFailed): self.read_file(file) diff --git a/src/tests/test_importers/test_gwinstek/wrong_savemode.csv b/src/tests/test_io/test_importers/test_gwinstek/wrong_savemode.csv similarity index 100% rename from src/tests/test_importers/test_gwinstek/wrong_savemode.csv rename to src/tests/test_io/test_importers/test_gwinstek/wrong_savemode.csv diff --git a/src/tests/test_importers/test_gwinstek_LSF/test_gwinstek_LSF.py b/src/tests/test_io/test_importers/test_gwinstek_LSF/test_gwinstek_LSF.py similarity index 95% rename from src/tests/test_importers/test_gwinstek_LSF/test_gwinstek_LSF.py rename to src/tests/test_io/test_importers/test_gwinstek_LSF/test_gwinstek_LSF.py index 735dc39..2f17175 100644 --- a/src/tests/test_importers/test_gwinstek_LSF/test_gwinstek_LSF.py +++ b/src/tests/test_io/test_importers/test_gwinstek_LSF/test_gwinstek_LSF.py @@ -10,8 +10,8 @@ from openqlab.io.importers.utils import ImportFailed, UnknownFileType class TestGwinstek_LSF(unittest.TestCase): importer = Gwinstek_LSF - files_path = Path(r"./test_importers/data_files") - supported_files_path = Path(r"./test_importers/data_files/Gwinstek_LSF") + files_path = Path(r"test_io/test_importers/data_files") + supported_files_path = Path(r"test_io/test_importers/data_files/Gwinstek_LSF") def read_file(self, file): try: diff --git a/src/tests/test_importers/test_hp4395a/missing_data.txt b/src/tests/test_io/test_importers/test_hp4395a/missing_data.txt similarity index 100% rename from src/tests/test_importers/test_hp4395a/missing_data.txt rename to src/tests/test_io/test_importers/test_hp4395a/missing_data.txt diff --git a/src/tests/test_importers/test_hp4395a/test_hp4395a.py b/src/tests/test_io/test_importers/test_hp4395a/test_hp4395a.py similarity index 94% rename from src/tests/test_importers/test_hp4395a/test_hp4395a.py rename to src/tests/test_io/test_importers/test_hp4395a/test_hp4395a.py index 285d421..81ec2b9 100644 --- a/src/tests/test_importers/test_hp4395a/test_hp4395a.py +++ b/src/tests/test_io/test_importers/test_hp4395a/test_hp4395a.py @@ -11,8 +11,8 @@ from openqlab.io.importers.utils import ImportFailed, UnknownFileType class TestHP4395A(unittest.TestCase): importer = HP4395A - files_path = Path(r"./test_importers/data_files") - supported_files_path = Path(r"./test_importers/data_files/HP4395A") + files_path = Path(r"test_io/test_importers/data_files") + supported_files_path = Path(r"test_io/test_importers/data_files/HP4395A") def read_file(self, file): try: @@ -49,7 +49,7 @@ class TestHP4395A(unittest.TestCase): raise AssertionError(f"{file} did not raise {UnknownFileType}") from e def test_missing_data(self): - files = [r"./test_importers/test_hp4395a/missing_data.txt"] + files = [r"test_io/test_importers/test_hp4395a/missing_data.txt"] for file in files: try: with self.assertRaises(EmptyDataError): diff --git a/src/tests/test_importers/test_keysight_binary/test_keysight_binary.py b/src/tests/test_io/test_importers/test_keysight_binary/test_keysight_binary.py similarity index 94% rename from src/tests/test_importers/test_keysight_binary/test_keysight_binary.py rename to src/tests/test_io/test_importers/test_keysight_binary/test_keysight_binary.py index f430eea..1f27f8b 100644 --- a/src/tests/test_importers/test_keysight_binary/test_keysight_binary.py +++ b/src/tests/test_io/test_importers/test_keysight_binary/test_keysight_binary.py @@ -9,8 +9,8 @@ from openqlab.io.importers.utils import ImportFailed, UnknownFileType class TestKeysightBinary(unittest.TestCase): importer = KeysightBinary - files_path = Path(r"./test_importers/data_files") - supported_files_path = Path(r"./test_importers/data_files/KeysightBinary") + files_path = Path(r"test_io/test_importers/data_files") + supported_files_path = Path(r"test_io/test_importers/data_files/KeysightBinary") def read_file(self, file): try: diff --git a/src/tests/test_importers/test_keysight_csv/missing_data.csv b/src/tests/test_io/test_importers/test_keysight_csv/missing_data.csv similarity index 100% rename from src/tests/test_importers/test_keysight_csv/missing_data.csv rename to src/tests/test_io/test_importers/test_keysight_csv/missing_data.csv diff --git a/src/tests/test_importers/test_keysight_csv/test_keysight_csv.py b/src/tests/test_io/test_importers/test_keysight_csv/test_keysight_csv.py similarity index 95% rename from src/tests/test_importers/test_keysight_csv/test_keysight_csv.py rename to src/tests/test_io/test_importers/test_keysight_csv/test_keysight_csv.py index 32d82fa..59ee838 100644 --- a/src/tests/test_importers/test_keysight_csv/test_keysight_csv.py +++ b/src/tests/test_io/test_importers/test_keysight_csv/test_keysight_csv.py @@ -11,8 +11,8 @@ from openqlab.io.importers.utils import UnknownFileType class TestKeysightCSV(unittest.TestCase): importer = KeysightCSV - files_path = Path(r"./test_importers/data_files") - supported_files_path = Path(r"./test_importers/data_files/KeysightCSV") + files_path = Path(r"test_io/test_importers/data_files") + supported_files_path = Path(r"test_io/test_importers/data_files/KeysightCSV") def read_file(self, file): try: @@ -49,7 +49,7 @@ class TestKeysightCSV(unittest.TestCase): raise AssertionError(f"{file} did not raise {UnknownFileType}") from e def test_missing_data(self): - file = r"./test_importers/test_keysight_csv/missing_data.csv" + file = r"test_io/test_importers/test_keysight_csv/missing_data.csv" try: with self.assertRaises(EmptyDataError): self.read_file(file) diff --git a/src/tests/test_importers/test_keysight_fra/missing_data.csv b/src/tests/test_io/test_importers/test_keysight_fra/missing_data.csv similarity index 100% rename from src/tests/test_importers/test_keysight_fra/missing_data.csv rename to src/tests/test_io/test_importers/test_keysight_fra/missing_data.csv diff --git a/src/tests/test_importers/test_keysight_fra/test_keysight_fra.py b/src/tests/test_io/test_importers/test_keysight_fra/test_keysight_fra.py similarity index 92% rename from src/tests/test_importers/test_keysight_fra/test_keysight_fra.py rename to src/tests/test_io/test_importers/test_keysight_fra/test_keysight_fra.py index 46aba2c..b5147eb 100644 --- a/src/tests/test_importers/test_keysight_fra/test_keysight_fra.py +++ b/src/tests/test_io/test_importers/test_keysight_fra/test_keysight_fra.py @@ -9,8 +9,8 @@ from openqlab.io.importers.utils import ImportFailed, UnknownFileType class TestKeysightFRA(unittest.TestCase): importer = KeysightFRA - files_path = Path(r"./test_importers/data_files") - supported_files_path = Path(r"./test_importers/data_files/KeysightFRA") + files_path = Path(r"test_io/test_importers/data_files") + supported_files_path = Path(r"test_io/test_importers/data_files/KeysightFRA") def read_file(self, file): try: @@ -47,7 +47,7 @@ class TestKeysightFRA(unittest.TestCase): raise AssertionError(f"{file} did not raise {UnknownFileType}") from e def test_missing_data(self): - file = Path(r"./test_importers/test_keysight_fra/missing_data.csv") + file = Path(r"test_io/test_importers/test_keysight_fra/missing_data.csv") try: with self.assertRaises(ImportFailed): self.read_file(file) diff --git a/src/tests/test_importers/test_rhode_schwarz/missing_data.csv b/src/tests/test_io/test_importers/test_rhode_schwarz/missing_data.csv similarity index 100% rename from src/tests/test_importers/test_rhode_schwarz/missing_data.csv rename to src/tests/test_io/test_importers/test_rhode_schwarz/missing_data.csv diff --git a/src/tests/test_importers/test_rhode_schwarz/missing_xUnit b/src/tests/test_io/test_importers/test_rhode_schwarz/missing_xUnit similarity index 100% rename from src/tests/test_importers/test_rhode_schwarz/missing_xUnit rename to src/tests/test_io/test_importers/test_rhode_schwarz/missing_xUnit diff --git a/src/tests/test_importers/test_rhode_schwarz/test_rhode_schwarz.py b/src/tests/test_io/test_importers/test_rhode_schwarz/test_rhode_schwarz.py similarity index 93% rename from src/tests/test_importers/test_rhode_schwarz/test_rhode_schwarz.py rename to src/tests/test_io/test_importers/test_rhode_schwarz/test_rhode_schwarz.py index 7a1de16..a972376 100644 --- a/src/tests/test_importers/test_rhode_schwarz/test_rhode_schwarz.py +++ b/src/tests/test_io/test_importers/test_rhode_schwarz/test_rhode_schwarz.py @@ -9,8 +9,8 @@ from openqlab.io.importers.utils import ImportFailed, UnknownFileType class TestRhodeSchwarz(unittest.TestCase): importer = RhodeSchwarz - files_path = Path(r"./test_importers/data_files") - supported_files_path = Path(r"./test_importers/data_files/RhodeSchwarz") + files_path = Path(r"test_io/test_importers/data_files") + supported_files_path = Path(r"test_io/test_importers/data_files/RhodeSchwarz") def read_file(self, file): try: @@ -49,7 +49,7 @@ class TestRhodeSchwarz(unittest.TestCase): raise AssertionError(f"{file} did not raise {UnknownFileType}") from e def test_missing_data(self): - file = Path(r"./test_importers/test_rhode_schwarz/missing_data.csv") + file = Path(r"test_io/test_importers/test_rhode_schwarz/missing_data.csv") try: with self.assertRaises(ImportFailed): self.read_file(file) @@ -57,7 +57,7 @@ class TestRhodeSchwarz(unittest.TestCase): raise AssertionError(f"{file} did not raise {ImportFailed}") from e def test_missing_xUnit(self): - file = Path(r"./test_importers/test_rhode_schwarz/missing_xUnit") + file = Path(r"test_io/test_importers/test_rhode_schwarz/missing_xUnit") data = self.read_file(file) self.assertEqual("x", data.index.name) diff --git a/src/tests/test_importers/test_tektronix/different_frequency_axis.csv b/src/tests/test_io/test_importers/test_tektronix/different_frequency_axis.csv similarity index 100% rename from src/tests/test_importers/test_tektronix/different_frequency_axis.csv rename to src/tests/test_io/test_importers/test_tektronix/different_frequency_axis.csv diff --git a/src/tests/test_importers/test_tektronix/missing_data.csv b/src/tests/test_io/test_importers/test_tektronix/missing_data.csv similarity index 100% rename from src/tests/test_importers/test_tektronix/missing_data.csv rename to src/tests/test_io/test_importers/test_tektronix/missing_data.csv diff --git a/src/tests/test_importers/test_tektronix/test_tektronix.py b/src/tests/test_io/test_importers/test_tektronix/test_tektronix.py similarity index 93% rename from src/tests/test_importers/test_tektronix/test_tektronix.py rename to src/tests/test_io/test_importers/test_tektronix/test_tektronix.py index 67cbe46..e9b9b64 100644 --- a/src/tests/test_importers/test_tektronix/test_tektronix.py +++ b/src/tests/test_io/test_importers/test_tektronix/test_tektronix.py @@ -9,8 +9,8 @@ from openqlab.io.importers.utils import ImportFailed, UnknownFileType class TestTektronix(unittest.TestCase): importer = Tektronix - files_path = Path(r"./test_importers/data_files") - supported_files_path = Path(r"./test_importers/data_files/Tektronix") + files_path = Path(r"test_io/test_importers/data_files") + supported_files_path = Path(r"test_io/test_importers/data_files/Tektronix") def read_file(self, file): try: @@ -47,18 +47,18 @@ class TestTektronix(unittest.TestCase): raise AssertionError(f"{file} did not raise {UnknownFileType}") from e def test_missing_data(self): - file = r"./test_importers/test_tektronix/missing_data.csv" + file = r"test_io/test_importers/test_tektronix/missing_data.csv" with self.assertRaises(ImportFailed): data = self.importer(file).read() def test_wrong_number_points(self): - file = r"./test_importers/test_tektronix/wrong_number_points.csv" + file = r"test_io/test_importers/test_tektronix/wrong_number_points.csv" error_message = f"'Tektronix' importer: Number of points does not fit number of values in file '{file}'." with self.assertRaisesRegex(ImportFailed, error_message): self.importer(file).read() def test_different_frequency_axis(self): - file = r"./test_importers/test_tektronix/different_frequency_axis.csv" + file = r"test_io/test_importers/test_tektronix/different_frequency_axis.csv" error_message = f"'Tektronix' importer: Traces in file '{file}' do not have equal frequency axis." with self.assertRaisesRegex(ImportFailed, error_message): self.importer(file).read() diff --git a/src/tests/test_importers/test_tektronix/wrong_number_points.csv b/src/tests/test_io/test_importers/test_tektronix/wrong_number_points.csv similarity index 100% rename from src/tests/test_importers/test_tektronix/wrong_number_points.csv rename to src/tests/test_io/test_importers/test_tektronix/wrong_number_points.csv diff --git a/src/tests/test_importers/test_tektronix_dpx/test_tektronix_dpx.py b/src/tests/test_io/test_importers/test_tektronix_dpx/test_tektronix_dpx.py similarity index 97% rename from src/tests/test_importers/test_tektronix_dpx/test_tektronix_dpx.py rename to src/tests/test_io/test_importers/test_tektronix_dpx/test_tektronix_dpx.py index 3ffcf99..a7320d1 100644 --- a/src/tests/test_importers/test_tektronix_dpx/test_tektronix_dpx.py +++ b/src/tests/test_io/test_importers/test_tektronix_dpx/test_tektronix_dpx.py @@ -9,8 +9,8 @@ from openqlab.io.importers.utils import ImportFailed, UnknownFileType class TestTektronix(unittest.TestCase): importer = TektronixDPX - files_path = Path(r"./test_importers/data_files") - supported_files_path = Path(r"./test_importers/data_files/TektronixDPX") + files_path = Path(r"test_io/test_importers/data_files") + supported_files_path = Path(r"test_io/test_importers/data_files/TektronixDPX") def read_file(self, file): try: diff --git a/src/tests/test_importers/test_tektronix_spectrogram/test_tektronix_spectrogram.py b/src/tests/test_io/test_importers/test_tektronix_spectrogram/test_tektronix_spectrogram.py similarity index 95% rename from src/tests/test_importers/test_tektronix_spectrogram/test_tektronix_spectrogram.py rename to src/tests/test_io/test_importers/test_tektronix_spectrogram/test_tektronix_spectrogram.py index a501136..75552db 100644 --- a/src/tests/test_importers/test_tektronix_spectrogram/test_tektronix_spectrogram.py +++ b/src/tests/test_io/test_importers/test_tektronix_spectrogram/test_tektronix_spectrogram.py @@ -9,8 +9,10 @@ from openqlab.io.importers.utils import UnknownFileType class TestTekSpectrogram(unittest.TestCase): importer = TektronixSpectrogram - files_path = Path(r"./test_importers/data_files") - supported_files_path = Path(r"./test_importers/data_files/TektronixSpectrogram") + files_path = Path(r"test_io/test_importers/data_files") + supported_files_path = Path( + r"test_io/test_importers/data_files/TektronixSpectrogram" + ) def read_file(self, file): try: diff --git a/src/tests/test_plots.py b/src/tests/test_plots/test_plots.py similarity index 100% rename from src/tests/test_plots.py rename to src/tests/test_plots/test_plots.py -- GitLab