diff --git a/src/helpers.py b/src/helpers.py index be73614319b39dc36043437c64379342a96ce00e..dc5e3741af0e296fbe2021efc675729eacc12e73 100644 --- a/src/helpers.py +++ b/src/helpers.py @@ -11,6 +11,8 @@ import math import os import socket import time +import types + import keras.backend as K import xarray as xr @@ -53,6 +55,9 @@ class TimeTrackingWrapper: with TimeTracking(name=self.__wrapped__.__name__): return self.__wrapped__(*args, **kwargs) + def __get__(self, instance, cls): + return types.MethodType(self, instance) + class TimeTracking(object): """ @@ -115,6 +120,7 @@ def prepare_host(create_new=True, sampling="daily"): except OSError: user = "default" if hostname == "ZAM144": + user = "felix" path = f"/home/{user}/Data/toar_{sampling}/" elif hostname == "zam347": path = f"/home/{user}/Data/toar_{sampling}/" diff --git a/src/plotting/postprocessing_plotting.py b/src/plotting/postprocessing_plotting.py index c0e2b1ed063bb67d079cd184a574360070e61424..51286405ff53ff78dd0414567468ff3dd83cee0d 100644 --- a/src/plotting/postprocessing_plotting.py +++ b/src/plotting/postprocessing_plotting.py @@ -347,6 +347,8 @@ class PlotConditionalQuantiles(AbstractPlotClass): :return: """ + logging.info(f"start plotting {self.__name__}, scheduled number of plots: {(len(self.seasons) + 1) * 2}") + if len(self.seasons) > 0: self._plot_seasons() self._plot_all() @@ -372,7 +374,7 @@ class PlotConditionalQuantiles(AbstractPlotClass): self._plot_base(data=self._data, x_model=self._model_name, y_model=self._obs_name, plot_name_affix="cali-ref") self._plot_base(data=self._data, x_model=self._obs_name, y_model=self._model_name, plot_name_affix="like-base") - # @TimeTrackingWrapper + @TimeTrackingWrapper def _plot_base(self, data, x_model, y_model, plot_name_affix, season=""): """ Base method to create cond. quantile plots. Is called from _plot_all and _plot_seasonal @@ -384,6 +386,7 @@ class PlotConditionalQuantiles(AbstractPlotClass): :param season: List of seasons to use :return: """ + segmented_data, quantile_panel = self._prepare_plots(data, x_model, y_model) ylabel, xlabel = self._labels(x_model, self._opts["data_unit"]) plot_name = f"{self.plot_name}{self.add_affix(season)}{self.add_affix(plot_name_affix)}_plot.pdf"