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

corrected test and removed unnecessary logging.error calls

parent 99ae4546
No related branches found
No related tags found
3 merge requests!90WIP: new release update,!89Resolve "release branch / CI on gpu",!61Resolve "REFAC: clean-up bootstrap workflow"
Pipeline #32899 passed
...@@ -82,7 +82,6 @@ class TimeTracking(object): ...@@ -82,7 +82,6 @@ class TimeTracking(object):
self._end() self._end()
else: else:
msg = f"Time was already stopped {time.time() - self.end}s ago." msg = f"Time was already stopped {time.time() - self.end}s ago."
logging.error(msg)
raise AssertionError(msg) raise AssertionError(msg)
if get_duration: if get_duration:
return self.duration() return self.duration()
...@@ -117,7 +116,6 @@ def prepare_host(create_new=True, sampling="daily"): ...@@ -117,7 +116,6 @@ def prepare_host(create_new=True, sampling="daily"):
elif "runner-6HmDp9Qd-project-2411-concurrent" in hostname: elif "runner-6HmDp9Qd-project-2411-concurrent" in hostname:
path = f"/home/{user}/machinelearningtools/data/toar_{sampling}/" path = f"/home/{user}/machinelearningtools/data/toar_{sampling}/"
else: else:
logging.error(f"unknown host '{hostname}'")
raise OSError(f"unknown host '{hostname}'") raise OSError(f"unknown host '{hostname}'")
if not os.path.exists(path): if not os.path.exists(path):
try: try:
...@@ -127,7 +125,6 @@ def prepare_host(create_new=True, sampling="daily"): ...@@ -127,7 +125,6 @@ def prepare_host(create_new=True, sampling="daily"):
else: else:
raise PermissionError raise PermissionError
except PermissionError: except PermissionError:
logging.error(f"path '{path}' does not exist for host '{hostname}'.")
raise NotADirectoryError(f"path '{path}' does not exist for host '{hostname}'.") raise NotADirectoryError(f"path '{path}' does not exist for host '{hostname}'.")
else: else:
logging.debug(f"set path to: {path}") logging.debug(f"set path to: {path}")
......
...@@ -63,7 +63,6 @@ class RunEnvironment(object): ...@@ -63,7 +63,6 @@ class RunEnvironment(object):
except (NameNotFoundInDataStore, FileNotFoundError): except (NameNotFoundInDataStore, FileNotFoundError):
pass pass
@staticmethod @staticmethod
def do_stuff(length=2): def do_stuff(length=2):
time.sleep(length) time.sleep(length)
...@@ -106,7 +106,7 @@ class TestBootstrapGenerator: ...@@ -106,7 +106,7 @@ class TestBootstrapGenerator:
meta = boot_gen.get_bootstrap_meta_station_var_wise("DEBW107", "o3") meta = boot_gen.get_bootstrap_meta_station_var_wise("DEBW107", "o3")
labels = boot_gen.orig_generator.get_data_generator("DEBW107").get_transposed_label().shape[0] labels = boot_gen.orig_generator.get_data_generator("DEBW107").get_transposed_label().shape[0]
assert np.shape(meta) == (labels * boot_gen.number_of_boots, 2) assert np.shape(meta) == (labels * boot_gen.number_of_boots, 2)
assert np.testing.assert_array_equal(np.unique(meta), ["DEBW107", "o3"]) assert np.testing.assert_array_equal(np.unique(meta), ["DEBW107", "o3"]) is None
def test_get_labels(self, boot_gen): def test_get_labels(self, boot_gen):
res = [] res = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment