diff --git a/.coveragerc b/.coveragerc index 69c1dcd3f1ca5068733a54fdb231bab80170169d..bc1fedc1454539088f93a014376f198ada7985e5 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,9 @@ # .coveragerc to control coverage.py [run] branch = True +omit = + # do not test keras legacy + mlair/keras_legacy [report] diff --git a/mlair/data_handler/data_handler_mixed_sampling.py b/mlair/data_handler/data_handler_mixed_sampling.py index e5e956848d6d5cebe9a2bc91a78ad4d9878c5f74..8633c647a33ea3c310d318c2629178fbbe99f7f0 100644 --- a/mlair/data_handler/data_handler_mixed_sampling.py +++ b/mlair/data_handler/data_handler_mixed_sampling.py @@ -363,7 +363,10 @@ class DataHandlerMixedSamplingWithClimateAndFirFilter(DataHandlerMixedSamplingWi if len(meteo_vars) > 0: if cls.data_handler_fir_pos is None: if "extend_length_opts" in kwargs: - cls.data_handler_fir_pos = 1 # use slower fir version with climate estimate + if isinstance(kwargs["extend_length_opts"], dict) and "meteo" not in kwargs["extend_length_opts"].keys(): + cls.data_handler_fir_pos = 0 # use faster fir version without climate estimate + else: + cls.data_handler_fir_pos = 1 # use slower fir version with climate estimate else: cls.data_handler_fir_pos = 0 # use faster fir version without climate estimate sp_keys = {k: copy.deepcopy(kwargs[k]) for k in cls.data_handler_fir[cls.data_handler_fir_pos].requirements() if k in kwargs} diff --git a/mlair/data_handler/data_handler_single_station.py b/mlair/data_handler/data_handler_single_station.py index 13092a94820408b7e138afe58fd29d5d5465fc80..038851d05f8b4b3ceeabc7e405acc858affeb874 100644 --- a/mlair/data_handler/data_handler_single_station.py +++ b/mlair/data_handler/data_handler_single_station.py @@ -113,7 +113,7 @@ class DataHandlerSingleStation(AbstractDataHandler): # internal self._data: xr.DataArray = None # loaded raw data self.meta = None - self.variables = list(statistics_per_var.keys()) if variables is None else variables + self.variables = sorted(list(statistics_per_var.keys())) if variables is None else variables self.history = None self.label = None self.observation = None diff --git a/mlair/data_handler/data_handler_with_filter.py b/mlair/data_handler/data_handler_with_filter.py index 73afc77879058410dc857772ae06e9953532d12e..997ecbf51740cce159d2339b589728b5e708de53 100644 --- a/mlair/data_handler/data_handler_with_filter.py +++ b/mlair/data_handler/data_handler_with_filter.py @@ -197,7 +197,8 @@ class DataHandlerFirFilterSingleStation(DataHandlerFilterSingleStation): plot_path=self.plot_path, plot_dates=self.plot_dates) self.fir_coeff = fir.filter_coefficients filter_data = fir.filtered_data - self.input_data = xr.concat(filter_data, pd.Index(self.create_filter_index(), name=self.filter_dim)) + input_data = xr.concat(filter_data, pd.Index(self.create_filter_index(), name=self.filter_dim)) + self.input_data = input_data.sel({self.target_dim: self.variables}) # this is just a code snippet to check the results of the kz filter # import matplotlib # matplotlib.use("TkAgg") @@ -386,7 +387,7 @@ class DataHandlerClimateFirFilterSingleStation(DataHandlerFirFilterSingleStation input_data = xr.concat(climate_filter_data, pd.Index(self.create_filter_index(add_unfiltered_index=False), name=self.filter_dim)) - self.input_data = input_data + self.input_data = input_data.sel({self.target_dim: self.variables}) # this is just a code snippet to check the results of the filter # import matplotlib diff --git a/mlair/plotting/abstract_plot_class.py b/mlair/plotting/abstract_plot_class.py index 7a91c2269ccd03608bcdbe67a634156f55fde91f..21e5d9413b490a4be5281c2a80308be558fe64c8 100644 --- a/mlair/plotting/abstract_plot_class.py +++ b/mlair/plotting/abstract_plot_class.py @@ -8,7 +8,7 @@ import os from matplotlib import pyplot as plt -class AbstractPlotClass: +class AbstractPlotClass: # pragma: no cover """ Abstract class for all plotting routines to unify plot workflow.