Skip to content

Commit

Permalink
pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
shartgring committed Aug 1, 2024
1 parent da542a3 commit cb23eac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_forcing.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ 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)

# 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)
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)

0 comments on commit cb23eac

Please sign in to comment.