Skip to content

Commit ffb4f2f

Browse files
Add parcels._datasets.remote (#2574)
Co-authored-by: Erik van Sebille <e.vansebille@uu.nl>
1 parent 63f60fe commit ffb4f2f

27 files changed

+450
-370
lines changed

.github/ci/recipe.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ requirements:
3535
- netcdf4 >=1.7.2
3636
- numpy >=2.1.0
3737
- tqdm >=4.50.0
38-
- xarray >=2024.5.0
38+
- xarray >=2025.8.0
3939
- cf_xarray >=0.8.6
4040
- xgcm >=0.9.0
4141
- zarr >=2.15.0,!=2.18.0,<3

docs/getting_started/tutorial_output.ipynb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"import numpy as np\n",
3636
"import xarray as xr\n",
3737
"\n",
38-
"import parcels"
38+
"import parcels\n",
39+
"import parcels.tutorial"
3940
]
4041
},
4142
{
@@ -52,11 +53,9 @@
5253
"outputs": [],
5354
"source": [
5455
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
55-
"example_dataset_folder = parcels.download_example_dataset(\n",
56-
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
56+
"ds_fields = parcels.tutorial.open_dataset(\n",
57+
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
5758
")\n",
58-
"\n",
59-
"ds_fields = xr.open_mfdataset(f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\")\n",
6059
"ds_fields.load() # load the dataset into memory\n",
6160
"\n",
6261
"# Convert to SGRID-compliant dataset and create FieldSet\n",
@@ -558,7 +557,7 @@
558557
"metadata": {
559558
"celltoolbar": "Metagegevens bewerken",
560559
"kernelspec": {
561-
"display_name": "test-notebooks",
560+
"display_name": "default",
562561
"language": "python",
563562
"name": "python3"
564563
},
@@ -572,7 +571,7 @@
572571
"name": "python",
573572
"nbconvert_exporter": "python",
574573
"pygments_lexer": "ipython3",
575-
"version": "3.14.2"
574+
"version": "3.14.3"
576575
}
577576
},
578577
"nbformat": 4,

docs/getting_started/tutorial_quickstart.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and writing output files that can be read with xarray.
2020
import numpy as np
2121
import xarray as xr
2222
import parcels
23+
import parcels.tutorial
2324
```
2425

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

3132
```{code-cell}
32-
example_dataset_folder = parcels.download_example_dataset(
33-
"CopernicusMarine_data_for_Argo_tutorial"
34-
)
33+
ds_fields = parcels.tutorial.open_dataset("CopernicusMarine_data_for_Argo_tutorial/data")
3534
36-
ds_fields = xr.open_mfdataset(f"{example_dataset_folder}/*.nc", combine="by_coords")
3735
ds_fields.load() # load the dataset into memory
3836
ds_fields
3937
```

docs/user_guide/examples/explanation_kernelloop.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,10 @@ import numpy as np
5353
import xarray as xr
5454
5555
import parcels
56+
import parcels.tutorial
5657
5758
# Load the CopernicusMarine data in the Agulhas region from the example_datasets
58-
example_dataset_folder = parcels.download_example_dataset(
59-
"CopernicusMarine_data_for_Argo_tutorial"
60-
)
61-
62-
ds_fields = xr.open_mfdataset(f"{example_dataset_folder}/*.nc", combine="by_coords")
59+
ds_fields = parcels.tutorial.open_dataset("CopernicusMarine_data_for_Argo_tutorial/data")
6360
ds_fields.load() # load the dataset into memory
6461
6562
# Create an idealised wind field and add it to the dataset

docs/user_guide/examples/tutorial_Argofloats.ipynb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,13 @@
110110
"import xarray as xr\n",
111111
"\n",
112112
"import parcels\n",
113+
"import parcels.tutorial\n",
113114
"\n",
114115
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
115-
"example_dataset_folder = parcels.download_example_dataset(\n",
116-
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
116+
"ds_fields = parcels.tutorial.open_dataset(\n",
117+
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
117118
")\n",
118119
"\n",
119-
"ds_fields = xr.open_mfdataset(f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\")\n",
120-
"\n",
121120
"# TODO check how we can get good performance without loading full dataset in memory\n",
122121
"ds_fields.load() # load the dataset into memory\n",
123122
"\n",

docs/user_guide/examples/tutorial_croco_3D.ipynb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,7 @@
3434
"metadata": {},
3535
"outputs": [],
3636
"source": [
37-
"import matplotlib.pyplot as plt\n",
38-
"import numpy as np\n",
39-
"import xarray as xr\n",
40-
"\n",
41-
"import parcels\n",
42-
"\n",
43-
"data_folder = parcels.download_example_dataset(\"CROCOidealized_data\")\n",
44-
"ds_fields = xr.open_dataset(data_folder / \"CROCO_idealized.nc\")\n",
45-
"\n",
46-
"ds_fields.load(); # Preload data to speed up access"
37+
"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"
4738
]
4839
},
4940
{

docs/user_guide/examples/tutorial_delaystart.ipynb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"from matplotlib.animation import FuncAnimation\n",
3131
"\n",
3232
"import parcels\n",
33+
"import parcels.tutorial\n",
3334
"\n",
3435
"# for interactive display of animations\n",
3536
"plt.rcParams[\"animation.html\"] = \"jshtml\""
@@ -50,11 +51,9 @@
5051
"outputs": [],
5152
"source": [
5253
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
53-
"example_dataset_folder = parcels.download_example_dataset(\n",
54-
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
54+
"ds_fields = parcels.tutorial.open_dataset(\n",
55+
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
5556
")\n",
56-
"\n",
57-
"ds_fields = xr.open_mfdataset(f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\")\n",
5857
"ds_fields.load() # load the dataset into memory\n",
5958
"\n",
6059
"# Convert to SGRID-compliant dataset and create FieldSet\n",

docs/user_guide/examples/tutorial_diffusion.ipynb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@
119119
"import trajan as ta\n",
120120
"import xarray as xr\n",
121121
"\n",
122-
"import parcels"
122+
"import parcels\n",
123+
"import parcels.tutorial"
123124
]
124125
},
125126
{
@@ -467,12 +468,8 @@
467468
"outputs": [],
468469
"source": [
469470
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
470-
"example_dataset_folder = parcels.download_example_dataset(\n",
471-
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
472-
")\n",
473-
"\n",
474-
"ds_fields = xr.open_mfdataset(\n",
475-
" f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\"\n",
471+
"ds_fields = parcels.tutorial.open_dataset(\n",
472+
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
476473
").isel(depth=slice(0, 1))\n",
477474
"ds_fields.load() # load the dataset into memory"
478475
]

docs/user_guide/examples/tutorial_dt_integrators.ipynb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@
5959
"import xarray as xr\n",
6060
"\n",
6161
"import parcels\n",
62+
"import parcels.tutorial\n",
6263
"\n",
6364
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
64-
"example_dataset_folder = parcels.download_example_dataset(\n",
65-
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
65+
"ds_fields = parcels.tutorial.open_dataset(\n",
66+
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
6667
")\n",
67-
"\n",
68-
"ds_fields = xr.open_mfdataset(f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\")\n",
6968
"ds_fields.load() # load the dataset into memory\n",
7069
"\n",
7170
"# Convert to SGRID-compliant dataset and create FieldSet\n",

docs/user_guide/examples/tutorial_gsw_density.ipynb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,13 @@
3636
"import xarray as xr\n",
3737
"\n",
3838
"import parcels\n",
39+
"import parcels.tutorial\n",
3940
"\n",
4041
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
41-
"example_dataset_folder = parcels.download_example_dataset(\n",
42-
" \"CopernicusMarine_data_for_Argo_tutorial\"\n",
42+
"ds_fields = parcels.tutorial.open_dataset(\n",
43+
" \"CopernicusMarine_data_for_Argo_tutorial/data\"\n",
4344
")\n",
4445
"\n",
45-
"ds_fields = xr.open_mfdataset(f\"{example_dataset_folder}/*.nc\", combine=\"by_coords\")\n",
46-
"\n",
4746
"# TODO check how we can get good performance without loading full dataset in memory\n",
4847
"ds_fields.load() # load the dataset into memory\n",
4948
"\n",

0 commit comments

Comments
 (0)