From 92df8c9df273c86b1773b7e555f2fca11866b4d5 Mon Sep 17 00:00:00 2001 From: Austin Raney Date: Thu, 22 Feb 2024 09:20:56 -0500 Subject: [PATCH] test: lgar --- python/ngen_conf/tests/conftest.py | 6 ++++++ .../tests/data/init_config_data/lgar.txt | 15 +++++++++++++++ python/ngen_conf/tests/test_init_config_models.py | 9 +++++++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 python/ngen_conf/tests/data/init_config_data/lgar.txt diff --git a/python/ngen_conf/tests/conftest.py b/python/ngen_conf/tests/conftest.py index a89058b9..431d809c 100644 --- a/python/ngen_conf/tests/conftest.py +++ b/python/ngen_conf/tests/conftest.py @@ -18,6 +18,7 @@ _noah_owp_config_data_path = _datadir / "init_config_data" / "noah_owp.namelist" _soil_freeze_thaw_config_data_path = _datadir / "init_config_data" / "soil_freeze_thaw.txt" _soil_moisture_profile_config_data_path = _datadir / "init_config_data" / "soil_moisture_profile.txt" +_lgar_config_data_path = _datadir / "init_config_data" / "lgar.txt" """ @@ -172,3 +173,8 @@ def soil_freeze_thaw_init_config() -> str: def soil_moisture_profile_init_config() -> str: # drop eol char return _soil_moisture_profile_config_data_path.read_text().rstrip() + +@pytest.fixture +def lgar_init_config() -> str: + # drop eol char + return _lgar_config_data_path.read_text().rstrip() diff --git a/python/ngen_conf/tests/data/init_config_data/lgar.txt b/python/ngen_conf/tests/data/init_config_data/lgar.txt new file mode 100644 index 00000000..6a4b35fa --- /dev/null +++ b/python/ngen_conf/tests/data/init_config_data/lgar.txt @@ -0,0 +1,15 @@ +verbosity=none +soil_params_file=./data/vG_default_params.dat +layer_thickness=44.0,131.0,25.0[cm] +initial_psi=2000.0[cm] +timestep=300[sec] +endtime=7500.0[hr] +forcing_resolution=3600[sec] +ponded_depth_max=2[cm] +use_closed_form_G=false +layer_soil_type=13,14,15 +max_soil_types=25 +wilting_point_psi=15495.0[cm] +giuh_ordinates=0.06,0.51,0.28,0.12,0.03 +sft_coupled=true +soil_z=10,20,30,40,50,60,70,80,90,100.0,110.,120,130.,140.,150.,160.,170.,180.,190.,200.0[cm] diff --git a/python/ngen_conf/tests/test_init_config_models.py b/python/ngen_conf/tests/test_init_config_models.py index a923bed8..4681a4a7 100644 --- a/python/ngen_conf/tests/test_init_config_models.py +++ b/python/ngen_conf/tests/test_init_config_models.py @@ -1,9 +1,10 @@ -from ngen.init_config import utils from ngen.config.init_config.cfe import CFE -from ngen.config.init_config.pet import PET +from ngen.config.init_config.lgar import Lgar from ngen.config.init_config.noahowp import NoahOWP +from ngen.config.init_config.pet import PET from ngen.config.init_config.soil_freeze_thaw import SoilFreezeThaw from ngen.config.init_config.soil_moisture_profile import SoilMoistureProfile +from ngen.init_config import utils def test_cfe(cfe_init_config: str): @@ -33,3 +34,7 @@ def test_soil_freeze_thaw(soil_freeze_thaw_init_config: str): def test_soil_moisture_profile(soil_moisture_profile_init_config: str): o = SoilMoistureProfile.from_ini_str(soil_moisture_profile_init_config) assert o.to_ini_str() == soil_moisture_profile_init_config + +def test_lgar(lgar_init_config: str): + o = Lgar.from_ini_str(lgar_init_config) + assert o.to_ini_str() == lgar_init_config