From 3e8575039f04a9811c79b55ea86c9ba3fb23d601 Mon Sep 17 00:00:00 2001 From: Ryan Forsyth Date: Wed, 22 Jun 2022 19:22:48 -0500 Subject: [PATCH] Change ilamb task name --- docs/source/dev_guide/testing.rst | 2 +- tests/integration/test_bundles.cfg | 4 ++-- tests/integration/test_bundles.py | 2 +- tests/integration/test_complete_run.cfg | 2 +- zppy/__main__.py | 6 +++--- zppy/{ilamb_run.py => ilamb.py} | 12 ++++++------ zppy/templates/default.ini | 4 ++-- zppy/templates/{ilamb_run.bash => ilamb.bash} | 4 ++-- zppy/templates/{ilamb_run => ilamb}/cmip.cfg | 0 zppy/templates/{ilamb_run => ilamb}/ilamb.cfg | 0 10 files changed, 18 insertions(+), 18 deletions(-) rename zppy/{ilamb_run.py => ilamb.py} (92%) rename zppy/templates/{ilamb_run.bash => ilamb.bash} (95%) rename zppy/templates/{ilamb_run => ilamb}/cmip.cfg (100%) rename zppy/templates/{ilamb_run => ilamb}/ilamb.cfg (100%) diff --git a/docs/source/dev_guide/testing.rst b/docs/source/dev_guide/testing.rst index d0b4a729..27eb566d 100644 --- a/docs/source/dev_guide/testing.rst +++ b/docs/source/dev_guide/testing.rst @@ -48,7 +48,7 @@ Before running ``tests/integration/test_bundles.py`` run the following: zppy -c tests/integration/test_bundles.cfg # bundle1 and bundle2 should run. After they finish, invoke zppy again to resolve remaining dependencies: zppy -c tests/integration/test_bundles.cfg - # bundle3 and ilamb_run should run + # bundle3 and ilamb should run Commands to run to replace outdated expected files -------------------------------------------------- diff --git a/tests/integration/test_bundles.cfg b/tests/integration/test_bundles.cfg index 8534dfe7..7bd404ec 100644 --- a/tests/integration/test_bundles.cfg +++ b/tests/integration/test_bundles.cfg @@ -128,9 +128,9 @@ ts_num_years = 5 walltime = "00:30:00" # bundle2 should take walltime from "ts: atm_monthly_glb", i.e., "02:00:00" years = "1850-1860", -[ilamb_run] +[ilamb] active = True -# No bundle, let bundle1 finish first because "ilamb_run" requires "ts: atm_monthly_180x360_aave" +# No bundle, let bundle1 finish first because "ilamb" requires "ts: atm_monthly_180x360_aave" grid = '180x360_aave' short_name = 'v2.LR.historical_0201' ts_num_years = 2 diff --git a/tests/integration/test_bundles.py b/tests/integration/test_bundles.py index 9706fc50..bc31219d 100644 --- a/tests/integration/test_bundles.py +++ b/tests/integration/test_bundles.py @@ -32,7 +32,7 @@ def test_bundles_bash_file_list(self): "e3sm_diags_atm_monthly_180x360_aave_model_vs_obs_1852-1853.bash", "e3sm_diags_atm_monthly_180x360_aave_mvm_model_vs_model_1850-1851_vs_1850-1851.bash", "global_time_series_1850-1860.bash", - "ilamb_run_1850-1851.bash", + "ilamb_1850-1851.bash", "tc_analysis_1850-1851.bash", "ts_atm_daily_180x360_aave_1850-1851-0002.bash", "ts_atm_daily_180x360_aave_1852-1853-0002.bash", diff --git a/tests/integration/test_complete_run.cfg b/tests/integration/test_complete_run.cfg index 96d7241e..1a3373f3 100644 --- a/tests/integration/test_complete_run.cfg +++ b/tests/integration/test_complete_run.cfg @@ -141,7 +141,7 @@ ts_years = "1850-1854", "1850-1860", walltime = "00:30:00" years = "1850-1860", -[ilamb_run] +[ilamb] active = True grid = '180x360_aave' short_name = 'v2.LR.historical_0201' diff --git a/zppy/__main__.py b/zppy/__main__.py index a09dabea..fbfa3a47 100644 --- a/zppy/__main__.py +++ b/zppy/__main__.py @@ -12,7 +12,7 @@ from zppy.climo import climo from zppy.e3sm_diags import e3sm_diags from zppy.global_time_series import global_time_series -from zppy.ilamb_run import ilamb_run +from zppy.ilamb import ilamb from zppy.mpas_analysis import mpas_analysis from zppy.tc_analysis import tc_analysis from zppy.ts import ts @@ -144,8 +144,8 @@ def main(): # noqa: C901 # global time series tasks existing_bundles = global_time_series(config, scriptDir, existing_bundles) - # ilamb_run tasks - existing_bundles = ilamb_run(config, scriptDir, existing_bundles) + # ilamb tasks + existing_bundles = ilamb(config, scriptDir, existing_bundles) # Submit bundle jobs for b in existing_bundles: diff --git a/zppy/ilamb_run.py b/zppy/ilamb.py similarity index 92% rename from zppy/ilamb_run.py rename to zppy/ilamb.py index 85400892..f924bf0d 100644 --- a/zppy/ilamb_run.py +++ b/zppy/ilamb.py @@ -16,21 +16,21 @@ # ----------------------------------------------------------------------------- -def ilamb_run(config, scriptDir, existing_bundles): +def ilamb(config, scriptDir, existing_bundles): # Initialize jinja2 template engine templateLoader = jinja2.FileSystemLoader( searchpath=config["default"]["templateDir"] ) templateEnv = jinja2.Environment(loader=templateLoader) - template = templateEnv.get_template("ilamb_run.bash") + template = templateEnv.get_template("ilamb.bash") - # --- List of ilamb_run tasks --- - tasks = getTasks(config, "ilamb_run") + # --- List of ilamb tasks --- + tasks = getTasks(config, "ilamb") if len(tasks) == 0: return existing_bundles - # --- Generate and submit ilamb_run scripts --- + # --- Generate and submit ilamb scripts --- dependencies = [] for c in tasks: @@ -81,7 +81,7 @@ def ilamb_run(config, scriptDir, existing_bundles): ), ) - prefix = "ilamb_run_%04d-%04d" % ( + prefix = "ilamb_%04d-%04d" % ( c["year1"], c["year2"], ) diff --git a/zppy/templates/default.ini b/zppy/templates/default.ini index a555baf3..15222cf4 100644 --- a/zppy/templates/default.ini +++ b/zppy/templates/default.ini @@ -275,8 +275,8 @@ ts_num_years = integer(default=10) ts_years = string_list(default=list("")) # `years = "1-100",` would plot years 1 to 100 on the graphs. -[ilamb_run] -cfg = string(default="ilamb_run/cmip.cfg") +[ilamb] +cfg = string(default="ilamb/cmip.cfg") ilamb_obs = string(default="") land_only = boolean(default=False) ts_atm_subsection = string(default="atm_monthly_180x360_aave") diff --git a/zppy/templates/ilamb_run.bash b/zppy/templates/ilamb.bash similarity index 95% rename from zppy/templates/ilamb_run.bash rename to zppy/templates/ilamb.bash index 26714cc6..5c9e463e 100644 --- a/zppy/templates/ilamb_run.bash +++ b/zppy/templates/ilamb.bash @@ -61,14 +61,14 @@ echo # TODO: find the mpi run format for different platforms # include cfg file -cat > ilamb_run.cfg << EOF +cat > ilamb.cfg << EOF {% include cfg %} EOF echo ${workdir} echo {{ scriptDir }} -srun -N 1 ilamb-run --config ilamb_run.cfg --model_root $model_root --regions global --model_year ${Y1} 2000 +srun -N 1 ilamb-run --config ilamb.cfg --model_root $model_root --regions global --model_year ${Y1} 2000 if [ $? != 0 ]; then cd {{ scriptDir }} diff --git a/zppy/templates/ilamb_run/cmip.cfg b/zppy/templates/ilamb/cmip.cfg similarity index 100% rename from zppy/templates/ilamb_run/cmip.cfg rename to zppy/templates/ilamb/cmip.cfg diff --git a/zppy/templates/ilamb_run/ilamb.cfg b/zppy/templates/ilamb/ilamb.cfg similarity index 100% rename from zppy/templates/ilamb_run/ilamb.cfg rename to zppy/templates/ilamb/ilamb.cfg