From 46a48ee901834b964d9513ba23e38fdeb6f6d394 Mon Sep 17 00:00:00 2001
From: lukas leufen <l.leufen@fz-juelich.de>
Date: Mon, 24 Aug 2020 13:12:45 +0200
Subject: [PATCH] abort experiment if no valid station was found

---
 mlair/run_modules/pre_processing.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mlair/run_modules/pre_processing.py b/mlair/run_modules/pre_processing.py
index 529efec5..b4185df2 100644
--- a/mlair/run_modules/pre_processing.py
+++ b/mlair/run_modules/pre_processing.py
@@ -57,6 +57,8 @@ class PreProcessing(RunEnvironment):
         stations = self.data_store.get("stations")
         data_preparation = self.data_store.get("data_preparation")
         _, valid_stations = self.validate_station(data_preparation, stations, "preprocessing", overwrite_local_data=True)
+        if len(valid_stations) == 0:
+            raise ValueError("Couldn't find any valid data according to given parameters. Abort experiment run.")
         self.data_store.set("stations", valid_stations)
         self.split_train_val_test()
         self.report_pre_processing()
-- 
GitLab