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

Check ensemble identifiers.

parent 195c241b
No related branches found
No related tags found
No related merge requests found
...@@ -54,14 +54,15 @@ if __name__ == '__main__': ...@@ -54,14 +54,15 @@ if __name__ == '__main__':
args.target.mkdir(parents=True, exist_ok=True) args.target.mkdir(parents=True, exist_ok=True)
# check ensemble identifier # check ensemble identifier
ensemble_pattern = 'r[0-9]i[0-9]p[0-9]' if args.ensemble is not None:
ensemble = re.search(ensemble_pattern, args.ensemble) ensemble_id = 'r[0-9]i[0-9]p[0-9]'
if ensemble is None: ensemble = re.search(ensemble_id, args.ensemble)
LOGGER.info('Ensemble identifier "{}" invalid, form "{}" required.' if ensemble is None:
.format(args.ensemble, ensemble_pattern)) LOGGER.info('Ensemble identifier "{}" invalid, form "{}" '
sys.exit() 'required.'.format(args.ensemble, ensemble_id))
else: sys.exit()
ensemble = ensemble[0] else:
ensemble = ensemble[0]
# construct file pattern to match from input parameters # construct file pattern to match from input parameters
pattern = '(.*).nc$' pattern = '(.*).nc$'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment