FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit d4dc9786 authored by J.W. Smith's avatar J.W. Smith
Browse files

fix: More precise check input from NAME

The tarred directory of files from the Met Office includes the NAME .txt files to use as input, as well as various log files and diagnostic plots. The number of log files changed recently but shouldn't affect the operatinal calcs. This change means the check for a complete transfer of incoming files cares only about the NAME .txt files.
parent d8a3bf92
No related branches found
No related tags found
No related merge requests found
......@@ -357,8 +357,8 @@ def process_in_job_env2_0(jobPath,status,config,component):
subprocess_and_log(cmd_tar,description_short, description_long)
# basic check that contents are as expected for 7-day forecast
# 57 files of NAME .txt timesteps and one summary png file
if len(os.listdir(f"{jobPath}/{file_name}")) != 58:
# 57 files of NAME .txt timesteps and some number of log files
if len(glob(f"{jobPath}/{file_name}/Met_Data_C1_T*.txt")) != 57:
msg = f"Insufficient contents of untarred file in directory {jobPath}/{file_name}"
logger.error(msg)
raise RuntimeError(msg)
......@@ -447,7 +447,7 @@ def process_in_job_dep(jobPath,status,config,component):
# basic check that contents are as expected
# 132 files of NAME .txt timesteps and one summary png file
if len(os.listdir(f"{jobPath}/{file_name}")) not in [74,133]:
if len(glob(f"{jobPath}/{file_name}/deposition_srcs_allregions_C1_T*.txt")) != 56:
logger.warning(f"Insufficient contents of input tar file (are sources.txt and sourcelocations.txt missing?)")
return
......
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