Skip to content

Commit

Permalink
Clean up print statements to align consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-richling committed Jan 31, 2025
1 parent da62dba commit db24470
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/adf_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def __init__(self, config_file, debug=False):
# $CASE.cam.h#.YYYY<other date info>.nc
base_climo_yrs = [int(str(i).partition(f"{base_hist_str}.")[2][0:4]) for i in file_list]
if not base_climo_yrs:
msg = f"No climo years found in {baseline_hist_locs}, "
msg = f"\t ERROR: No climo years found in {baseline_hist_locs}, "
raise AdfError(msg)

base_climo_yrs = sorted(np.unique(base_climo_yrs))
Expand All @@ -301,23 +301,23 @@ def __init__(self, config_file, debug=False):
#Check if start or end year is missing. If so then just assume it is the
#start or end of the entire available model data.
if syear_baseline is None:
msg = f"\t - No given start year for {data_name}, "
msg = f"\t WARNING: No given start year for {data_name}, "
msg += f"using first found year: {base_found_syr}"
print(msg)
syear_baseline = base_found_syr
if syear_baseline not in base_climo_yrs:
msg = f"\t - Given start year '{syear_baseline}' is not in current dataset "
msg = f"\t WARNING: Given start year '{syear_baseline}' is not in current dataset "
msg += f"{data_name}, using first found year: {base_climo_yrs[0]}"
print(msg)
syear_baseline = base_found_syr

if eyear_baseline is None:
msg = f"\t - No given end year for {data_name}, "
msg = f"\t WARNING: No given end year for {data_name}, "
msg += f"using last found year: {base_found_eyr}"
print(msg)
eyear_baseline = base_found_eyr
if eyear_baseline not in base_climo_yrs:
msg = f"\t - Given end year '{eyear_baseline}' is not in current dataset "
msg = f"\t WARNING: Given end year '{eyear_baseline}' is not in current dataset "
msg += f"{data_name}, using last found year: {base_climo_yrs[-1]}"
print(msg)
eyear_baseline = base_found_eyr
Expand Down

0 comments on commit db24470

Please sign in to comment.