From 861add26106b87d29566e50e1912ada5c09f7f8a Mon Sep 17 00:00:00 2001 From: chengzhuzhang Date: Fri, 31 Jan 2025 13:09:27 -0800 Subject: [PATCH 1/3] use ref_final_yr for model vs model --- zppy/defaults/default.ini | 2 -- zppy/e3sm_diags.py | 1 - zppy/templates/e3sm_diags.bash | 10 ++++------ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/zppy/defaults/default.ini b/zppy/defaults/default.ini index 74082efc..23f92bcf 100644 --- a/zppy/defaults/default.ini +++ b/zppy/defaults/default.ini @@ -171,8 +171,6 @@ output_format = string_list(default=list("png")) # See https://e3sm-project.github.io/e3sm_diags/_build/html/master/available-parameters.html output_format_subplot = string_list(default=list()) # End year (i.e., the last year to use) for the reference data -# Required for "tropical_subseasonal" runs -ref_end_yr = string(default="") # Final year (i.e., the last available year) for the reference data # Required for "qbo" runs # Required for run_type="model_vs_model" "enso_diags"/"streamflow"/"tc_analysis"/"tropical_subseasonal" runs diff --git a/zppy/e3sm_diags.py b/zppy/e3sm_diags.py index 2c77f5b9..6365121e 100644 --- a/zppy/e3sm_diags.py +++ b/zppy/e3sm_diags.py @@ -103,7 +103,6 @@ def e3sm_diags(config: ConfigObj, script_dir: str, existing_bundles, job_ids_fil def check_parameters_for_bash(c: Dict[str, Any]) -> None: # Check parameters that aren't used until e3sm_diags.bash is run - check_required_parameters(c, set(["tropical_subseasonal"]), "ref_end_yr") check_required_parameters(c, set(["qbo"]), "ref_final_yr") check_required_parameters(c, set(["enso_diags", "qbo"]), "ref_start_yr") check_required_parameters(c, set(["diurnal_cycle"]), "climo_diurnal_frequency") diff --git a/zppy/templates/e3sm_diags.bash b/zppy/templates/e3sm_diags.bash index 9d65985e..89541987 100644 --- a/zppy/templates/e3sm_diags.bash +++ b/zppy/templates/e3sm_diags.bash @@ -287,8 +287,8 @@ params.append(enso_param) trop_param = TropicalSubseasonalParameter() trop_param.test_data_path = '${ts_daily_dir}' trop_param.test_name = short_name -trop_param.test_start_yr = f'{start_yr:04}' -trop_param.test_end_yr = f'{end_yr:04}' +trop_param.test_start_yr = start_yr +trop_param.test_end_yr = end_yr {% if run_type == "model_vs_obs" %} # Obs trop_param.reference_data_path = '{{ obs_ts }}' @@ -298,10 +298,8 @@ trop_param.ref_end_yr = 2010 trop_param.reference_data_path = '${ts_daily_dir_ref}' trop_param.ref_name = '${ref_name}' trop_param.short_ref_name = '{{ short_ref_name }}' -ref_start_yr = {{ ref_start_yr }} -ref_end_yr = {{ ref_end_yr }} -trop_param.ref_start_yr = f'{ref_start_yr:04}' -trop_param.ref_end_yr = f'{ref_end_yr:04}' +trop_param.ref_start_yr = '{{ ref_start_yr }}' +trop_param.ref_end_yr = '{{ ref_final_yr }}' # Optionally, swap test and reference model if {{ swap_test_ref }}: trop_param.test_data_path, trop_param.reference_data_path = trop_param.reference_data_path, trop_param.test_data_path From adf453f42df4eea699321f8978d0a6eb262433fd Mon Sep 17 00:00:00 2001 From: chengzhuzhang Date: Fri, 31 Jan 2025 13:21:04 -0800 Subject: [PATCH 2/3] add ref_end_yr back in defualt.ini --- zppy/defaults/default.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/zppy/defaults/default.ini b/zppy/defaults/default.ini index 23f92bcf..d4f02b88 100644 --- a/zppy/defaults/default.ini +++ b/zppy/defaults/default.ini @@ -171,6 +171,7 @@ output_format = string_list(default=list("png")) # See https://e3sm-project.github.io/e3sm_diags/_build/html/master/available-parameters.html output_format_subplot = string_list(default=list()) # End year (i.e., the last year to use) for the reference data +ref_end_yr = string(default="") # Final year (i.e., the last available year) for the reference data # Required for "qbo" runs # Required for run_type="model_vs_model" "enso_diags"/"streamflow"/"tc_analysis"/"tropical_subseasonal" runs From 7dd8855f7548e33789cf92dbd554271eb52fbd4b Mon Sep 17 00:00:00 2001 From: Ryan Forsyth Date: Mon, 3 Feb 2025 18:42:32 -0600 Subject: [PATCH 3/3] Remove remaining ref_end_yr as zppy parameter --- .../generated/test_weekly_comprehensive_v2_chrysalis.cfg | 1 - .../generated/test_weekly_comprehensive_v3_chrysalis.cfg | 1 - tests/integration/template_weekly_comprehensive_v2.cfg | 1 - tests/integration/template_weekly_comprehensive_v3.cfg | 1 - tests/test_zppy_e3sm_diags.py | 7 ------- zppy/defaults/default.ini | 3 --- 6 files changed, 14 deletions(-) diff --git a/tests/integration/generated/test_weekly_comprehensive_v2_chrysalis.cfg b/tests/integration/generated/test_weekly_comprehensive_v2_chrysalis.cfg index 255eccb9..8e27d5e6 100644 --- a/tests/integration/generated/test_weekly_comprehensive_v2_chrysalis.cfg +++ b/tests/integration/generated/test_weekly_comprehensive_v2_chrysalis.cfg @@ -107,7 +107,6 @@ multiprocessing = True num_workers = 8 partition = "compute" qos = "regular" -ref_end_yr = 1981 ref_final_yr = 1981 ref_start_yr = 1980 ref_years = "1980-1981", diff --git a/tests/integration/generated/test_weekly_comprehensive_v3_chrysalis.cfg b/tests/integration/generated/test_weekly_comprehensive_v3_chrysalis.cfg index 58896b65..c3a3d1cf 100644 --- a/tests/integration/generated/test_weekly_comprehensive_v3_chrysalis.cfg +++ b/tests/integration/generated/test_weekly_comprehensive_v3_chrysalis.cfg @@ -115,7 +115,6 @@ multiprocessing = True num_workers = 8 partition = "compute" qos = "regular" -ref_end_yr = 1986 ref_final_yr = 1986 ref_start_yr = 1985 ref_years = "1985-1986", diff --git a/tests/integration/template_weekly_comprehensive_v2.cfg b/tests/integration/template_weekly_comprehensive_v2.cfg index ae157b19..0de56d5f 100644 --- a/tests/integration/template_weekly_comprehensive_v2.cfg +++ b/tests/integration/template_weekly_comprehensive_v2.cfg @@ -107,7 +107,6 @@ multiprocessing = True num_workers = 8 partition = "#expand partition_long#" qos = "#expand qos_long#" -ref_end_yr = 1981 ref_final_yr = 1981 ref_start_yr = 1980 ref_years = "1980-1981", diff --git a/tests/integration/template_weekly_comprehensive_v3.cfg b/tests/integration/template_weekly_comprehensive_v3.cfg index 07066558..38355bdb 100644 --- a/tests/integration/template_weekly_comprehensive_v3.cfg +++ b/tests/integration/template_weekly_comprehensive_v3.cfg @@ -115,7 +115,6 @@ multiprocessing = True num_workers = 8 partition = "#expand partition_long#" qos = "#expand qos_long#" -ref_end_yr = 1986 ref_final_yr = 1986 ref_start_yr = 1985 ref_years = "1985-1986", diff --git a/tests/test_zppy_e3sm_diags.py b/tests/test_zppy_e3sm_diags.py index 61216a86..f09d96eb 100644 --- a/tests/test_zppy_e3sm_diags.py +++ b/tests/test_zppy_e3sm_diags.py @@ -37,13 +37,6 @@ def test_check_parameters_for_bash(): with pytest.raises(ParameterNotProvidedError): check_parameters_for_bash(c) - # tropical_subseasonal - c = {"sets": ["tropical_subseasonal"], "ref_end_yr": "2000"} - check_parameters_for_bash(c) - c = {"sets": ["tropical_subseasonal"], "ref_end_yr": ""} - with pytest.raises(ParameterNotProvidedError): - check_parameters_for_bash(c) - def test_check_mvm_only_parameters_for_bash(): z0 = {"diff_title": "a", "ref_name": "b", "short_ref_name": "c"} diff --git a/zppy/defaults/default.ini b/zppy/defaults/default.ini index d4f02b88..f62a66d8 100644 --- a/zppy/defaults/default.ini +++ b/zppy/defaults/default.ini @@ -170,8 +170,6 @@ obs_ts = string(default="") output_format = string_list(default=list("png")) # See https://e3sm-project.github.io/e3sm_diags/_build/html/master/available-parameters.html output_format_subplot = string_list(default=list()) -# End year (i.e., the last year to use) for the reference data -ref_end_yr = string(default="") # Final year (i.e., the last available year) for the reference data # Required for "qbo" runs # Required for run_type="model_vs_model" "enso_diags"/"streamflow"/"tc_analysis"/"tropical_subseasonal" runs @@ -251,7 +249,6 @@ ts_daily_subsection = string(default="") obs_ts = string(default=None) output_format = string_list(default=None) output_format_subplot = string_list(default=None) - ref_end_yr = string(default=None) ref_final_yr = string(default=None) ref_name = string(default=None) ref_start_yr = string(default=None)