From 8f5bed9cd66514503de5433d5e76b2d4645dd459 Mon Sep 17 00:00:00 2001 From: Felix Kleinert <f.kleinert@fz-juelich.de> Date: Mon, 6 Apr 2020 15:57:45 +0200 Subject: [PATCH] Do not exec map plots --- src/helpers.py | 4 ++++ src/run_modules/experiment_setup.py | 4 ++++ src/run_modules/post_processing.py | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/helpers.py b/src/helpers.py index 2589cfe8..a1c50858 100644 --- a/src/helpers.py +++ b/src/helpers.py @@ -97,6 +97,10 @@ class TimeTracking(object): logging.info(f"{self._name} finished after {self}") +def get_host(): + return socket.gethostname() + + def prepare_host(create_new=True, sampling="daily"): hostname = socket.gethostname() try: diff --git a/src/run_modules/experiment_setup.py b/src/run_modules/experiment_setup.py index 95bd5056..47d3adb8 100644 --- a/src/run_modules/experiment_setup.py +++ b/src/run_modules/experiment_setup.py @@ -6,6 +6,8 @@ import argparse import logging import os from typing import Union, Dict, Any +import socket + from src import helpers from src.run_modules.run_environment import RunEnvironment @@ -46,6 +48,8 @@ class ExperimentSetup(RunEnvironment): # experiment setup self._set_param("data_path", helpers.prepare_host(sampling=sampling)) + # self._set_param("hostname", helpers.get_host()) + self._set_param("hostname", "jwc0123") self._set_param("create_new_model", create_new_model, default=True) if self.data_store.get("create_new_model"): trainable = True diff --git a/src/run_modules/post_processing.py b/src/run_modules/post_processing.py index 158b29c6..b32d030e 100644 --- a/src/run_modules/post_processing.py +++ b/src/run_modules/post_processing.py @@ -199,7 +199,7 @@ class PostProcessing(RunEnvironment): forecast_path=path, plot_name_affix="cali-ref", plot_folder=self.plot_path) plot_conditional_quantiles(self.test_data.stations, pred_name="obs", ref_name="CNN", forecast_path=path, plot_name_affix="like-bas", plot_folder=self.plot_path) - if "PlotStationMap" in plot_list: + if ("PlotStationMap" in plot_list) and (not self.data_store.get("hostname")[:2] == "jw"): PlotStationMap(generators={'b': self.test_data}, plot_folder=self.plot_path) if "PlotMonthlySummary" in plot_list: PlotMonthlySummary(self.test_data.stations, path, r"forecasts_%s_test.nc", self.target_var, -- GitLab