From 8cce886919caaf59301e5d1c69993828335c37ae Mon Sep 17 00:00:00 2001 From: Peter Luenenschloss <peter.luenenschloss@ufz.de> Date: Mon, 9 Dec 2019 17:38:37 +0100 Subject: [PATCH] made small mess - but now everything works again --- saqc/funcs/harm_functions.py | 4 ++-- test/funcs/test_harm_funcs.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/saqc/funcs/harm_functions.py b/saqc/funcs/harm_functions.py index 28e4085ac..9f96141d1 100644 --- a/saqc/funcs/harm_functions.py +++ b/saqc/funcs/harm_functions.py @@ -618,9 +618,9 @@ def _reshapeFlags( # some consistency clean up to ensure new flags frame matching new data frames size: if ref_index[0] != flags.index[0]: - flags = pd.Series(data=flagger.BAD, index=[ref_index[0]], dtype=flagger.dtype).append(flags) + flags = pd.Series(data=flagger.BAD, index=[ref_index[0]]).astype(flagger.dtype).append(flags) if ref_index[-1] != flags.index[-1]: - flags = flags.append(pd.Series(data=flagger.BAD, index=[ref_index[-1]], dtype=flagger.dtype)) + flags = flags.append(pd.Series(data=flagger.BAD, index=[ref_index[-1]]).astype(flagger.dtype)) flagger_new = flagger.initFlags(flags=flags.to_frame(name=field)) diff --git a/test/funcs/test_harm_funcs.py b/test/funcs/test_harm_funcs.py index a74523cea..2419370e3 100644 --- a/test/funcs/test_harm_funcs.py +++ b/test/funcs/test_harm_funcs.py @@ -291,6 +291,7 @@ def test_multivariatHarmonization(multi_data, flagger, shift_comment): def test_gridInterpolation(data, method): freq = "15min" data = (data * np.sin(data)).append(data.shift(1, "2h")).shift(1, "3s") + data = data.squeeze() # we are just testing if the interpolation gets passed to the series without causing an error: _interpolateGrid( data, freq, method, order=1, agg_method=sum, downcast_interpolation=True @@ -341,9 +342,8 @@ def test_wrapper(data, flagger): if __name__ == "__main__": dat = data() - dat = dat.drop(dat.index[1:3]) - dat2 = dat.copy() - flagger = TESTFLAGGER[2] + flagger = TESTFLAGGER[1] + test_gridInterpolation(data(), 'polynomial') flagger2 = TESTFLAGGER[2] flagger = flagger.initFlags(dat) flagger2 = flagger.initFlags(dat2) -- GitLab