Skip to content

Commit

Permalink
more robust ensemble check
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolong0728 committed Sep 19, 2024
1 parent 7103664 commit bb4dd38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ensembles/cruel_summer/src/utils/utils_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def check_model_conditions(PATH_GENERATED, config):
- bool: True if all conditions are met, False otherwise.
"""
log_file_path = Path(PATH_GENERATED) / f"{config['run_type']}_log.txt"
log_data = read_log_file(log_file_path)
try:
log_data = read_log_file(log_file_path)
except Exception as e:
logger.error(f"Error reading log file: {e}")
return False

current_time = datetime.now()
current_year = current_time.year
Expand Down
6 changes: 5 additions & 1 deletion ensembles/white_mustang/src/utils/utils_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def check_model_conditions(PATH_GENERATED, config):
- bool: True if all conditions are met, False otherwise.
"""
log_file_path = Path(PATH_GENERATED) / f"{config['run_type']}_log.txt"
log_data = read_log_file(log_file_path)
try:
log_data = read_log_file(log_file_path)
except Exception as e:
logger.error(f"Error reading log file: {e}")
return False

current_time = datetime.now()
current_year = current_time.year
Expand Down

0 comments on commit bb4dd38

Please sign in to comment.