Skip to content
Snippets Groups Projects
Commit 4708ee98 authored by leufen1's avatar leufen1
Browse files

only stop time if time attr is still present

parent 9ebf16aa
Branches
Tags
5 merge requests!480Merge multiple stats into crps working branch,!470Develop,!467Resolve "release v2.2.0",!466Draft: Resolve "Include CRPS analysis and other ens verif methods or plots",!460Resolve "TECH: reduce CI running time"
Pipeline #106875 canceled
......@@ -113,6 +113,7 @@ class RunEnvironment(object):
not as inheritance from this class, log file is copied and data store is cleared.
"""
if not self.del_by_exit:
if hasattr(self, "time"):
self.time.stop()
try:
logging.info(f"{self._name} finished after {self.time}")
......
......@@ -9,8 +9,6 @@ from mlair.helpers import PyTestRegex
from mlair.run_modules.experiment_setup import ExperimentSetup
from mlair.run_modules.pre_processing import PreProcessing
from mlair.run_modules.run_environment import RunEnvironment
import pandas as pd
import numpy as np
import multiprocessing
......@@ -146,24 +144,3 @@ class TestPreProcessing:
class data_preparation_no_trans: pass
assert pre.transformation(data_preparation_no_trans, stations) is None
# @pytest.fixture
# def dummy_df(self):
# data_dict = {'station_name': {'DEBW013': 'Stuttgart Bad Cannstatt', 'DEBW076': 'Baden-Baden',
# 'DEBW087': 'Schwäbische_Alb', 'DEBW107': 'Tübingen',
# 'DEBY081': 'Garmisch-Partenkirchen/Kreuzeckbahnstraße', '# Stations': np.nan,
# '# Samples': np.nan},
# 'station_lon': {'DEBW013': 9.2297, 'DEBW076': 8.2202, 'DEBW087': 9.2076, 'DEBW107': 9.0512,
# 'DEBY081': 11.0631, '# Stations': np.nan, '# Samples': np.nan},
# 'station_lat': {'DEBW013': 48.8088, 'DEBW076': 48.7731, 'DEBW087': 48.3458, 'DEBW107': 48.5077,
# 'DEBY081': 47.4764, '# Stations': np.nan, '# Samples': np.nan},
# 'station_alt': {'DEBW013': 235.0, 'DEBW076': 148.0, 'DEBW087': 798.0, 'DEBW107': 325.0,
# 'DEBY081': 735.0, '# Stations': np.nan, '# Samples': np.nan},
# 'train': {'DEBW013': 1413, 'DEBW076': 3002, 'DEBW087': 3016, 'DEBW107': 1782, 'DEBY081': 2837,
# '# Stations': 6, '# Samples': 12050},
# 'val': {'DEBW013': 698, 'DEBW076': 715, 'DEBW087': 700, 'DEBW107': 701, 'DEBY081': 456,
# '# Stations': 6, '# Samples': 3270},
# 'test': {'DEBW013': 1066, 'DEBW076': 696, 'DEBW087': 1080, 'DEBW107': 1080, 'DEBY081': 700,
# '# Stations': 6, '# Samples': 4622}}
# df = pd.DataFrame.from_dict(data_dict)
# return df
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment