diff --git a/mlair/data_handler/data_handler_single_station.py b/mlair/data_handler/data_handler_single_station.py index 8c22b42f63d29510233006583b809c0c823a5328..f749f53641755f204a739905a36418466e3f37d4 100644 --- a/mlair/data_handler/data_handler_single_station.py +++ b/mlair/data_handler/data_handler_single_station.py @@ -262,7 +262,7 @@ class DataHandlerSingleStation(AbstractDataHandler): hash = self._get_hash() filename = os.path.join(self.lazy_path, hash + ".pickle") if not os.path.exists(filename): - dill.dump(self._create_lazy_data(), file=open(filename, "wb")) + dill.dump(self._create_lazy_data(), file=open(filename, "wb"), protocol=4) def _create_lazy_data(self): return [self._data, self.meta, self.input_data, self.target_data] diff --git a/mlair/data_handler/default_data_handler.py b/mlair/data_handler/default_data_handler.py index 687bdd8899a07a57cae0ae85e066cd4ad1ad099e..d7eda7a9f7c8d33d5d1af0cd1863ee00f6075a80 100644 --- a/mlair/data_handler/default_data_handler.py +++ b/mlair/data_handler/default_data_handler.py @@ -93,7 +93,7 @@ class DefaultDataHandler(AbstractDataHandler): data = {"X": self._X, "Y": self._Y, "X_extreme": self._X_extreme, "Y_extreme": self._Y_extreme} data = self._force_dask_computation(data) with open(self._save_file, "wb") as f: - dill.dump(data, f) + dill.dump(data, f, protocol=4) logging.debug(f"save pickle data to {self._save_file}") self._reset_data() @@ -371,5 +371,5 @@ def f_proc(data_handler, station, return_strategy="", tmp_path=None, **sp_keys): else: _tmp_file = os.path.join(tmp_path, f"{station}_{'%032x' % random.getrandbits(128)}.pickle") with open(_tmp_file, "wb") as f: - dill.dump(res, f) + dill.dump(res, f, protocol=4) return _tmp_file, station diff --git a/mlair/run_modules/pre_processing.py b/mlair/run_modules/pre_processing.py index a46a57bd31adf6edb3b683773b84dd9f52d79262..873919fa93af3e4a43c3b16c382d9746ec26a573 100644 --- a/mlair/run_modules/pre_processing.py +++ b/mlair/run_modules/pre_processing.py @@ -343,7 +343,7 @@ def f_proc(data_handler, station, name_affix, store, return_strategy="", tmp_pat tmp_path = os.getcwd() _tmp_file = os.path.join(tmp_path, f"{station}_{'%032x' % random.getrandbits(128)}.pickle") with open(_tmp_file, "wb") as f: - dill.dump(res, f) + dill.dump(res, f, protocol=4) return _tmp_file, station