From d784cb586c5ba64076e52016663d6deb5ae40c76 Mon Sep 17 00:00:00 2001 From: Bas des Tombe Date: Fri, 27 Dec 2024 09:50:31 +0100 Subject: [PATCH] Fix top required in cache2d scripts --- .gitignore | 2 +- src/nhflotools/pwnlayers/io.py | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 3f357c9..d82364a 100644 --- a/.gitignore +++ b/.gitignore @@ -133,6 +133,6 @@ dmypy.json # Pyre type checker .pyre/ - bin/ *.code-workspace +**/model_ws diff --git a/src/nhflotools/pwnlayers/io.py b/src/nhflotools/pwnlayers/io.py index 0afa8dd..0446bc0 100644 --- a/src/nhflotools/pwnlayers/io.py +++ b/src/nhflotools/pwnlayers/io.py @@ -54,7 +54,7 @@ def read_pwn_data2( ds_mask_transition : xarray Dataset mask dataset. True in transition zone. """ - modelgrid = nlmod.dims.grid.modelgrid_from_ds(ds) + modelgrid = nlmod.dims.grid.modelgrid_from_ds(ds, rotated=False) ix = GridIntersect(modelgrid, method="vertex") ds_out = xr.Dataset( @@ -163,7 +163,7 @@ def read_pwn_data2( return ds_out -@cache.cache_netcdf(coords_2d=True) +@cache.cache_netcdf(datavars=["top"], coords_2d=True) def _read_bergen_basis_aquitards( ds, pathname=None, @@ -271,7 +271,7 @@ def _read_bergen_basis_aquitards( return ds_out -@cache.cache_netcdf(coords_2d=True) +@cache.cache_netcdf(datavars=["top"], coords_2d=True) def _read_bergen_c_aquitards(ds, pathname, length_transition=100.0, ix=None): """Read vertical resistance of layers. @@ -313,7 +313,7 @@ def _read_bergen_c_aquitards(ds, pathname, length_transition=100.0, ix=None): return ds_out -@cache.cache_netcdf(coords_2d=True) +@cache.cache_netcdf(datavars=["top"], coords_2d=True) def _read_bergen_thickness_aquitards( ds, pathname=None, @@ -419,7 +419,7 @@ def _read_bergen_thickness_aquitards( return ds_out -@cache.cache_netcdf(coords_2d=True) +@cache.cache_netcdf(datavars=["top"], coords_2d=True) def _read_top_of_aquitards(ds, pathname, length_transition=100.0, ix=None): """Read top of aquitards. @@ -461,7 +461,7 @@ def _read_top_of_aquitards(ds, pathname, length_transition=100.0, ix=None): return ds_out -@cache.cache_netcdf(coords_2d=True) +@cache.cache_netcdf(datavars=["top"], coords_2d=True) def _read_thickness_of_aquitards(ds, pathname, length_transition=100.0, ix=None): """Read thickness of aquitards. @@ -505,7 +505,7 @@ def _read_thickness_of_aquitards(ds, pathname, length_transition=100.0, ix=None) return ds_out -@cache.cache_netcdf(coords_2d=True) +@cache.cache_netcdf(datavars=["top"], coords_2d=True) def _read_kd_of_aquitards(ds, pathname, length_transition=100.0, ix=None): """Read kd of aquitards. @@ -546,7 +546,7 @@ def _read_kd_of_aquitards(ds, pathname, length_transition=100.0, ix=None): return ds_out -@cache.cache_netcdf(coords_2d=True) +@cache.cache_netcdf(datavars=["top"], coords_2d=True) def _read_mask_of_aquifers(ds, pathname, length_transition=100.0, ix=None): """Read mask of aquifers. @@ -593,7 +593,7 @@ def _read_mask_of_aquifers(ds, pathname, length_transition=100.0, ix=None): return ds_out -@cache.cache_netcdf(coords_2d=True) +@cache.cache_netcdf(datavars=["top"], coords_2d=True) def _read_layer_kh(ds, pathname, length_transition=100.0, ix=None): """Read hydraulic conductivity of layers. @@ -636,7 +636,7 @@ def _read_layer_kh(ds, pathname, length_transition=100.0, ix=None): return ds_out -@cache.cache_netcdf(coords_2d=True) +@cache.cache_netcdf(datavars=["top"], coords_2d=True) def _read_kv_area(ds, pathname, length_transition=100.0, ix=None): # noqa: ARG001 """Read vertical resistance of layers. @@ -711,7 +711,7 @@ def _read_kv_area(ds, pathname, length_transition=100.0, ix=None): # noqa: ARG0 return ds_out -@cache.cache_netcdf(coords_2d=True) +@cache.cache_netcdf(datavars=["top"], coords_2d=True) def _read_topsysteem(ds, pathname): """Read topsysteem.