Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating new cache used full ds instead of reduced ds #340

Merged
merged 24 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
003c6e7
Creating new cache used full ds instead of reduced ds
bdestombe Apr 28, 2024
5268ca8
Format cache to please codacy
bdestombe Apr 28, 2024
d0cd821
Better support for vertex grids
bdestombe May 1, 2024
bb66042
remove option to store delr/delc as attrs
dbrakenhoff May 13, 2024
21ac226
remove option to store delr/delc as attrs
dbrakenhoff May 13, 2024
1d51ae9
update polygons_from_model_ds to to use new delr/delc datavars
dbrakenhoff May 13, 2024
0896d04
add delr and delc to datavars in ds_to_structured_grid
dbrakenhoff May 13, 2024
724a3bf
remove delr/delc attr check in structured_da_to_ds
dbrakenhoff May 13, 2024
c86820d
get_recharge uses coords3d to determine first active layer
dbrakenhoff May 13, 2024
9f5a5dd
add delr/delc to datavars for surface water functions
dbrakenhoff May 13, 2024
a04f7ab
formatting
dbrakenhoff May 13, 2024
d11ea6b
formatting
dbrakenhoff May 13, 2024
530eed4
remove coords that number from 0 to N (these are not listed in coords)
dbrakenhoff May 13, 2024
6ef29f6
remove delr and delc from datavars is vertexgrid
dbrakenhoff May 13, 2024
901e52d
do not check time attrs start and time_units
dbrakenhoff May 13, 2024
f89ea57
do not check time coord attributes
dbrakenhoff May 13, 2024
b439260
formatting
dbrakenhoff May 13, 2024
6ac9638
skip delr/delc when writing files
dbrakenhoff May 13, 2024
0a20ada
rename bathymetry tests
dbrakenhoff May 13, 2024
92362c5
comment still in dutch: bathymetry
dbrakenhoff May 13, 2024
eefdc2c
comment still in dutch: bathymetry
dbrakenhoff May 13, 2024
75b5ffb
use last delr to set extent
dbrakenhoff May 13, 2024
a5c3264
use brackets (was failing for me without)
dbrakenhoff May 13, 2024
f51a15c
Cache: Implemented inline suggestions made by David
bdestombe May 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/examples/02_surface_water.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@
"xlim = ax.get_xlim()\n",
"ylim = ax.get_ylim()\n",
"gwf.modelgrid.plot(ax=ax)\n",
"ax.set_xlim(xlim[0], xlim[0] + ds.delr * 1.1)\n",
"ax.set_xlim(xlim[0], xlim[0] + ds.delr[-1] * 1.1)\n",
"ax.set_ylim(ylim)\n",
"ax.set_title(f\"Surface water shapes in cell: {cid}\")"
]
Expand Down Expand Up @@ -788,6 +788,14 @@
"cbar = fig.colorbar(qm, shrink=1.0)\n",
"cbar.set_label(\"head [m NAP]\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1cbc42bf",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/cache_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import xarray as xr


@nlmod.cache.cache_netcdf
@nlmod.cache.cache_netcdf()
def func_to_create_a_dataset(number):
"""create a dataarray as an example for the caching method.

Expand Down
Loading
Loading