From 1a7aa298713512082595fec23e1893a7be22e87d Mon Sep 17 00:00:00 2001 From: veenstrajelmer <60435591+veenstrajelmer@users.noreply.github.com> Date: Mon, 9 Sep 2024 12:04:05 +0200 Subject: [PATCH] 995 catch userwarning in test interp uds to plipoints (#996) * added warnings filter --- tests/test_interpolate_grid2bnd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_interpolate_grid2bnd.py b/tests/test_interpolate_grid2bnd.py index 239d92258..2e130dff8 100644 --- a/tests/test_interpolate_grid2bnd.py +++ b/tests/test_interpolate_grid2bnd.py @@ -26,6 +26,7 @@ from dfm_tools.hydrolib_helpers import get_ncbnd_construct import hydrolib.core.dflowfm as hcdfm from dfm_tools.errors import OutOfRangeError +import warnings def data_dcsm_gdf(): @@ -547,7 +548,9 @@ def test_interp_uds_to_plipoints(): ds_atdepths = ds_atdepths.rename({'depth_from_z0':'depth'}) #interpolate to plipoints - ds_plipoints = dfmt.interp_uds_to_plipoints(uds=ds_atdepths, gdf=gdf) #workaround for plipoints out of the model domain + with warnings.catch_warnings(): + warnings.simplefilter("ignore", UserWarning) + ds_plipoints = dfmt.interp_uds_to_plipoints(uds=ds_atdepths, gdf=gdf) #workaround for plipoints out of the model domain assert varn_pointname in ds_plipoints.coords assert 'depth' in ds_plipoints.coords # TODO: maybe should be z like ncbnd_construct['varn_depth'], although get_Dataset_atdepths() makes depth variable