From 1978de14b0bbbd0a96065e251a9b80d4c25eeb85 Mon Sep 17 00:00:00 2001 From: Baptiste Vandecrux <35140661+BaptisteVandecrux@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:59:10 +0200 Subject: [PATCH] more test fixing --- src/pypromice/postprocess/create_bufr_files.py | 2 +- src/pypromice/process/write.py | 2 +- tests/unit/qc/test_persistence.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pypromice/postprocess/create_bufr_files.py b/src/pypromice/postprocess/create_bufr_files.py index a6cb7842..33178deb 100644 --- a/src/pypromice/postprocess/create_bufr_files.py +++ b/src/pypromice/postprocess/create_bufr_files.py @@ -47,7 +47,7 @@ def create_bufr_files( Suffix for the compiled output file """ - periods = pd.date_range(period_start, period_end, freq="H") + periods = pd.date_range(period_start, period_end, freq="h") output_individual_root = output_root / "individual" output_compiled_root = output_root / "compiled" output_individual_root.mkdir(parents=True, exist_ok=True) diff --git a/src/pypromice/process/write.py b/src/pypromice/process/write.py index db513f23..58b87278 100644 --- a/src/pypromice/process/write.py +++ b/src/pypromice/process/write.py @@ -283,7 +283,7 @@ def addMeta(ds, meta): time_diff = pd.Timedelta((ds['time'][1] - ds['time'][0]).values) if time_diff == pd.Timedelta('10min'): sample_rate = "10min" - elif time_diff == pd.Timedelta('1H'): + elif time_diff == pd.Timedelta('1h'): sample_rate = "hourly" elif time_diff == pd.Timedelta('1D'): sample_rate = "daily" diff --git a/tests/unit/qc/test_persistence.py b/tests/unit/qc/test_persistence.py index 0707a9dd..d62174b5 100644 --- a/tests/unit/qc/test_persistence.py +++ b/tests/unit/qc/test_persistence.py @@ -64,7 +64,7 @@ def test_persistent_period_longer_than_period_threshold(self): input_series = pd.Series(index=time_range, data=np.arange(0, len(time_range))) input_series.iloc[index_start:index_end] = input_series.iloc[index_start] expected_output = input_series.map(lambda _: False) - expected_output[expected_filter_start:expected_filter_end] = True + expected_output.iloc[expected_filter_start:expected_filter_end] = True persistent_mask = find_persistent_regions( input_series, min_repeats=min_repeats, max_diff=0.001