Skip to content

Commit

Permalink
Add check on control file and graceful exit, (#196)
Browse files Browse the repository at this point in the history
Modity `mon_data_space.py` adding a check on the control file and
graceful exit if not found. Without this exit the entire plot job
terminates. With this exit only the affected thread halts (with error
message), allowing all other plots to proceed.

This has been tested on wcoss2 by removing some control files from the
test data set. Missing control files are reported as warnings and all
plots with valid control files run to completion.

## Dependencies

None

Resolves #191 .
  • Loading branch information
EdwardSafford-NOAA authored Jul 12, 2024
1 parent 52b0b21 commit ab1b07c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/eva/data/mon_data_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def execute(self, dataset_config, data_collections, timing):
# Get control file and parse
# --------------------------
control_file = get(dataset_config, self.logger, 'control_file')
if not os.path.isfile(control_file[0]):
self.logger.info(f'Warning: control file {control_file[0]} not found, unable' +
' to plot')
exit(1)

dims_arr = []
if self.is_stn_data(control_file[0]):
Expand Down

0 comments on commit ab1b07c

Please sign in to comment.