diff --git a/tests/test_forcing.py b/tests/test_forcing.py index aedfd4f93..093e9db9f 100644 --- a/tests/test_forcing.py +++ b/tests/test_forcing.py @@ -42,7 +42,7 @@ def test_precip(data_catalog): def test_pet(data_catalog): et_data = data_catalog.get_rasterdataset("era5_daily_zarr") dem = data_catalog.get_rasterdataset("era5_orography").squeeze("time", drop=True) - + peto_tdew = pet(et_data, et_data, dem, method="penman-monteith_tdew") assert peto_tdew.raster.shape == dem.raster.shape np.testing.assert_almost_equal(peto_tdew.mean(), 0.57746, decimal=4) @@ -50,7 +50,7 @@ def test_pet(data_catalog): # Convert to relative humidity using simple approach # as relative humidity is not provided in ERA5 data # Lawrence (2005) dx.doi.org/10.1175/BAMS-86-2-225 - et_data['rh'] = 5*et_data['temp_dew'] + 100 - 5*et_data['temp'] - peto_simple = pet(et_data, et_data, dem, method="penman-monteith_rh_simple") - assert peto_simple.raster.shape == dem.raster.shape - np.testing.assert_almost_equal(peto_simple.mean(), 0.51279, decimal=4) \ No newline at end of file + et_data["rh"] = 5 * et_data["temp_dew"] + 100 - 5 * et_data["temp"] + peto_rh = pet(et_data, et_data, dem, method="penman-monteith_rh_simple") + assert peto_rh.raster.shape == dem.raster.shape + np.testing.assert_almost_equal(peto_rh.mean(), 0.51279, decimal=4)