From 45d6182d994a7aa1a31eca8e0e13ab4524d5237e Mon Sep 17 00:00:00 2001 From: "Karl N. Kappler" Date: Tue, 9 Jan 2024 08:54:26 -0800 Subject: [PATCH] Assuage codecov - add a test covering typecheck on time_period - fix bug (isinstance args were permuted in fourier_coefficients.py) --- aurora/pipelines/fourier_coefficients.py | 2 +- tests/synthetic/test_fourier_coefficients.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/aurora/pipelines/fourier_coefficients.py b/aurora/pipelines/fourier_coefficients.py index 2eddb708..e46e22a6 100644 --- a/aurora/pipelines/fourier_coefficients.py +++ b/aurora/pipelines/fourier_coefficients.py @@ -121,7 +121,7 @@ def decimation_and_stft_config_creator( dd.sample_rate_decimation = current_sample_rate if time_period: - if isinstance(mt_metadata.timeseries.time_period.TimePeriod, time_period): + if isinstance(time_period, mt_metadata.timeseries.time_period.TimePeriod): dd.time_period = time_period else: msg = ( diff --git a/tests/synthetic/test_fourier_coefficients.py b/tests/synthetic/test_fourier_coefficients.py index 5572cc53..a20783cf 100644 --- a/tests/synthetic/test_fourier_coefficients.py +++ b/tests/synthetic/test_fourier_coefficients.py @@ -114,6 +114,11 @@ def test_123(self): def test_decimation_and_stft_config_creator(self): cfgs = decimation_and_stft_config_creator(1.0) + + # test time period must of of type + with self.assertRaises(NotImplementedError): + time_period = ["2023-01-01T17:48:59", "2023-01-09T08:54:08"] + decimation_and_stft_config_creator(1.0, time_period=time_period) return cfgs def test_create_then_use_stored_fcs_for_processing(self):