Skip to content
Snippets Groups Projects
Commit a2db44bb authored by lukas leufen's avatar lukas leufen
Browse files

start time tracking when new instead of init is called

parent 09172c8c
Branches
Tags
Loading
Checking pipeline status
...@@ -44,7 +44,8 @@ class TestPreProcessing: ...@@ -44,7 +44,8 @@ class TestPreProcessing:
def test_init(self, caplog): def test_init(self, caplog):
caplog.set_level(logging.INFO) 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) pre = PreProcessing(setup)
assert caplog.record_tuples[0] == ('root', 20, 'PreProcessing started') assert caplog.record_tuples[0] == ('root', 20, 'PreProcessing started')
assert caplog.record_tuples[1] == ('root', 20, 'check valid stations started') assert caplog.record_tuples[1] == ('root', 20, 'check valid stations started')
...@@ -52,7 +53,9 @@ class TestPreProcessing: ...@@ -52,7 +53,9 @@ class TestPreProcessing:
def test_run(self): def test_run(self):
pre_processing = object.__new__(PreProcessing) 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 assert pre_processing._run() is None
def test_split_train_val_test(self): def test_split_train_val_test(self):
...@@ -61,7 +64,9 @@ class TestPreProcessing: ...@@ -61,7 +64,9 @@ class TestPreProcessing:
def test_check_valid_stations(self, caplog): def test_check_valid_stations(self, caplog):
caplog.set_level(logging.INFO) caplog.set_level(logging.INFO)
pre = object.__new__(PreProcessing) 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, kwargs = {'start': '1997-01-01', 'end': '2017-12-31', 'limit_nan_fill': 1, 'window_history': 13,
'window_lead_time': 3, 'interpolate_method': 'linear', 'window_lead_time': 3, 'interpolate_method': 'linear',
'statistics_per_var': pre.setup.var_all_dict, } 'statistics_per_var': pre.setup.var_all_dict, }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment