Skip to content

Commit

Permalink
Per #2769, add checks to make sure input files exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Jan 17, 2024
1 parent ba5f156 commit 908c069
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/python/tc_diag/compute_tc_diag.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,19 @@ def main():
land_filename = os.path.expandvars(args.land_file)
data_filename = os.path.expandvars(args.data_file)

# Validate inputs
if not os.path.isfile(config_filename):
print("Error: Input Config File (" + config_filename + ") does not exist!")
sys.exit(1)

if not os.path.isfile(land_filename):
print("Error: Input Land File (" + land_filename + ")does not exist!")
sys.exit(1)

if not os.path.isfile(data_filename):
print("Error: Input Data File (" + data_filename + ") does not exist!")
sys.exit(1)

# Print verbose arguments
if args.verbose:
print("Python Script:\t" + os.path.expandvars(sys.argv[0]))
Expand Down

0 comments on commit 908c069

Please sign in to comment.