From 95a2c78b24d46804f195fbbb18a752eff72628f1 Mon Sep 17 00:00:00 2001 From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu> Date: Fri, 22 Oct 2021 16:22:02 +0200 Subject: [PATCH] Check if target file already exists. --- climax/main/downscale_infer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/climax/main/downscale_infer.py b/climax/main/downscale_infer.py index a023e00..050fc5d 100644 --- a/climax/main/downscale_infer.py +++ b/climax/main/downscale_infer.py @@ -55,6 +55,11 @@ if __name__ == '__main__': LOGGER.info('{} does not exist.'.format(state_file)) sys.exit() + # initialize logging + log_file = MODEL_PATH.joinpath(PREDICTAND, + state_file.name.replace('.pt', '_log.txt')) + dictConfig(log_conf(log_file)) + # check if target dataset already exists target = TARGET_PATH.joinpath(PREDICTAND, net.state_file.name.replace( net.state_file.suffix, '.nc')) @@ -62,11 +67,6 @@ if __name__ == '__main__': LogConfig.init_log('{} already exists.'.format(target)) sys.exit() - # initialize logging - log_file = MODEL_PATH.joinpath(PREDICTAND, - state_file.name.replace('.pt', '_log.txt')) - dictConfig(log_conf(log_file)) - # predict reference period LogConfig.init_log('Predicting reference period: {}'.format( ' - '.join([str(VALID_PERIOD[0]), str(VALID_PERIOD[-1])]))) -- GitLab