From 9cf4a272c4f49f2b2f124dc9b9afdceb3e9f602f Mon Sep 17 00:00:00 2001 From: Bing Gong <b.gong@fz-juelich.de> Date: Mon, 8 Feb 2021 08:54:19 +0000 Subject: [PATCH] Replace the raise error by giving warning message. since for some month, there are missing data from raw dataset --- .../main_scripts/main_preprocess_data_step2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video_prediction_tools/main_scripts/main_preprocess_data_step2.py b/video_prediction_tools/main_scripts/main_preprocess_data_step2.py index 88bbed98..d5a57b8d 100644 --- a/video_prediction_tools/main_scripts/main_preprocess_data_step2.py +++ b/video_prediction_tools/main_scripts/main_preprocess_data_step2.py @@ -12,6 +12,7 @@ from mpi4py import MPI from general_utils import get_unique_vars from statistics import Calc_data_stat from data_preprocess.preprocess_data_step2 import * +import warnings def main(): @@ -50,8 +51,7 @@ def main(): # process stat-file: stat_obj.acc_stat_master(file_dir, int(month)) # process monthly statistic-file else: - raise ("The stat file does not exist:", os.path.join(file_dir, "stat_" + '{0:02}'.\ - format(month) + ".json")) + warnings.warn("The stat file for year {} month {} does not exist".format(year, month)) # finalize statistics and write to json-file stat_obj.finalize_stat_master(vars_uni) stat_obj.write_stat_json(input_dir_pkl) -- GitLab