From f3addc9006ae7c2335e70cc3f2ef6cf8d5ff8f67 Mon Sep 17 00:00:00 2001 From: Scott Collins Date: Thu, 2 Feb 2023 11:39:11 -0800 Subject: [PATCH] Made input_validation.check_input() a "public" function --- src/opera/util/input_validation.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/opera/util/input_validation.py b/src/opera/util/input_validation.py index 493000b9..f7428c52 100644 --- a/src/opera/util/input_validation.py +++ b/src/opera/util/input_validation.py @@ -14,9 +14,9 @@ from opera.util.error_codes import ErrorCode -def _check_input(input_object, logger, name, valid_extensions): +def check_input(input_object, logger, name, valid_extensions): """ - Called by _validate_inputs() to check individual files. + Validation checks for individual files. The input object is checked for existence and that it ends with a valid file extension. @@ -84,18 +84,18 @@ def validate_slc_s1_inputs(runconfig, logger, name): for key, value in input_file_group_dict.items(): if key == 'safe_file_path': for i in range(len(value)): - _check_input(value[i], logger, name, valid_extensions=('.zip',)) + check_input(value[i], logger, name, valid_extensions=('.zip',)) elif key == 'orbit_file_path': for i in range(len(value)): - _check_input(value[i], logger, name, valid_extensions=('.EOF',)) + check_input(value[i], logger, name, valid_extensions=('.EOF',)) elif key == 'dem_file': - _check_input(value, logger, name, valid_extensions=('.tif', '.tiff', '.vrt')) + check_input(value, logger, name, valid_extensions=('.tif', '.tiff', '.vrt')) elif key in ('burst_id', 'dem_description'): # these fields are included in the SAS input paths, but are not # actually file paths, so skip them continue elif key == 'burst_database_file': - _check_input(value, logger, name, valid_extensions=('.sqlite3',)) + check_input(value, logger, name, valid_extensions=('.sqlite3',)) else: error_msg = f"Unexpected input: {key}: {value}" logger.critical(name, ErrorCode.INVALID_INPUT, error_msg)