diff --git a/tests/test_zppy_global_time_series.py b/tests/test_zppy_global_time_series.py index 86c2c834..6be322ce 100644 --- a/tests/test_zppy_global_time_series.py +++ b/tests/test_zppy_global_time_series.py @@ -9,7 +9,6 @@ def test_determine_components(): c: Dict[str, Any] # Test non-legacy c = { - "plot_names": "", "plots_original": "", "plots_atm": ["a"], "plots_ice": "", @@ -27,7 +26,6 @@ def test_determine_components(): assert c["plots_ocn"] == "None" c = { - "plot_names": "", "plots_original": "", "plots_atm": "", "plots_ice": ["a"], @@ -45,7 +43,6 @@ def test_determine_components(): assert c["plots_ocn"] == "None" c = { - "plot_names": "", "plots_original": "", "plots_atm": "", "plots_ice": "", @@ -63,7 +60,6 @@ def test_determine_components(): assert c["plots_ocn"] == "None" c = { - "plot_names": "", "plots_original": "", "plots_atm": "", "plots_ice": "", @@ -80,57 +76,6 @@ def test_determine_components(): assert c["plots_lnd"] == "None" assert c["plots_ocn"] == ["a"] - # Test legacy - base = {"plots_atm": "", "plots_ice": "", "plots_lnd": "", "plots_ocn": ""} - - c = { - "plot_names": ["a"], - "plots_original": "gets_overwritten", - "atmosphere_only": False, - } - c.update(base) - determine_components(c) - assert c["plots_original"] == ["a"] - assert c["use_atm"] == True - assert c["use_ice"] == False - assert c["use_lnd"] == False - assert c["use_ocn"] == False - assert c["plots_atm"] == "None" - assert c["plots_ice"] == "None" - assert c["plots_lnd"] == "None" - assert c["plots_ocn"] == "None" - - for ocn_set in ["change_ohc", "max_moc", "change_sea_level"]: - c = { - "plot_names": "", - "plots_original": [ocn_set], - "atmosphere_only": False, - } - c.update(base) - determine_components(c) - assert c["plots_original"] == [ocn_set] - assert c["use_atm"] == True - assert c["use_ice"] == False - assert c["use_lnd"] == False - assert c["use_ocn"] == True - assert c["plots_atm"] == "None" - assert c["plots_ice"] == "None" - assert c["plots_lnd"] == "None" - assert c["plots_ocn"] == "None" - - c = {"plot_names": "", "plots_original": ["a"], "atmosphere_only": True} - c.update(base) - determine_components(c) - assert c["plots_original"] == ["a"] - assert c["use_atm"] == True - assert c["use_ice"] == False - assert c["use_lnd"] == False - assert c["use_ocn"] == False - assert c["plots_atm"] == "None" - assert c["plots_ice"] == "None" - assert c["plots_lnd"] == "None" - assert c["plots_ocn"] == "None" - def test_determine_and_add_dependencies(): c: Dict[str, Any] diff --git a/zppy/defaults/default.ini b/zppy/defaults/default.ini index 25d2e834..d4c42a33 100644 --- a/zppy/defaults/default.ini +++ b/zppy/defaults/default.ini @@ -138,10 +138,6 @@ ts_subsection = string(default="") [tc_analysis] # NOTE: always overrides value in [default] input_files = string(default="eam.h2") -# TODO for v3.0.0: Remove this parameter -# DEPRECATED. No longer used. -# The scratch directory -scratch = string(default="") [e3sm_diags] # See https://e3sm-project.github.io/e3sm_diags/_build/html/master/available-parameters.html @@ -300,10 +296,6 @@ stream_ocn = string(default="streams.ocean") walltime = string(default="06:00:00") [global_time_series] -# TODO for v3.0.0: Remove this parameter -# Deprecated; kept for backwards compatibility -# Set to True to skip figures requiring ocean data; only affects original plots -atmosphere_only = boolean(default=False) climo_years = string_list(default=list("")) # The color to be used for the graphs. color = string(default="Blue") @@ -314,12 +306,6 @@ figstr = string(default="") # NOTE: always overrides value in [default] input_subdir = string(default="archive/ocn/hist") moc_file = string(default="") -# TODO for v3.0.0: Remove this parameter -# Deprecated; legacy name for plots_original; kept for backwards compatibility -# plots_original replaces it with the same default. -# So, if a cfg used the default value before, the behavior will remain the same. -# And if a cfg set plot_names explicitally, then global_time_series.py will override plots_original. -plot_names = string(default="") # The names of the plots you want displayed # Variable requirements: # net_toa_flux_restom requires RESTOM diff --git a/zppy/global_time_series.py b/zppy/global_time_series.py index 183de780..296f1ead 100644 --- a/zppy/global_time_series.py +++ b/zppy/global_time_series.py @@ -87,12 +87,6 @@ def global_time_series(config, script_dir, existing_bundles, job_ids_file): def determine_components(c: Dict[str, Any]) -> None: - # Handle legacy parameter - if c["plot_names"]: - logger.warning( - "warning: plot_names for global_time_series is deprecated. Setting plot_names will override the new parameter, plots_original." - ) - c["plots_original"] = c["plot_names"] # Determine which components are needed c["use_atm"] = False c["use_ice"] = False @@ -100,16 +94,12 @@ def determine_components(c: Dict[str, Any]) -> None: c["use_ocn"] = False if c["plots_original"]: c["use_atm"] = True - if c["atmosphere_only"]: - logger.warning( - "warning: atmosphere_only for global_time_series is deprecated. Preferred method: remove the 3 ocean plots (change_ohc,max_moc,change_sea_level) from plots_original." - ) has_original_ocn_plots = ( ("change_ohc" in c["plots_original"]) or ("max_moc" in c["plots_original"]) or ("change_sea_level" in c["plots_original"]) ) - if (not c["atmosphere_only"]) and has_original_ocn_plots: + if has_original_ocn_plots: c["use_ocn"] = True else: # For better string processing in global_time_series.bash diff --git a/zppy/templates/global_time_series.bash b/zppy/templates/global_time_series.bash index 4a3183eb..fed2209e 100644 --- a/zppy/templates/global_time_series.bash +++ b/zppy/templates/global_time_series.bash @@ -7,7 +7,7 @@ ################################################################################ results_dir={{ prefix }}_results -zi-global-time-series --use_ocn {{ use_ocn }} --input {{ input }} --input_subdir {{ input_subdir }} --moc_file {{ moc_file }} --case_dir {{ output }} --experiment_name {{ experiment_name }} --figstr {{ figstr }} --color {{ color }} --ts_num_years {{ ts_num_years }} --plots_original {{ plots_original }} --atmosphere_only {{ atmosphere_only }} --plots_atm {{ plots_atm }} --plots_ice {{ plots_ice }} --plots_lnd {{ plots_lnd }} --plots_ocn {{ plots_ocn }} --nrows 4 --ncols 2 --results_dir ${results_dir} --regions {{ regions }} --start_yr {{ year1 }} --end_yr {{ year2 }} +zi-global-time-series --use_ocn {{ use_ocn }} --input {{ input }} --input_subdir {{ input_subdir }} --moc_file {{ moc_file }} --case_dir {{ output }} --experiment_name {{ experiment_name }} --figstr {{ figstr }} --color {{ color }} --ts_num_years {{ ts_num_years }} --plots_original {{ plots_original }} --plots_atm {{ plots_atm }} --plots_ice {{ plots_ice }} --plots_lnd {{ plots_lnd }} --plots_ocn {{ plots_ocn }} --nrows 4 --ncols 2 --results_dir ${results_dir} --regions {{ regions }} --start_yr {{ year1 }} --end_yr {{ year2 }} echo 'Copy images to directory' results_dir_absolute_path={{ scriptDir }}/${results_dir}