From a2db44bbf97835db58030bbc3b22a552ce9d6b98 Mon Sep 17 00:00:00 2001 From: lukas leufen <l.leufen@fz-juelich.de> Date: Mon, 18 Nov 2019 14:23:22 +0100 Subject: [PATCH] start time tracking when new instead of init is called --- test/test_modules.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/test_modules.py b/test/test_modules.py index 6048a7d2..f5d281ef 100644 --- a/test/test_modules.py +++ b/test/test_modules.py @@ -44,7 +44,8 @@ class TestPreProcessing: def test_init(self, caplog): caplog.set_level(logging.INFO) - setup = ExperimentSetup({}, stations=['DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087']) + setup = ExperimentSetup({}, stations=['DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087'], + var_all_dict={'o3': 'dma8eu', 'temp': 'maximum'}) pre = PreProcessing(setup) assert caplog.record_tuples[0] == ('root', 20, 'PreProcessing started') assert caplog.record_tuples[1] == ('root', 20, 'check valid stations started') @@ -52,7 +53,9 @@ class TestPreProcessing: def test_run(self): pre_processing = object.__new__(PreProcessing) - pre_processing.setup = ExperimentSetup({}, stations=['DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087']) + pre_processing.time = TimeTracking() + pre_processing.setup = ExperimentSetup({}, stations=['DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087'], + var_all_dict={'o3': 'dma8eu', 'temp': 'maximum'}) assert pre_processing._run() is None def test_split_train_val_test(self): @@ -61,7 +64,9 @@ class TestPreProcessing: def test_check_valid_stations(self, caplog): caplog.set_level(logging.INFO) pre = object.__new__(PreProcessing) - pre.setup = ExperimentSetup({}, stations=['DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087']) + pre.time = TimeTracking() + pre.setup = ExperimentSetup({}, stations=['DEBW107', 'DEBY081', 'DEBW013', 'DEBW076', 'DEBW087'], + var_all_dict={'o3': 'dma8eu', 'temp': 'maximum'}) kwargs = {'start': '1997-01-01', 'end': '2017-12-31', 'limit_nan_fill': 1, 'window_history': 13, 'window_lead_time': 3, 'interpolate_method': 'linear', 'statistics_per_var': pre.setup.var_all_dict, } -- GitLab