Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
90356d1
Add tutorial.open_dataset
VeckoTheGecko Apr 9, 2026
1c364be
Update dataset names for `open_dataset`
VeckoTheGecko Apr 9, 2026
f5cbc25
Port accross tutorial util tests
VeckoTheGecko Apr 9, 2026
e5a85c4
Add test_open_dataset
VeckoTheGecko Apr 9, 2026
9ef869a
Silence future warning
VeckoTheGecko Apr 9, 2026
0f6a8c9
Make variables private
VeckoTheGecko Apr 9, 2026
9709681
Make parcels.tutorial public
VeckoTheGecko Apr 9, 2026
e424755
Remove `download_example_dataset` and `list_example_datasets` from ro…
VeckoTheGecko Apr 9, 2026
b97918d
debug: Add code_path argument to
VeckoTheGecko Apr 10, 2026
11daa88
Update docs and tests to use open_dataset
VeckoTheGecko Apr 10, 2026
332fcab
Refactor _DATASET_KEYS_AND_OPEN_PATHS to _DATASET_KEYS_AND_CONFIGS
VeckoTheGecko Apr 10, 2026
f8df238
Fix dataset ingestion
VeckoTheGecko Apr 10, 2026
7c212ff
Remove nc code path
VeckoTheGecko Apr 10, 2026
fdccf31
Cleanup
VeckoTheGecko Apr 10, 2026
788313d
Lift constant definition
VeckoTheGecko Apr 13, 2026
110f5d6
Remove data_home option from download_dataset
VeckoTheGecko Apr 13, 2026
da3975d
Make pooch instance a constant
VeckoTheGecko Apr 13, 2026
ee23d52
Fix test failures
VeckoTheGecko Apr 13, 2026
7c67e89
Refactor
VeckoTheGecko Apr 13, 2026
89d48c9
Refactor and remove legacy tooling
VeckoTheGecko Apr 13, 2026
b36cc8e
Update pooch registry
VeckoTheGecko Apr 13, 2026
0fd9dbd
Move test
VeckoTheGecko Apr 13, 2026
d408232
Add purpose to datasets
VeckoTheGecko Apr 13, 2026
adff0aa
Move file
VeckoTheGecko Apr 13, 2026
c6adb75
Move test file
VeckoTheGecko Apr 13, 2026
3b75159
Update list_datasets and open_dataset
VeckoTheGecko Apr 13, 2026
89f8202
Fix registry entry
VeckoTheGecko Apr 13, 2026
ec32d2a
Add thin parcels.tutorial wrapper
VeckoTheGecko Apr 13, 2026
04ce890
Update comment
VeckoTheGecko Apr 13, 2026
7c107d8
Add test_list_datasets
VeckoTheGecko Apr 13, 2026
1cc9750
Fix relative paths
VeckoTheGecko Apr 13, 2026
38404a3
Update references in codebase
VeckoTheGecko Apr 13, 2026
d6e298d
Update function names
VeckoTheGecko Apr 13, 2026
e21b024
Update options to open_mfdataset
VeckoTheGecko Apr 13, 2026
dc652da
Fix imports in notebooks
VeckoTheGecko Apr 13, 2026
472930d
Remove combine="nested"
VeckoTheGecko Apr 13, 2026
9f7d78f
Update src/parcels/_datasets/remote.py
VeckoTheGecko Apr 13, 2026
feb67c1
Update copernicusmarine example dataset
VeckoTheGecko Apr 13, 2026
5255127
Merge branch 'main' into open-dataset
VeckoTheGecko Apr 13, 2026
7b05a54
Bump minimum Xarray dependency and transitive deps
VeckoTheGecko Apr 13, 2026
232b240
Fix nemo ingestion
VeckoTheGecko Apr 13, 2026
1b28579
Fix cf_xarray dep in minimum env
VeckoTheGecko Apr 13, 2026
7b4006e
Fix open_remote_dataset
VeckoTheGecko Apr 13, 2026
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
2 changes: 1 addition & 1 deletion .github/ci/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ requirements:
- netcdf4 >=1.7.2
- numpy >=2.1.0
- tqdm >=4.50.0
- xarray >=2024.5.0
- xarray >=2025.8.0
- cf_xarray >=0.8.6
- xgcm >=0.9.0
- zarr >=2.15.0,!=2.18.0,<3
Expand Down
13 changes: 6 additions & 7 deletions docs/getting_started/tutorial_output.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"import numpy as np\n",
"import xarray as xr\n",
"\n",
"import parcels"
"import parcels\n",
"import parcels.tutorial"
]
},
{
Expand All @@ -52,11 +53,9 @@
"outputs": [],
"source": [
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
"example_dataset_folder = parcels.download_example_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
"ds_fields = parcels.tutorial.open_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
")\n",
"\n",
"ds_fields = xr.open_mfdataset(f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\")\n",
"ds_fields.load() # load the dataset into memory\n",
"\n",
"# Convert to SGRID-compliant dataset and create FieldSet\n",
Expand Down Expand Up @@ -558,7 +557,7 @@
"metadata": {
"celltoolbar": "Metagegevens bewerken",
"kernelspec": {
"display_name": "test-notebooks",
"display_name": "default",
"language": "python",
"name": "python3"
},
Expand All @@ -572,7 +571,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.2"
"version": "3.14.3"
}
},
"nbformat": 4,
Expand Down
6 changes: 2 additions & 4 deletions docs/getting_started/tutorial_quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and writing output files that can be read with xarray.
import numpy as np
import xarray as xr
import parcels
import parcels.tutorial
```

## Input flow fields: `FieldSet`
Expand All @@ -29,11 +30,8 @@ hydrodynamics fields in which the particles are tracked. Here we provide an exam
[Global Ocean Physics Reanalysis](https://doi.org/10.48670/moi-00021) from the Copernicus Marine Service.

```{code-cell}
example_dataset_folder = parcels.download_example_dataset(
"CopernicusMarine_data_for_Argo_tutorial"
)
ds_fields = parcels.tutorial.open_dataset("CopernicusMarine_data_for_Argo_tutorial/data")

ds_fields = xr.open_mfdataset(f"{example_dataset_folder}/*.nc", combine="by_coords")
ds_fields.load() # load the dataset into memory
ds_fields
```
Expand Down
7 changes: 2 additions & 5 deletions docs/user_guide/examples/explanation_kernelloop.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,10 @@ import numpy as np
import xarray as xr

import parcels
import parcels.tutorial

# Load the CopernicusMarine data in the Agulhas region from the example_datasets
example_dataset_folder = parcels.download_example_dataset(
"CopernicusMarine_data_for_Argo_tutorial"
)

ds_fields = xr.open_mfdataset(f"{example_dataset_folder}/*.nc", combine="by_coords")
ds_fields = parcels.tutorial.open_dataset("CopernicusMarine_data_for_Argo_tutorial/data")
ds_fields.load() # load the dataset into memory

# Create an idealised wind field and add it to the dataset
Expand Down
7 changes: 3 additions & 4 deletions docs/user_guide/examples/tutorial_Argofloats.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,13 @@
"import xarray as xr\n",
"\n",
"import parcels\n",
"import parcels.tutorial\n",
"\n",
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
"example_dataset_folder = parcels.download_example_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
"ds_fields = parcels.tutorial.open_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
")\n",
"\n",
"ds_fields = xr.open_mfdataset(f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\")\n",
"\n",
"# TODO check how we can get good performance without loading full dataset in memory\n",
"ds_fields.load() # load the dataset into memory\n",
"\n",
Expand Down
11 changes: 1 addition & 10 deletions docs/user_guide/examples/tutorial_croco_3D.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,7 @@
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import xarray as xr\n",
"\n",
"import parcels\n",
"\n",
"data_folder = parcels.download_example_dataset(\"CROCOidealized_data\")\n",
"ds_fields = xr.open_dataset(data_folder / \"CROCO_idealized.nc\")\n",
"\n",
"ds_fields.load(); # Preload data to speed up access"
"import matplotlib.pyplot as plt\nimport numpy as np\nimport xarray as xr\n\nimport parcels\nimport parcels.tutorial\n\nds_fields = parcels.tutorial.open_dataset(\"CROCOidealized_data/data\")\n\nds_fields.load(); # Preload data to speed up access"
]
},
{
Expand Down
7 changes: 3 additions & 4 deletions docs/user_guide/examples/tutorial_delaystart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"from matplotlib.animation import FuncAnimation\n",
"\n",
"import parcels\n",
"import parcels.tutorial\n",
"\n",
"# for interactive display of animations\n",
"plt.rcParams[\"animation.html\"] = \"jshtml\""
Expand All @@ -50,11 +51,9 @@
"outputs": [],
"source": [
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
"example_dataset_folder = parcels.download_example_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
"ds_fields = parcels.tutorial.open_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
")\n",
"\n",
"ds_fields = xr.open_mfdataset(f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\")\n",
"ds_fields.load() # load the dataset into memory\n",
"\n",
"# Convert to SGRID-compliant dataset and create FieldSet\n",
Expand Down
11 changes: 4 additions & 7 deletions docs/user_guide/examples/tutorial_diffusion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
"import trajan as ta\n",
"import xarray as xr\n",
"\n",
"import parcels"
"import parcels\n",
"import parcels.tutorial"
]
},
{
Expand Down Expand Up @@ -467,12 +468,8 @@
"outputs": [],
"source": [
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
"example_dataset_folder = parcels.download_example_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
")\n",
"\n",
"ds_fields = xr.open_mfdataset(\n",
" f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\"\n",
"ds_fields = parcels.tutorial.open_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
").isel(depth=slice(0, 1))\n",
"ds_fields.load() # load the dataset into memory"
]
Expand Down
7 changes: 3 additions & 4 deletions docs/user_guide/examples/tutorial_dt_integrators.ipynb
Comment thread
VeckoTheGecko marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,12 @@
"import xarray as xr\n",
"\n",
"import parcels\n",
"import parcels.tutorial\n",
"\n",
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
"example_dataset_folder = parcels.download_example_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
"ds_fields = parcels.tutorial.open_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
")\n",
"\n",
"ds_fields = xr.open_mfdataset(f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\")\n",
"ds_fields.load() # load the dataset into memory\n",
"\n",
"# Convert to SGRID-compliant dataset and create FieldSet\n",
Expand Down
7 changes: 3 additions & 4 deletions docs/user_guide/examples/tutorial_gsw_density.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@
"import xarray as xr\n",
"\n",
"import parcels\n",
"import parcels.tutorial\n",
"\n",
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
"example_dataset_folder = parcels.download_example_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
"ds_fields = parcels.tutorial.open_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
")\n",
"\n",
"ds_fields = xr.open_mfdataset(f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\")\n",
"\n",
"# TODO check how we can get good performance without loading full dataset in memory\n",
"ds_fields.load() # load the dataset into memory\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@
"import xarray as xr\n",
"\n",
"import parcels\n",
"import parcels.tutorial\n",
"\n",
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
"example_dataset_folder = parcels.download_example_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
"ds_fields = parcels.tutorial.open_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
")\n",
"\n",
"ds_fields = xr.open_mfdataset(f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\")\n",
"ds_fields.load() # load the dataset into memory\n",
"\n",
"# Create an idealised wind field and add it to the dataset\n",
Expand Down
6 changes: 4 additions & 2 deletions docs/user_guide/examples/tutorial_mitgcm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
"import xarray as xr\n",
"\n",
"import parcels\n",
"import parcels.tutorial\n",
"\n",
"data_folder = parcels.download_example_dataset(\"MITgcm_example_data\")\n",
"ds_fields = xr.open_dataset(data_folder / \"mitgcm_UV_surface_zonally_reentrant.nc\")"
"ds_fields = parcels.tutorial.open_dataset(\n",
" \"MITgcm_example_data/mitgcm_UV_surface_zonally_reentrant\"\n",
")"
]
},
{
Expand Down
38 changes: 16 additions & 22 deletions docs/user_guide/examples/tutorial_nemo.ipynb
Comment thread
VeckoTheGecko marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"import numpy as np\n",
"import xarray as xr\n",
"\n",
"import parcels"
"import parcels\n",
"import parcels.tutorial"
]
},
{
Expand All @@ -66,17 +67,11 @@
"metadata": {},
"outputs": [],
"source": [
"data_folder = parcels.download_example_dataset(\"NemoCurvilinear_data\")\n",
"ds_fields = xr.open_mfdataset(\n",
" data_folder.glob(\"*.nc4\"),\n",
" data_vars=\"minimal\",\n",
" coords=\"minimal\",\n",
" compat=\"override\",\n",
")\n",
"\n",
"ds_coords = xr.open_dataset(data_folder / \"mesh_mask.nc4\", decode_times=False)\n",
"ds_u = parcels.tutorial.open_dataset(\"NemoCurvilinear_data_zonal/U\")\n",
"ds_v = parcels.tutorial.open_dataset(\"NemoCurvilinear_data_zonal/V\")\n",
"ds_coords = parcels.tutorial.open_dataset(\"NemoCurvilinear_data_zonal/mesh_mask\")\n",
"ds_fset = parcels.convert.nemo_to_sgrid(\n",
" fields=dict(U=ds_fields[\"U\"], V=ds_fields[\"V\"]), coords=ds_coords\n",
" fields=dict(U=ds_u[\"U\"], V=ds_v[\"V\"]), coords=ds_coords\n",
")\n",
"\n",
"fieldset = parcels.FieldSet.from_sgrid_conventions(ds_fset)"
Expand Down Expand Up @@ -291,16 +286,15 @@
"metadata": {},
"outputs": [],
"source": [
"data_folder = parcels.download_example_dataset(\"NemoNorthSeaORCA025-N006_data\")\n",
"ds_fields = xr.open_mfdataset(\n",
" data_folder.glob(\"ORCA*.nc\"),\n",
" data_vars=\"minimal\",\n",
" coords=\"minimal\",\n",
" compat=\"override\",\n",
")\n",
"ds_coords = xr.open_dataset(data_folder / \"coordinates.nc\", decode_times=False)\n",
"ds_u = parcels.tutorial.open_dataset(\"NemoNorthSeaORCA025-N006_data/U\")\n",
"ds_v = parcels.tutorial.open_dataset(\"NemoNorthSeaORCA025-N006_data/V\")\n",
"ds_w = parcels.tutorial.open_dataset(\"NemoNorthSeaORCA025-N006_data/W\")\n",
"ds_coords = parcels.tutorial.open_dataset(\"NemoNorthSeaORCA025-N006_data/mesh_mask\")[\n",
" [\"glamf\", \"gphif\"]\n",
"]\n",
"\n",
"ds_fset = parcels.convert.nemo_to_sgrid(\n",
" fields={\"U\": ds_fields[\"uo\"], \"V\": ds_fields[\"vo\"], \"W\": ds_fields[\"wo\"]},\n",
" fields={\"U\": ds_u[\"uo\"], \"V\": ds_v[\"vo\"], \"W\": ds_w[\"wo\"]},\n",
" coords=ds_coords,\n",
")\n",
"fieldset = parcels.FieldSet.from_sgrid_conventions(ds_fset)"
Expand Down Expand Up @@ -369,7 +363,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "docs",
"display_name": "default",
"language": "python",
"name": "python3"
},
Expand All @@ -383,7 +377,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.14.2"
"version": "3.14.3"
}
},
"nbformat": 4,
Expand Down
9 changes: 4 additions & 5 deletions docs/user_guide/examples/tutorial_sampling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"# To open and look at the temperature data\n",
"import xarray as xr\n",
"\n",
"import parcels"
"import parcels\n",
"import parcels.tutorial"
]
},
{
Expand All @@ -59,11 +60,9 @@
"outputs": [],
"source": [
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
"example_dataset_folder = parcels.download_example_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
"ds_fields = parcels.tutorial.open_dataset(\n",
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
")\n",
"\n",
"ds_fields = xr.open_mfdataset(f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\")\n",
"ds_fields.load() # load the dataset into memory\n",
"\n",
"# Convert to SGRID-compliant dataset and create FieldSet\n",
Expand Down
8 changes: 4 additions & 4 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ python = "3.11.*"
netcdf4 = "1.6.*"
numpy = "2.1.*"
tqdm = "4.50.*"
xarray = "2024.5.*"
xarray = "2025.8.*"
uxarray = "2025.3.*"
dask = "2024.5.*"
zarr = "2.15.*"
dask = "2024.6.*"
zarr = "2.18.*"
xgcm = { version = "0.9.*", channel = "conda-forge" }
cf_xarray = "0.8.*"
cf_xarray = "0.10.*"
cftime = "1.6.*"
pooch = "1.8.*"

Expand Down
3 changes: 0 additions & 3 deletions src/parcels/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
ParticleSetWarning,
)
from parcels._logger import logger
from parcels._tutorial import download_example_dataset, list_example_datasets

__all__ = [ # noqa: RUF022
# Core classes
Expand Down Expand Up @@ -68,8 +67,6 @@
"ParticleSetWarning",
# Utilities
"logger",
"download_example_dataset",
"list_example_datasets",
]

_stdlib_warnings.warn(
Expand Down
Loading
Loading