From b5b890c103180908707b9a4d640fd62bee8eaf0a Mon Sep 17 00:00:00 2001 From: veenstrajelmer Date: Fri, 11 Oct 2024 17:47:30 +0200 Subject: [PATCH] fixed testcases --- kenmerkendewaarden/data_retrieve.py | 2 +- tests/test_overschrijding.py | 4 ++-- tests/test_slotgemiddelden.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kenmerkendewaarden/data_retrieve.py b/kenmerkendewaarden/data_retrieve.py index 3de0032..1ac34d6 100644 --- a/kenmerkendewaarden/data_retrieve.py +++ b/kenmerkendewaarden/data_retrieve.py @@ -460,7 +460,7 @@ def clip_timeseries_physical_break(df_meas): "DENOVBTN": "1933", "HARLGN": "1933", "VLIELHVN": "1941", - } + } station = df_meas.attrs["station"] if station not in physical_break_dict.keys(): diff --git a/tests/test_overschrijding.py b/tests/test_overschrijding.py index 8305e06..306d2c7 100644 --- a/tests/test_overschrijding.py +++ b/tests/test_overschrijding.py @@ -197,7 +197,7 @@ def test_calc_overschrijding_rule_type_break(df_ext_12_2010_2014): @pytest.mark.unittest def test_calc_overschrijding_clip_physical_break(df_ext_12_2010_2014): - # construct fake timeseries for VLIELHVN around physical break + # construct fake timeseries for HARLGN around physical break 1933 tstart_2010 = df_ext_12_2010_2014.index[0] tstart_1931 = pd.Timestamp( 1931, @@ -212,7 +212,7 @@ def test_calc_overschrijding_clip_physical_break(df_ext_12_2010_2014): df_ext_12_1931_1935 = df_ext_12_2010_2014.copy() df_ext_12_1931_1935.index = df_ext_12_1931_1935.index - tdiff - df_ext_12_1931_1935.attrs["station"] = "VLIELHVN" + df_ext_12_1931_1935.attrs["station"] = "HARLGN" Tfreqs_interested = [ 5, diff --git a/tests/test_slotgemiddelden.py b/tests/test_slotgemiddelden.py index 428de8e..d0b134d 100644 --- a/tests/test_slotgemiddelden.py +++ b/tests/test_slotgemiddelden.py @@ -163,18 +163,18 @@ def test_calc_slotgemiddelden_correct_tstop(df_meas_2010_2014): @pytest.mark.unittest def test_calc_slotgemiddelden_physical_break(df_meas_2010_2014, df_ext_12_2010_2014): - # construct fake timeseries for VLIELHVN around physical break + # construct fake timeseries for VLIELHVN around physical break 1933 tstart_2010 = df_meas_2010_2014.index[0] tstart_1931 = pd.Timestamp(1931, 1, 1, tz=tstart_2010.tz) tdiff = tstart_2010 - tstart_1931 df_meas_1931_1935 = df_meas_2010_2014.copy() df_meas_1931_1935.index = df_meas_1931_1935.index - tdiff - df_meas_1931_1935.attrs["station"] = "VLIELHVN" + df_meas_1931_1935.attrs["station"] = "HARLGN" df_ext_12_1931_1935 = df_ext_12_2010_2014.copy() df_ext_12_1931_1935.index = df_ext_12_1931_1935.index - tdiff - df_ext_12_1931_1935.attrs["station"] = "VLIELHVN" + df_ext_12_1931_1935.attrs["station"] = "HARLGN" # check if the timeseries do not extend over the expected slotgemiddelden value assert df_meas_1931_1935.index[-1] <= pd.Timestamp("1936-01-01 00:00:00 +01:00")