From 104c321f9bcafe6ec0d87993567458efb7af7d31 Mon Sep 17 00:00:00 2001
From: leufen1 <l.leufen@fz-juelich.de>
Date: Fri, 13 Nov 2020 12:56:36 +0100
Subject: [PATCH] some minor fixes, apply bug fix from #212, another minor bug
 fixed inside the mixed sampling data handler regarding parameters start and
 stop

---
 mlair/data_handler/data_handler_mixed_sampling.py | 2 +-
 mlair/helpers/join.py                             | 2 +-
 mlair/run_modules/pre_processing.py               | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/mlair/data_handler/data_handler_mixed_sampling.py b/mlair/data_handler/data_handler_mixed_sampling.py
index 1aec30b8..23996c80 100644
--- a/mlair/data_handler/data_handler_mixed_sampling.py
+++ b/mlair/data_handler/data_handler_mixed_sampling.py
@@ -37,7 +37,7 @@ class DataHandlerMixedSamplingSingleStation(DataHandlerSingleStation):
 
     def load_and_interpolate(self, ind) -> [xr.DataArray, pd.DataFrame]:
         data, self.meta = self.load_data(self.path[ind], self.station, self.statistics_per_var, self.sampling[ind],
-                                         self.station_type, self.network, self.store_data_locally, start, end)
+                                         self.station_type, self.network, self.store_data_locally, self.start, self.end)
         data = self.interpolate(data, dim=self.time_dim, method=self.interpolation_method,
                                 limit=self.interpolation_limit)
         return data
diff --git a/mlair/helpers/join.py b/mlair/helpers/join.py
index f66b277b..4683ba2a 100644
--- a/mlair/helpers/join.py
+++ b/mlair/helpers/join.py
@@ -46,7 +46,7 @@ def download_join(station_name: Union[str, List[str]], stat_var: dict, station_t
 
     # correct stat_var values if data is not aggregated (hourly)
     if sampling == "hourly":
-        [stat_var.update({k: "values"}) for k in stat_var.keys()]
+        stat_var = {key: "values" for key in stat_var.keys()}
 
     # download all variables with given statistic
     data = None
diff --git a/mlair/run_modules/pre_processing.py b/mlair/run_modules/pre_processing.py
index 82af9cf0..4cee4a97 100644
--- a/mlair/run_modules/pre_processing.py
+++ b/mlair/run_modules/pre_processing.py
@@ -207,6 +207,7 @@ class PreProcessing(RunEnvironment):
         logging.info(f"check valid stations started{' (%s)' % (set_name if set_name is not None else 'all')}")
         # calculate transformation using train data
         if set_name == "train":
+            logging.info("setup transformation using train data exclusively")
             self.transformation(data_handler, set_stations)
         # start station check
         collection = DataCollection()
-- 
GitLab