Browse Source

Updated CI tests to reflect changes to diagnostics

lon0
Bill Ladwig 7 years ago
parent
commit
9a5a05dd59
  1. BIN
      test/ci_tests/ci_result_file.nc
  2. BIN
      test/ci_tests/ci_test_file.nc
  3. 11
      test/ci_tests/make_test_file.py
  4. 5
      test/ci_tests/utests.py

BIN
test/ci_tests/ci_result_file.nc

Binary file not shown.

BIN
test/ci_tests/ci_test_file.nc

Binary file not shown.

11
test/ci_tests/make_test_file.py

@ -22,7 +22,7 @@ WRF_DIAGS = ["avo", "eth", "cape_2d", "cape_3d", "ctt", "dbz", "mdbz",
"geopt", "helicity", "lat", "lon", "omg", "p", "pressure", "geopt", "helicity", "lat", "lon", "omg", "p", "pressure",
"pvo", "pw", "rh2", "rh", "slp", "ter", "td2", "td", "tc", "pvo", "pw", "rh2", "rh", "slp", "ter", "td2", "td", "tc",
"theta", "tk", "tv", "twb", "updraft_helicity", "ua", "va", "theta", "tk", "tv", "twb", "updraft_helicity", "ua", "va",
"wa", "uvmet10", "uvmet", "z", "cfrac"] "wa", "uvmet10", "uvmet", "z", "cfrac", "zstag"]
INTERP_METHS = ["interplevel", "vertcross", "interpline", "vinterp"] INTERP_METHS = ["interplevel", "vertcross", "interpline", "vinterp"]
@ -33,6 +33,7 @@ def copy_and_reduce(opts):
infilename = opts.filename infilename = opts.filename
outfilename = os.path.expanduser( outfilename = os.path.expanduser(
os.path.join(opts.outdir, "ci_test_file.nc")) os.path.join(opts.outdir, "ci_test_file.nc"))
with Dataset(infilename) as infile, Dataset(outfilename, "w") as outfile: with Dataset(infilename) as infile, Dataset(outfilename, "w") as outfile:
# Copy the global attributes # Copy the global attributes
@ -164,12 +165,14 @@ def main(opts):
if __name__ == "__main__": if __name__ == "__main__":
DEFAULT_FILE = ("/Users/ladwig/Documents/wrf_files/"
"wrf_vortex_multi/wrfout_d02_2005-08-28_12:00:00")
parser = argparse.ArgumentParser(description="Generate conda test files " parser = argparse.ArgumentParser(description="Generate conda test files "
"for unit testing.") "for unit testing.")
parser.add_argument("-f", "--filename", required=True, parser.add_argument("-f", "--filename", required=False,
default=DEFAULT_FILE,
help="the WRF test file") help="the WRF test file")
parser.add_argument("-o", "--outdir", required=True, parser.add_argument("-o", "--outdir", required=False, default="./",
help="the location for the output files") help="the location for the output files")
opts = parser.parse_args() opts = parser.parse_args()

5
test/ci_tests/utests.py

@ -8,7 +8,8 @@ import subprocess
from wrf import (getvar, interplevel, interpline, vertcross, vinterp, from wrf import (getvar, interplevel, interpline, vertcross, vinterp,
disable_xarray, xarray_enabled, to_np, disable_xarray, xarray_enabled, to_np,
xy_to_ll, ll_to_xy, xy_to_ll_proj, ll_to_xy_proj, xy_to_ll, ll_to_xy, xy_to_ll_proj, ll_to_xy_proj,
extract_global_attrs, viewitems, CoordPair) extract_global_attrs, viewitems, CoordPair,
omp_get_num_procs, omp_set_num_threads)
from wrf.util import is_multi_file from wrf.util import is_multi_file
TEST_FILE = "ci_test_file.nc" TEST_FILE = "ci_test_file.nc"
@ -210,7 +211,7 @@ if __name__ == "__main__":
"geopt", "helicity", "lat", "lon", "omg", "p", "pressure", "geopt", "helicity", "lat", "lon", "omg", "p", "pressure",
"pvo", "pw", "rh2", "rh", "slp", "ter", "td2", "td", "tc", "pvo", "pw", "rh2", "rh", "slp", "ter", "td2", "td", "tc",
"theta", "tk", "tv", "twb", "updraft_helicity", "ua", "va", "theta", "tk", "tv", "twb", "updraft_helicity", "ua", "va",
"wa", "uvmet10", "uvmet", "z", "cfrac"] "wa", "uvmet10", "uvmet", "z", "cfrac", "zstag"]
interp_methods = ["interplevel", "vertcross", "interpline", "vinterp"] interp_methods = ["interplevel", "vertcross", "interpline", "vinterp"]
latlon_tests = ["xy", "ll"] latlon_tests = ["xy", "ll"]

Loading…
Cancel
Save