Skip to content
Snippets Groups Projects
Commit 95a2c78b authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Check if target file already exists.

parent cd2d0cc7
No related branches found
No related tags found
No related merge requests found
......@@ -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])])))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment