-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add generic run script for testing changes at runtime (#285)
- Loading branch information
1 parent
7321be0
commit 296f54f
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
"""A generic run script for testing changes to `e3sm_to_cmip` at runtime. | ||
This script is useful for testing code changes to `e3sm_to_cmip` without having | ||
to install the package. It imports the `main` function from the `__main__` | ||
module and passes a list of arguments to it. The arguments are the same as those | ||
passed to the command line interface (CLI) of `e3sm_to_cmip`. | ||
The script can be run from the command line or an IDE. | ||
NOTE: This script can only be executed on LCRC machines. | ||
""" | ||
|
||
import datetime | ||
|
||
from e3sm_to_cmip.__main__ import main | ||
|
||
# The list of variables to process. Update as needed. | ||
VAR_LIST = ( | ||
"pfull, phalf, tas, ts, psl, ps, sfcWind, huss, pr, prc, prsn, evspsbl, tauu, " | ||
"tauv, hfls, clt, rlds, rlus, rsds, rsus, hfss, cl, clw, cli, clivi, clwvi, prw, " | ||
"rldscs, rlut, rlutcs, rsdt, rsuscs, rsut, rsutcs, rtmt, abs550aer, od550aer " | ||
"rsdscs, hur" | ||
) | ||
|
||
# The output path for CMORized datasets. Update as needed. | ||
OUTPUT_PATH = f"../qa/run_{datetime.datetime.now().strftime('%Y%m%d_%H%M%S')}" | ||
|
||
args = [ | ||
"--var-list", | ||
f"{VAR_LIST}", | ||
"--input", | ||
"/lcrc/group/e3sm/e3sm_to_cmip/test-cases/atm-unified-eam/input-regridded", | ||
"--output", | ||
f"{OUTPUT_PATH}", | ||
"--tables-path", | ||
"/lcrc/group/e3sm/e3sm_to_cmip/cmip6-cmor-tables/Tables/", | ||
"--user-metadata", | ||
"/lcrc/group/e3sm/e3sm_to_cmip/CMIP6-Metadata/template.json", | ||
"--serial", | ||
] | ||
|
||
# `main()` creates an `E3SMtoCMIP` object and passes `args` to it, which sets | ||
# the object parameters to execute a run. | ||
main(args) |