From b7398b83e37f5472c869f49111b69b556fd965fb Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Tue, 23 May 2023 16:34:36 -0400 Subject: [PATCH 1/5] Remove references to gcpy_test and GCHP is_pre_13.1 benchmark/1mo_benchmark.yml benchmark/1yr_ch4_benchmark.yml benchmark/1yr_fullchem_benchmark.yml benchmark/1yr_tt_benchmark.yml - main_dir is now a placeholder path instead of path to gcpy_test_data - Added comments telling the user to edit paths as needed - Removed is_pre_13.1 tags from GCHP_ref and GCHP_dev entries benchmark/modules/run_1yr_fullchem_benchmark.py benchmark/modules/run_1yr/tt_benchmark.py benchmark/run_benchmark.py - Remove code resetting timestamps for GCHP versions prior to 13.1 - Remove gchp_is_pre_13_1 arguments from get_filepath and get_filepaths gcpy/util.py - Removed gchp_is_pre_13_1 arguments from get_filepath, get_filepaths Signed-off-by: Bob Yantosca --- CHANGELOG.md | 4 + benchmark/1mo_benchmark.yml | 6 +- benchmark/1yr_ch4_benchmark.yml | 6 +- benchmark/1yr_fullchem_benchmark.yml | 6 +- benchmark/1yr_tt_benchmark.yml | 6 +- .../modules/run_1yr_fullchem_benchmark.py | 123 +++++------------- benchmark/modules/run_1yr_tt_benchmark.py | 62 ++------- benchmark/run_benchmark.py | 107 ++++----------- gcpy/util.py | 29 +---- 9 files changed, 85 insertions(+), 264 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a27d7116..d2458712 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - The GitHub PR template is now named `./github/PULL_REQUEST_TEMPLATE.md` - Updated badge links in `README.md` +### Removed +- Removed `gchp_is_pre_13_1` arguments & code from benchmarking routines +- Removed `is_pre_13_1` tags from `*_benchmark.yml` config files + ### Fixed - Generalized test for GCHP or GCClassic restart file in `regrid_restart_file.py` diff --git a/benchmark/1mo_benchmark.yml b/benchmark/1mo_benchmark.yml index 3a15f591..1d9be204 100644 --- a/benchmark/1mo_benchmark.yml +++ b/benchmark/1mo_benchmark.yml @@ -22,8 +22,8 @@ # species_database.yml in one of the Dev rundirs. # paths: - main_dir: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/geos-chem/validation/gcpy_test_data/1mon - results_dir: /path/to/BenchmarkResults + main_dir: /path/to/benchmark/main/dir # EDIT AS NEEDED + results_dir: /path/to/BenchmarkResults # EDIT AS NEEDED weights_dir: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/gcdata/ExtData/GCHP/RegriddingWeights spcdb_dir: default # @@ -52,7 +52,6 @@ data: restarts_subdir: Restarts bmk_start: "2019-07-01T00:00:00" bmk_end: "2019-08-01T00:00:00" - is_pre_13.1: False is_pre_14.0: False resolution: c24 dev: @@ -70,7 +69,6 @@ data: restarts_subdir: Restarts bmk_start: "2019-07-01T00:00:00" bmk_end: "2019-08-01T00:00:00" - is_pre_13.1: False is_pre_14.0: False resolution: c24 # diff --git a/benchmark/1yr_ch4_benchmark.yml b/benchmark/1yr_ch4_benchmark.yml index a83ba5e2..c00c0d23 100644 --- a/benchmark/1yr_ch4_benchmark.yml +++ b/benchmark/1yr_ch4_benchmark.yml @@ -22,8 +22,8 @@ # species_database.yml in one of the Dev rundirs. # paths: - main_dir: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/geos-chem/validation/gcpy_test_data/1yr_fullchem - results_dir: /path/to/BenchmarkResults + main_dir: /path/to/benchmark/main/dir # EDIT AS NEEDED + results_dir: /path/to/BenchmarkResults # EDIT AS NEEDED weights_dir: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/data/ExtData/GCHP/RegriddingWeights spcdb_dir: default # @@ -52,7 +52,6 @@ data: restarts_subdir: Restarts bmk_start: "2019-01-01T00:00:00" bmk_end: "2020-01-01T00:00:00" - is_pre_13.1: False # for gcpy_test_data, edit if needed is_pre_14.0: False # for gcpy_test_data, edit if needed resolution: c24 # for gcpy_test_data, edit if needed dev: @@ -70,7 +69,6 @@ data: restarts_subdir: Restarts bmk_start: "2019-01-01T00:00:00" bmk_end: "2020-01-01T00:00:00" - is_pre_13.1: False # for gcpy_test_data, edit if needed is_pre_14.0: False # for gcpy_test_data, edit if needed resolution: c24 # for gcpy_test_data, edit if needed # diff --git a/benchmark/1yr_fullchem_benchmark.yml b/benchmark/1yr_fullchem_benchmark.yml index 747a0226..8b65c03f 100644 --- a/benchmark/1yr_fullchem_benchmark.yml +++ b/benchmark/1yr_fullchem_benchmark.yml @@ -22,8 +22,8 @@ # species_database.yml in one of the Dev rundirs. # paths: - main_dir: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/geos-chem/validation/gcpy_test_data/1yr_fullchem - results_dir: /path/to/BenchmarkResults + main_dir: /path/to/benchmark/main/dir # EDIT AS NEEDED + results_dir: /path/to/BenchmarkResults # EDIT AS NEEDED weights_dir: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/data/ExtData/GCHP/RegriddingWeights spcdb_dir: default # @@ -52,7 +52,6 @@ data: restarts_subdir: Restarts bmk_start: "2019-01-01T00:00:00" bmk_end: "2020-01-01T00:00:00" - is_pre_13.1: False # for gcpy_test_data, edit if needed is_pre_14.0: True # for gcpy_test_data, edit if needed resolution: c48 # for gcpy_test_data, edit if needed dev: @@ -70,7 +69,6 @@ data: restarts_subdir: Restarts bmk_start: "2019-01-01T00:00:00" bmk_end: "2020-01-01T00:00:00" - is_pre_13.1: False # for gcpy_test_data, edit if needed is_pre_14.0: False # for gcpy_test_data, edit if needed resolution: c24 # for gcpy_test_data, edit if needed # diff --git a/benchmark/1yr_tt_benchmark.yml b/benchmark/1yr_tt_benchmark.yml index d4b2f4ef..ad6d9997 100644 --- a/benchmark/1yr_tt_benchmark.yml +++ b/benchmark/1yr_tt_benchmark.yml @@ -22,8 +22,8 @@ # species_database.yml in one of the Dev rundirs. # paths: - main_dir: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/geos-chem/validation/gcpy_test_data/1yr_transporttracer - results_dir: /path/to/BenchmarkResults + main_dir: /path/to/benchmark/main/dir # EDIT AS NEEDED + results_dir: /path/to/BenchmarkResults # EDIT AS NEEDED weights_dir: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/data/ExtData/GCHP/RegriddingWeights spcdb_dir: default # @@ -52,7 +52,6 @@ data: restarts_subdir: Restarts bmk_start: "2019-01-01T00:00:00" bmk_end: "2020-01-01T00:00:00" - is_pre_13.1: True # for gcpy_test_data, edit if needed is_pre_14.0: True # for gcpy_test_data, edit if needed resolution: c48 # for gcpy_test_data, edit if needed dev: @@ -70,7 +69,6 @@ data: restarts_subdir: Restarts bmk_start: "2019-01-01T00:00:00" bmk_end: "2020-01-01T00:00:00" - is_pre_13.1: True # for gcpy_test_data, edit if needed is_pre_14.0: True # for gcpy_test_data, edit if needed resolution: c48 # for gcpy_test_data, edit if needed # diff --git a/benchmark/modules/run_1yr_fullchem_benchmark.py b/benchmark/modules/run_1yr_fullchem_benchmark.py index c74eb4b2..a527fc92 100755 --- a/benchmark/modules/run_1yr_fullchem_benchmark.py +++ b/benchmark/modules/run_1yr_fullchem_benchmark.py @@ -268,15 +268,6 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): ) all_months_gchp_ref = all_months_ref - # Reset all months datetime array if GCHP ref is legacy filename format. - # Legacy format uses time-averaging period mid-point not start. - if config["data"]["ref"]["gchp"]["is_pre_13.1"]: - all_months_gchp_ref = np.zeros(12, dtype="datetime64[h]") - for t in range(12): - middle_hr = int(days_per_month_ref[t] * 24 / 2) - delta = np.timedelta64(middle_hr, "h") - all_months_gchp_ref[t] = all_months_ref[t].astype("datetime64[h]") + delta - # Get subset of month datetimes and seconds per month for only benchmark months bmk_mons_ref = all_months_ref[bmk_mon_inds] bmk_mons_gchp_ref = all_months_gchp_ref[bmk_mon_inds] @@ -304,15 +295,6 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): ) all_months_gchp_dev = all_months_dev - # Reset all months datetime array if GCHP dev is legacy filename format. - # Legacy format uses time-averaging period mid-point not start. - if config["data"]["dev"]["gchp"]["is_pre_13.1"]: - all_months_gchp_dev = np.zeros(12, dtype="datetime64[h]") - for t in range(12): - middle_hr = int(days_per_month_dev[t] * 24 / 2) - delta = np.timedelta64(middle_hr, "h") - all_months_gchp_dev[t] = all_months_dev[t].astype("datetime64[h]") + delta - # Get subset of month datetimes and seconds per month for only benchmark months bmk_mons_dev = all_months_dev[bmk_mon_inds] bmk_mons_gchp_dev = all_months_gchp_dev[bmk_mon_inds] @@ -848,7 +830,6 @@ def gcc_vs_gcc_ops_budg(m): "StateMet", all_months_gchp_dev, is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] )[0] # Get GCHP grid resolution from met collection file @@ -875,9 +856,7 @@ def gcc_vs_gcc_ops_budg(m): gchp_vs_gcc_devdir, "SpeciesConc", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"][ - "is_pre_13.1"], + is_gchp=True )[0] # Create plots @@ -943,8 +922,7 @@ def gcc_vs_gcc_ops_budg(m): gchp_vs_gcc_devdir, "Emissions", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create plots @@ -1008,8 +986,7 @@ def gcc_vs_gcc_ops_budg(m): gchp_vs_gcc_devdir, "Emissions", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create emissions table that spans entire year @@ -1047,8 +1024,7 @@ def gcc_vs_gcc_ops_budg(m): gchp_vs_gcc_devdir, "JValues", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create plots @@ -1106,9 +1082,7 @@ def gcc_vs_gcc_ops_budg(m): gchp_vs_gcc_devdir, "Aerosols", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"][ - "is_pre_13.1"], + is_gchp=True )[0] # Create plots @@ -1169,8 +1143,6 @@ def gchp_vs_gcc_mass_table(m): bmk_mons_dev[m], is_gchp=True, gchp_res=config["data"]["dev"]["gchp"]["resolution"], - gchp_is_pre_13_1=config["data"]["dev"]["gchp"][ - "is_pre_13.1"], gchp_is_pre_14_0=config["data"]["dev"]["gchp"][ "is_pre_14.0"] ) @@ -1183,8 +1155,6 @@ def gchp_vs_gcc_mass_table(m): bmk_end_dev, is_gchp=True, gchp_res=config["data"]["dev"]["gchp"]["resolution"], - gchp_is_pre_13_1=config["data"]["dev"]["gchp"][ - "is_pre_13.1"], gchp_is_pre_14_0=config["data"]["dev"]["gchp"][ "is_pre_14.0"] ) @@ -1228,9 +1198,7 @@ def gchp_vs_gcc_ops_budg(m): gchp_vs_gcc_devdir, "Budget", bmk_mons_gchp_dev[m], - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"][ - "is_pre_13.1"] + is_gchp=True ) # Create tables @@ -1269,15 +1237,13 @@ def gchp_vs_gcc_ops_budg(m): gchp_vs_gcc_devdir, "Aerosols", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] devspc = get_filepaths( gchp_vs_gcc_devdir, "SpeciesConc", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create tables @@ -1342,8 +1308,7 @@ def gchp_vs_gcc_ops_budg(m): gchp_vs_gcc_devdir, "Metrics", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create table @@ -1375,15 +1340,13 @@ def gchp_vs_gcc_ops_budg(m): gchp_vs_gchp_refdir, "StateMet", all_months_gchp_ref, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] devmet = get_filepaths( gchp_vs_gcc_devdir, "StateMet", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Get GCHP grid resolutions from met collection file @@ -1411,15 +1374,13 @@ def gchp_vs_gcc_ops_budg(m): gchp_vs_gchp_refdir, "SpeciesConc", all_months_gchp_ref, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] dev = get_filepaths( gchp_vs_gchp_devdir, "SpeciesConc", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create plots @@ -1484,15 +1445,13 @@ def gchp_vs_gcc_ops_budg(m): gchp_vs_gchp_refdir, "Emissions", all_months_gchp_ref, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] dev = get_filepaths( gchp_vs_gchp_devdir, "Emissions", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create plots @@ -1553,15 +1512,13 @@ def gchp_vs_gcc_ops_budg(m): gchp_vs_gchp_refdir, "Emissions", all_months_gchp_ref, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] dev = get_filepaths( gchp_vs_gchp_devdir, "Emissions", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create table @@ -1595,15 +1552,13 @@ def gchp_vs_gcc_ops_budg(m): gchp_vs_gchp_refdir, "JValues", all_months_gchp_ref, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] dev = get_filepaths( gchp_vs_gchp_devdir, "JValues", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create plots @@ -1658,15 +1613,13 @@ def gchp_vs_gcc_ops_budg(m): gchp_vs_gchp_refdir, "Aerosols", all_months_gchp_ref, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] dev = get_filepaths( gchp_vs_gchp_devdir, "Aerosols", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create plots @@ -1724,8 +1677,6 @@ def gchp_vs_gchp_mass_table(m): bmk_mons_ref[m], is_gchp=True, gchp_res=config["data"]["ref"]["gchp"]["resolution"], - gchp_is_pre_13_1=config["data"]["ref"]["gchp"][ - "is_pre_13.1"], gchp_is_pre_14_0=config["data"]["ref"]["gchp"][ "is_pre_14.0"] ) @@ -1737,8 +1688,6 @@ def gchp_vs_gchp_mass_table(m): bmk_mons_dev[m], is_gchp=True, gchp_res=config["data"]["dev"]["gchp"]["resolution"], - gchp_is_pre_13_1=config["data"]["dev"]["gchp"][ - "is_pre_13.1"], gchp_is_pre_14_0=config["data"]["dev"]["gchp"][ "is_pre_14.0"] ) @@ -1751,8 +1700,6 @@ def gchp_vs_gchp_mass_table(m): bmk_end_ref, is_gchp=True, gchp_res=config["data"]["dev"]["gchp"]["resolution"], - gchp_is_pre_13_1=config["data"]["dev"]["gchp"][ - "is_pre_13.1"], gchp_is_pre_14_0=config["data"]["dev"]["gchp"][ "is_pre_14.0"] ) @@ -1762,8 +1709,6 @@ def gchp_vs_gchp_mass_table(m): bmk_end_dev, is_gchp=True, gchp_res=config["data"]["dev"]["gchp"]["resolution"], - gchp_is_pre_13_1=config["data"]["dev"]["gchp"][ - "is_pre_13.1"], gchp_is_pre_14_0=config["data"]["dev"]["gchp"][ "is_pre_14.0"] ) @@ -1805,17 +1750,13 @@ def gchp_vs_gchp_ops_budg(m): gchp_vs_gchp_refdir, "Budget", bmk_mons_gchp_ref[m], - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"][ - "is_pre_13.1"], + is_gchp=True ) devpath = get_filepath( gchp_vs_gchp_devdir, "Budget", bmk_mons_gchp_dev[m], - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"][ - "is_pre_13.1"], + is_gchp=True ) # Compute tables @@ -1855,15 +1796,13 @@ def gchp_vs_gchp_ops_budg(m): gchp_vs_gchp_devdir, "Aerosols", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] devspc = get_filepaths( gchp_vs_gchp_devdir, "SpeciesConc", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create tables @@ -1912,15 +1851,13 @@ def gchp_vs_gchp_ops_budg(m): gchp_vs_gchp_refdir, "Metrics", all_months_gchp_ref, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] dev = get_filepaths( gchp_vs_gchp_devdir, "Metrics", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create the OH Metrics table @@ -1968,15 +1905,13 @@ def gchp_vs_gchp_ops_budg(m): gchp_vs_gchp_refdir, "SpeciesConc", all_months_gchp_ref, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] gchp_dev = get_filepaths( gchp_vs_gchp_devdir, "SpeciesConc", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create plots diff --git a/benchmark/modules/run_1yr_tt_benchmark.py b/benchmark/modules/run_1yr_tt_benchmark.py index 87f4be79..ff1dfc60 100755 --- a/benchmark/modules/run_1yr_tt_benchmark.py +++ b/benchmark/modules/run_1yr_tt_benchmark.py @@ -237,16 +237,6 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): days_in_mon = monthrange(int(bmk_year_ref), t + 1)[1] sec_per_yr_ref += days_in_mon * 86400.0 - # Overwrite all_months_gchp_ref if GCHP ref is legacy filename format. - # Legacy format uses time-averaging period mid-point not start. - if config["data"]["ref"]["gchp"]["is_pre_13.1"]: - all_months_gchp_ref = np.zeros(12, dtype="datetime64[h]") - for t in range(12): - days_in_mon = monthrange(int(bmk_year_ref), t + 1)[1] - middle_hr = int(days_in_mon * 24 / 2) - delta = np.timedelta64(middle_hr, "h") - all_months_gchp_ref[t] = all_months_ref[t].astype("datetime64[h]") + delta - # ====================================================================== # Dates and times -- Dev data # ====================================================================== @@ -271,17 +261,6 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): days_in_mon = monthrange(int(bmk_year_dev), t + 1)[1] sec_per_yr_dev += days_in_mon * 86400.0 - # Overwrite all_months_gchp_ref if GCHP ref is legacy filename format. - # Legacy format uses time-averaging period mid-point not start. - if config["data"]["dev"]["gchp"]["is_pre_13.1"]: - sec_per_yr_dev = 0 - all_months_gchp_dev = np.zeros(12, dtype="datetime64[h]") - for t in range(12): - days_in_mon = monthrange(int(bmk_year_dev), t + 1)[1] - middle_hr = int(days_in_mon * 24 / 2) - delta = np.timedelta64(middle_hr, "h") - all_months_gchp_dev[t] = all_months_dev[t].astype("datetime64[h]") + delta - # ======================================================================= # Print the list of plots & tables to the screen # ======================================================================= @@ -559,8 +538,7 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): gchp_vs_gcc_devdir, "StateMet", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True )[0] # ================================================================== @@ -587,8 +565,7 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): gchp_vs_gcc_devdir, collection, all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Create plots @@ -658,9 +635,7 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): gchp_vs_gcc_devdir, collection, all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"][ - "is_pre_13.1"], + is_gchp=True )[0] # Create plots @@ -738,8 +713,7 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): gchp_vs_gcc_devdir, collection, all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Make operations budget table @@ -779,15 +753,13 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): gchp_vs_gchp_refdir, "StateMet", all_months_gchp_ref, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] devmet = get_filepaths( gchp_vs_gchp_devdir, "StateMet", all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # ================================================================== @@ -809,15 +781,13 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): gchp_vs_gchp_refdir, collection, all_months_gchp_ref, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] dev = get_filepaths( gchp_vs_gchp_devdir, collection, all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"] + is_gchp=True )[0] # Make concentration plots @@ -884,17 +854,13 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): gchp_vs_gchp_refdir, collection, all_months_gchp_ref, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"][ - "is_pre_13.1"], + is_gchp=True )[0] dev = get_filepaths( gchp_vs_gchp_devdir, collection, all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"][ - "is_pre_13.1"], + is_gchp=True )[0] # Create plots @@ -970,15 +936,13 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): gchp_vs_gchp_refdir, col, all_months_gchp_ref, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"], + is_gchp=True )[0] devs = get_filepaths( gchp_vs_gchp_devdir, col, all_months_gchp_dev, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True )[0] # Create table @@ -1054,7 +1018,6 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): all_months_dev, is_gchp=True, gchp_res=config["data"]["dev"]["gchp"]["resolution"], - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], gchp_is_pre_14_0=config["data"]["dev"]["gchp"]["is_pre_14.0"], )[0] @@ -1068,7 +1031,6 @@ def run_benchmark(config, bmk_year_ref, bmk_year_dev): bmk_end_dev, is_gchp=True, gchp_res=config["data"]["dev"]["gchp"]["resolution"], - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], gchp_is_pre_14_0=config["data"]["dev"]["gchp"]["is_pre_14.0"], ) diff --git a/benchmark/run_benchmark.py b/benchmark/run_benchmark.py index ec6a52be..e084ec40 100755 --- a/benchmark/run_benchmark.py +++ b/benchmark/run_benchmark.py @@ -318,16 +318,6 @@ def run_benchmark_default(config): gcc_end_ref_date = np.datetime64(config["data"]["ref"]["gcc"]["bmk_end"]) gchp_end_ref_date = np.datetime64(config["data"]["ref"]["gchp"]["bmk_end"]) - # TODO: remove is_pre_13.1 option with 14.0 release - if config["data"]["ref"]["gchp"]["is_pre_13.1"]: - if add_months(gchp_ref_date, 1) == gchp_end_ref_date: - gchp_ref_date = np.datetime( - config["data"]["ref"]["gchp"]["bmk_start"][0:8] + "16T12:00:00" - ) - else: - print("Error: `is_pre_13.1: True` option only supported for exactly 1 month and 1 year benchmarks") - sys.exit() - # Dev start used in diagnostic filename gcc_dev_date = np.datetime64(config["data"]["dev"]["gcc"]["bmk_start"]) gchp_dev_date = np.datetime64(config["data"]["dev"]["gchp"]["bmk_start"]) @@ -335,29 +325,12 @@ def run_benchmark_default(config): gcc_end_dev_date = np.datetime64(config["data"]["dev"]["gcc"]["bmk_end"]) gchp_end_dev_date = np.datetime64(config["data"]["dev"]["gchp"]["bmk_end"]) - # TODO: remove is_pre_13.1 option with 14.0 release - if config["data"]["dev"]["gchp"]["is_pre_13.1"]: - if add_months(gchp_dev_date, 1) == gchp_end_dev_date: - gchp_dev_date = np.datetime( - config["data"]["dev"]["gchp"]["bmk_start"][0:8] + "16T12:00:00" - ) - else: - print("Error: `is_pre_13.1: True` option only supported for exactly 1 month and 1 year benchmarks") - sys.exit() - - # Seconds per month gcc_ref_sec_diff = (gcc_end_ref_date - gcc_ref_date).astype("float64") gchp_ref_sec_diff = (gchp_end_ref_date - gchp_ref_date).astype("float64") gcc_dev_sec_diff = (gcc_end_dev_date - gcc_dev_date).astype("float64") gchp_dev_sec_diff = (gchp_end_dev_date - gchp_dev_date).astype("float64") - # Double gchp sec/month if mid-point timestamp in filename (legacy format) - if config["data"]["ref"]["gchp"]["is_pre_13.1"]: - gchp_ref_sec_diff = gchp_ref_sec_diff * 2 - if config["data"]["dev"]["gchp"]["is_pre_13.1"]: - gchp_dev_sec_diff = gchp_dev_sec_diff * 2 - # ====================================================================== # Significant difference filenames # ====================================================================== @@ -757,8 +730,7 @@ def run_benchmark_default(config): gchp_vs_gcc_devdir, "StateMet", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Get GCHP grid resolution from met collection file @@ -777,8 +749,7 @@ def run_benchmark_default(config): gchp_vs_gcc_devdir, "SpeciesConc", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create plots @@ -811,8 +782,7 @@ def run_benchmark_default(config): gchp_vs_gcc_devdir, "Emissions", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create emissions plots @@ -847,8 +817,7 @@ def run_benchmark_default(config): gchp_vs_gcc_devdir, "Emissions", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create plots @@ -878,8 +847,7 @@ def run_benchmark_default(config): gchp_vs_gcc_devdir, "JValues", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create plots @@ -907,8 +875,7 @@ def run_benchmark_default(config): gchp_vs_gcc_devdir, "Aerosols", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create plots @@ -940,7 +907,7 @@ def run_benchmark_default(config): gchp_vs_gcc_devrst, "Restart", gchp_end_dev_date, - is_gchp=True, + is_gchp=True gchp_res=config["data"]["dev"]["gchp"]["resolution"], gchp_is_pre_14_0=config["data"]["dev"]["gchp"]["is_pre_14.0"] ) @@ -968,8 +935,7 @@ def run_benchmark_default(config): gchp_vs_gcc_devdir, "Budget", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create plots @@ -1005,8 +971,7 @@ def run_benchmark_default(config): gchp_vs_gcc_devdir, "Metrics", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create table @@ -1099,15 +1064,13 @@ def run_benchmark_default(config): gchp_vs_gchp_refdir, "StateMet", gchp_ref_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"], + is_gchp=True ) devmet = get_filepath( gchp_vs_gchp_devdir, "StateMet", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Get GCHP grid resolutions from met collection file @@ -1127,15 +1090,13 @@ def run_benchmark_default(config): gchp_vs_gchp_refdir, "SpeciesConc", gchp_ref_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"], + is_gchp=True ) dev = get_filepath( gchp_vs_gchp_devdir, "SpeciesConc", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create plots @@ -1167,15 +1128,13 @@ def run_benchmark_default(config): gchp_vs_gchp_refdir, "Emissions", gchp_ref_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"], + is_gchp=True ) dev = get_filepath( gchp_vs_gchp_devdir, "Emissions", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create plots @@ -1207,15 +1166,13 @@ def run_benchmark_default(config): gchp_vs_gchp_refdir, "Emissions", gchp_ref_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"], + is_gchp=True ) dev = get_filepath( gchp_vs_gchp_devdir, "Emissions", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create tables @@ -1245,15 +1202,13 @@ def run_benchmark_default(config): gchp_vs_gchp_refdir, "JValues", gchp_ref_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"], + is_gchp=True ) dev = get_filepath( gchp_vs_gchp_devdir, "JValues", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create plots @@ -1280,15 +1235,13 @@ def run_benchmark_default(config): gchp_vs_gchp_refdir, "Aerosols", gchp_ref_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"], + is_gchp=True ) dev = get_filepath( gchp_vs_gchp_devdir, "Aerosols", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create plots @@ -1350,15 +1303,13 @@ def run_benchmark_default(config): gchp_vs_gchp_refdir, "Budget", gchp_ref_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"], + is_gchp=True ) dev = get_filepath( gchp_vs_gchp_devdir, "Budget", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create tables @@ -1393,15 +1344,13 @@ def run_benchmark_default(config): gchp_vs_gchp_refdir, "Metrics", gchp_ref_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"], + is_gchp=True ) dev = get_filepath( gchp_vs_gchp_devdir, "Metrics", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create table @@ -1468,15 +1417,13 @@ def run_benchmark_default(config): gchp_vs_gchp_refdir, "SpeciesConc", gchp_ref_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["ref"]["gchp"]["is_pre_13.1"], + is_gchp=True ) gchp_dev = get_filepath( gchp_vs_gchp_devdir, "SpeciesConc", gchp_dev_date, - is_gchp=True, - gchp_is_pre_13_1=config["data"]["dev"]["gchp"]["is_pre_13.1"], + is_gchp=True ) # Create diff-of-diff plots for species concentrations diff --git a/gcpy/util.py b/gcpy/util.py index 13e44e64..5df95948 100644 --- a/gcpy/util.py +++ b/gcpy/util.py @@ -1690,7 +1690,6 @@ def get_filepath( date, is_gchp=False, gchp_res="c00", - gchp_is_pre_13_1=False, gchp_is_pre_14_0=False ): """ @@ -1716,10 +1715,6 @@ def get_filepath( Only needed for restart files. Default value: "c00". - gchp_is_pre_13_1: bool - Set this switch to True to obtain GCHP file pathnames used in - versions before 13.1. Only needed for diagnostic files. - gchp_is_pre_14_0: bool Set this switch to True to obtain GCHP file pathnames used in versions before 14.0. Only needed for restart files. @@ -1749,10 +1744,7 @@ def get_filepath( "GEOSChem.Restart." ) else: - if gchp_is_pre_13_1: - file_tmpl = os.path.join(datadir, f"GCHP.{col}.") - else: - file_tmpl = os.path.join(datadir, f"GEOSChem.{col}.") + file_tmpl = os.path.join(datadir, f"GEOSChem.{col}.") else: if "Emissions" in col: file_tmpl = os.path.join(datadir, "HEMCO_diagnostics.") @@ -1782,7 +1774,6 @@ def get_filepaths( dates, is_gchp=False, gchp_res="c00", - gchp_is_pre_13_1=False, gchp_is_pre_14_0=False ): """ @@ -1808,10 +1799,6 @@ def get_filepaths( Only needed for restart files. Default value: "c00". - gchp_is_pre_13_1: bool - Set this switch to True to obtain GCHP file pathnames used in - versions before 13.1. Only needed for diagnostic files. - gchp_is_pre_14_0: bool Set this switch to True to obtain GCHP file pathnames used in versions before 14.0. Only needed for diagnostic files. @@ -1859,16 +1846,10 @@ def get_filepaths( "GEOSChem.Restart." ) else: - if gchp_is_pre_13_1: - file_tmpl = os.path.join( - datadir, - f"GCHP.{collection}." - ) - else: - file_tmpl = os.path.join( - datadir, - f"GEOSChem.{collection}." - ) + file_tmpl = os.path.join( + datadir, + f"GEOSChem.{collection}." + ) else: # --------------------------------------- # Get the file path template for GCC From 522f1248ce493167c5a3385098edf5a36edcc1b1 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Tue, 23 May 2023 16:51:34 -0400 Subject: [PATCH 2/5] Remove if block that sets gcpy_test paths for benchmark results benchmark/run_benchmark.py - Removed the if block that assigns the results directories based on whether gcpy_test was selected or not. - Removed comments about gcpy_test in header - Updated version to 1.4.0 in header comments benchmark/modules/run_*_benchmark.py - Removed comments about gcpy_test - Updated version to 1.4.0 in header comments Signed-off-by: Bob Yantosca --- .../modules/run_1yr_fullchem_benchmark.py | 8 +- benchmark/modules/run_1yr_tt_benchmark.py | 8 +- benchmark/run_benchmark.py | 145 +++++++----------- 3 files changed, 61 insertions(+), 100 deletions(-) diff --git a/benchmark/modules/run_1yr_fullchem_benchmark.py b/benchmark/modules/run_1yr_fullchem_benchmark.py index a527fc92..3aad3385 100755 --- a/benchmark/modules/run_1yr_fullchem_benchmark.py +++ b/benchmark/modules/run_1yr_fullchem_benchmark.py @@ -25,11 +25,7 @@ (3) Make sure the /path/to/gcpy/benchmark is in your PYTHONPATH shell environment variable. - (4) If you wish to use the gcpy test data, then set "gcpy_test: True" - in 1yr_tt_benchmark.yml. If you wish to use actual GEOS-Chem - output data, then set "gcpy_test: False". - - (5) Type at the command line + (4) Type at the command line ./run_benchmark.py 1yr_fullchem_benchmark.yml @@ -47,7 +43,7 @@ https://github.com/ipython/ipython/issues/10627 -This script corresponds with GCPy 1.3.2. Edit this version ID if releasing +This script corresponds with GCPy 1.4.0. Edit this version ID if releasing a new version of GCPy. """ diff --git a/benchmark/modules/run_1yr_tt_benchmark.py b/benchmark/modules/run_1yr_tt_benchmark.py index ff1dfc60..7c8bd383 100755 --- a/benchmark/modules/run_1yr_tt_benchmark.py +++ b/benchmark/modules/run_1yr_tt_benchmark.py @@ -24,11 +24,7 @@ (3) Make sure the /path/to/gcpy/benchmark is in your PYTHONPATH shell environment variable. - (4) If you wish to use the gcpy test data, then set "gcpy_test: True" - in 1yr_tt_benchmark.yml. If you wish to use actual GEOS-Chem - output data, then set "gcpy_test: False". - - (5) Type at the command line + (4) Type at the command line ./run_benchmark.py 1yr_tt_benchmark.yml @@ -46,7 +42,7 @@ https://github.com/ipython/ipython/issues/10627 -This script corresponds with GCPy 1.3.2. Edit this version ID if releasing +This script corresponds with GCPy 1.4.0. Edit this version ID if releasing a new version of GCPy. """ diff --git a/benchmark/run_benchmark.py b/benchmark/run_benchmark.py index e084ec40..3ec0dba7 100755 --- a/benchmark/run_benchmark.py +++ b/benchmark/run_benchmark.py @@ -17,11 +17,6 @@ ./run_1mo_benchmark.py -To test gcpy, copy this script and the corresponding yaml config file -anywhere you want to run the test. Set gcpy_test to True at the top -of the script. Benchmark artifacts will be created locally in new folder -called Plots. - Remarks: By default, matplotlib will try to open an X window for plotting. @@ -36,7 +31,7 @@ https://github.com/ipython/ipython/issues/10627 -This script corresponds with GCPy 1.3.2. Edit this version ID if releasing +This script corresponds with GCPy 1.4.0. Edit this version ID if releasing a new version of GCPy. """ @@ -194,89 +189,63 @@ def run_benchmark_default(config): # Benchmark output directories # ===================================================================== # Results directories - if config["options"]["gcpy_test"]: - mainresultsdir = os.path.join(".", config["paths"]["results_dir"]) - gcc_vs_gcc_resultsdir = os.path.join( - mainresultsdir, - config["options"]["comparisons"]["gcc_vs_gcc"]["dir"] - ) - gchp_vs_gchp_resultsdir = os.path.join( - mainresultsdir, - config["options"]["comparisons"]["gchp_vs_gchp"]["dir"] - ) - gchp_vs_gcc_resultsdir = os.path.join( - mainresultsdir, - "GCHP_GCC_comparison") - diff_of_diffs_resultsdir = os.path.join( - mainresultsdir, - "GCHP_GCC_diff_of_diffs" - ) - if not os.path.exists(mainresultsdir): - os.mkdir(mainresultsdir) - # Make copy of benchmark script in results directory - curfile = os.path.realpath(__file__) - dest = os.path.join(mainresultsdir, curfile.split("/")[-1]) - if not os.path.exists(dest): - copyfile(curfile, dest) - - else: - gcc_vs_gcc_resultsdir = os.path.join( - config["paths"]["main_dir"], - config["data"]["dev"]["gcc"]["dir"], - config["paths"]["results_dir"], - ) - gchp_vs_gchp_resultsdir = os.path.join( - config["paths"]["main_dir"], - config["data"]["dev"]["gchp"]["dir"], - config["paths"]["results_dir"], - config["options"]["comparisons"]["gchp_vs_gchp"]["dir"], - ) - gchp_vs_gcc_resultsdir = os.path.join( - config["paths"]["main_dir"], - config["data"]["dev"]["gchp"]["dir"], - config["paths"]["results_dir"], - config["options"]["comparisons"]["gchp_vs_gcc"]["dir"], - ) - diff_of_diffs_resultsdir = os.path.join( - config["paths"]["main_dir"], - config["data"]["dev"]["gchp"]["dir"], - config["paths"]["results_dir"], - "GCHP_GCC_diff_of_diffs", - ) - base_gchp_resultsdir = os.path.join( - config["paths"]["main_dir"], - config["data"]["dev"]["gchp"]["dir"], - config["paths"]["results_dir"], - ) - - # make results directories that don't exist - for resdir, plotting_type in zip( - [ - gcc_vs_gcc_resultsdir, - base_gchp_resultsdir, - gchp_vs_gchp_resultsdir, - gchp_vs_gcc_resultsdir, - diff_of_diffs_resultsdir, - ], - [ - config["options"]["comparisons"]["gcc_vs_gcc"]["run"], - config["options"]["comparisons"]["gchp_vs_gcc"]["run"] - or config["options"]["comparisons"]["gchp_vs_gchp"]["run"] - or config["options"]["comparisons"]["gchp_vs_gcc_diff_of_diffs"]["run"], - config["options"]["comparisons"]["gchp_vs_gchp"]["run"], - config["options"]["comparisons"]["gchp_vs_gcc"]["run"], - config["options"]["comparisons"]["gchp_vs_gcc_diff_of_diffs"]["run"], - ], - ): - if plotting_type and not os.path.exists(resdir): - os.mkdir(resdir) - if resdir in [gcc_vs_gcc_resultsdir, base_gchp_resultsdir]: - # Make copy of benchmark script in results directory - curfile = os.path.realpath(__file__) - dest = os.path.join(resdir, curfile.split("/")[-1]) - if os.path.exists(dest): - copyfile(curfile, dest) + gcc_vs_gcc_resultsdir = os.path.join( + config["paths"]["main_dir"], + config["data"]["dev"]["gcc"]["dir"], + config["paths"]["results_dir"], + ) + gchp_vs_gchp_resultsdir = os.path.join( + config["paths"]["main_dir"], + config["data"]["dev"]["gchp"]["dir"], + config["paths"]["results_dir"], + config["options"]["comparisons"]["gchp_vs_gchp"]["dir"], + ) + gchp_vs_gcc_resultsdir = os.path.join( + config["paths"]["main_dir"], + config["data"]["dev"]["gchp"]["dir"], + config["paths"]["results_dir"], + config["options"]["comparisons"]["gchp_vs_gcc"]["dir"], + ) + diff_of_diffs_resultsdir = os.path.join( + config["paths"]["main_dir"], + config["data"]["dev"]["gchp"]["dir"], + config["paths"]["results_dir"], + "GCHP_GCC_diff_of_diffs", + ) + base_gchp_resultsdir = os.path.join( + config["paths"]["main_dir"], + config["data"]["dev"]["gchp"]["dir"], + config["paths"]["results_dir"], + ) + # make results directories that don't exist + for resdir, plotting_type in zip( + [ + gcc_vs_gcc_resultsdir, + base_gchp_resultsdir, + gchp_vs_gchp_resultsdir, + gchp_vs_gcc_resultsdir, + diff_of_diffs_resultsdir, + ], + [ + config["options"]["comparisons"]["gcc_vs_gcc"]["run"], + config["options"]["comparisons"]["gchp_vs_gcc"]["run"] + or config["options"]["comparisons"]["gchp_vs_gchp"]["run"] + or config["options"]["comparisons"]["gchp_vs_gcc_diff_of_diffs"]["run"], + config["options"]["comparisons"]["gchp_vs_gchp"]["run"], + config["options"]["comparisons"]["gchp_vs_gcc"]["run"], + config["options"]["comparisons"]["gchp_vs_gcc_diff_of_diffs"]["run"], + ], + ): + if plotting_type and not os.path.exists(resdir): + os.mkdir(resdir) + if resdir in [gcc_vs_gcc_resultsdir, base_gchp_resultsdir]: + # Make copy of benchmark script in results directory + curfile = os.path.realpath(__file__) + dest = os.path.join(resdir, curfile.split("/")[-1]) + if os.path.exists(dest): + copyfile(curfile, dest) + gcc_vs_gcc_tablesdir = os.path.join( gcc_vs_gcc_resultsdir, config["options"]["comparisons"]["gcc_vs_gcc"]["tables_subdir"], From 998f4f097d18786cfac8f70c1f55951ee7a7cdba Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Tue, 23 May 2023 17:32:18 -0400 Subject: [PATCH 3/5] Remove gcpy/.readthedocs.yaml (you only need it in the root folder) Signed-off-by: Bob Yantosca --- gcpy/.readthedocs.yaml | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 gcpy/.readthedocs.yaml diff --git a/gcpy/.readthedocs.yaml b/gcpy/.readthedocs.yaml deleted file mode 100644 index fe755317..00000000 --- a/gcpy/.readthedocs.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# .readthedocs.yaml -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details -# -# NOTE: This is now needed in order to prevent builds from failing due -# to Python package issues at the ReadTheDocs site. For more info, see: -# https://github.com/readthedocs/readthedocs.org/issues/10290 -# -- Bob Yantosca (10 May 2023) - -# Required -version: 2 - -## Set the version of Python and other tools you might need -build: - os: ubuntu-22.04 - tools: - python: "3.7" - nodejs: "14" - rust: "1.55" - golang: "1.17" - -# Build documentation in the docs/ directory with Sphinx -sphinx: - builder: html - configuration: docs/source/conf.py - -# If using Sphinx, optionally build your docs in additional formats such as PDF -#formats: -# - pdf - -# Optionally declare the Python requirements required to build your docs -python: - install: - - requirements: docs/requirements.txt From 18e68adcc33122920392db67fd67f913913920cb Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Wed, 31 May 2023 13:48:22 -0400 Subject: [PATCH 4/5] Remove is_pre_13.1 tags from cloud template*benchmark.yml files benchmark/cloud/template.1hr_benchmark benchmark/cloud/template.1mo_benchmark - Removed the is_pre_13.1 tags from ref & dev GCHP entries in these cloud benchmarking configuration files for consistency with the other configuration files. Signed-off-by: Bob Yantosca --- benchmark/cloud/template.1hr_benchmark.yml | 2 -- benchmark/cloud/template.1mo_benchmark.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/benchmark/cloud/template.1hr_benchmark.yml b/benchmark/cloud/template.1hr_benchmark.yml index 94bbd054..78eefc37 100644 --- a/benchmark/cloud/template.1hr_benchmark.yml +++ b/benchmark/cloud/template.1hr_benchmark.yml @@ -52,7 +52,6 @@ data: restarts_subdir: Restarts bmk_start: "2019-07-01T00:00:00" bmk_end: "2019-07-01T01:00:00" - is_pre_13.1: False is_pre_14.0: False resolution: c24 dev: @@ -70,7 +69,6 @@ data: restarts_subdir: Restarts bmk_start: "2019-07-01T00:00:00" bmk_end: "2019-07-01T01:00:00" - is_pre_13.1: False is_pre_14.0: False resolution: c24 # diff --git a/benchmark/cloud/template.1mo_benchmark.yml b/benchmark/cloud/template.1mo_benchmark.yml index 64a5b2e6..d4d8808f 100644 --- a/benchmark/cloud/template.1mo_benchmark.yml +++ b/benchmark/cloud/template.1mo_benchmark.yml @@ -52,7 +52,6 @@ data: restarts_subdir: Restarts bmk_start: "2019-07-01T00:00:00" bmk_end: "2019-08-01T00:00:00" - is_pre_13.1: False is_pre_14.0: False resolution: c24 dev: @@ -70,7 +69,6 @@ data: restarts_subdir: Restarts bmk_start: "2019-07-01T00:00:00" bmk_end: "2019-08-01T00:00:00" - is_pre_13.1: False is_pre_14.0: False resolution: c24 # From 683b5d02ff9f170b6a25e6fa177bff90c8540e4c Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Wed, 31 May 2023 14:32:05 -0400 Subject: [PATCH 5/5] Bug fix: add missing comma at line 911 of run_benchmark.py benchmark/run_benchmark.py - The "is_gchp=True" keyword argument needs to be followed by a comma (e.g. "is_gchp=True," as there are arguments that come after it. Now fixed. Signed-off-by: Bob Yantosca --- benchmark/run_benchmark.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/run_benchmark.py b/benchmark/run_benchmark.py index 3e553cc4..79098f30 100755 --- a/benchmark/run_benchmark.py +++ b/benchmark/run_benchmark.py @@ -913,7 +913,7 @@ def run_benchmark_default(config): gchp_vs_gcc_devrst, "Restart", gchp_end_dev_date, - is_gchp=True + is_gchp=True, gchp_res=config["data"]["dev"]["gchp"]["resolution"], gchp_is_pre_14_0=config["data"]["dev"]["gchp"]["is_pre_14.0"] )