From 20843ba17b813458f5b8e85ff050d89a857716e2 Mon Sep 17 00:00:00 2001 From: Andy Aschwanden Date: Tue, 26 Nov 2024 13:08:10 -0500 Subject: [PATCH] fixed empty string print --- calibration/calibrate.py | 2 +- hindcasts/hindcast.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/calibration/calibrate.py b/calibration/calibrate.py index 819290d..29c8250 100755 --- a/calibration/calibrate.py +++ b/calibration/calibrate.py @@ -728,7 +728,7 @@ def create_offset_file(file_name: str, delta_T: float = 0.0, frac_P: float = 1.0 print("\nChecking input files") print("------------------------------------------------------------") for key, m_f in all_params_dict.items(): - if key.split(".")[-1] == "file": + if key.split(".")[-1] == "file" and m_f is not None: m_f_abs = m_f.replace("$data_dir", options.data_dir) print(f" - {m_f_abs}: {os.path.isfile(m_f_abs)}") print("------------------------------------------------------------\n") diff --git a/hindcasts/hindcast.py b/hindcasts/hindcast.py index a97d7e8..ba554a1 100755 --- a/hindcasts/hindcast.py +++ b/hindcasts/hindcast.py @@ -713,7 +713,7 @@ def create_offset_file(file_name: str, delta_T: float = 0.0, frac_P: float = 1.0 print("\nChecking input files") print("------------------------------------------------------------") for key, m_f in all_params_dict.items(): - if key.split(".")[-1] == "file": + if key.split(".")[-1] == "file" and m_f is not None: m_f_abs = m_f.replace("$data_dir", options.data_dir) print(f" - {m_f_abs}: {os.path.isfile(m_f_abs)}") print("------------------------------------------------------------\n")