Skip to content

Commit cfd9648

Browse files
Merge branch 'main' into update_docs
2 parents fb7afd2 + 08a0a26 commit cfd9648

45 files changed

Lines changed: 912 additions & 541 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/additional.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
env:
1616
COLUMNS: 120
1717
steps:
18-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1919
with:
2020
persist-credentials: false
2121
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
@@ -35,7 +35,7 @@ jobs:
3535
contents: read
3636

3737
steps:
38-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
38+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
3939
with:
4040
persist-credentials: false
4141
- uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6

.github/workflows/ci.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
github.repository == 'Parcels-code/Parcels'
2727
&& (github.event_name == 'push' || github.event_name == 'pull_request')
2828
steps:
29-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
3030
with:
3131
fetch-depth: 2
3232
persist-credentials: false
@@ -49,7 +49,7 @@ jobs:
4949
cache-key: ${{ steps.pixi-lock.outputs.cache-key }}
5050
pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }}
5151
steps:
52-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
52+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
5353
with:
5454
persist-credentials: false
5555
- uses: Parcels-code/pixi-lock/create-and-cache@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
@@ -82,7 +82,7 @@ jobs:
8282
- os: ubuntu
8383
pixi-environment: "test-minimum"
8484
steps:
85-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
85+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
8686
with:
8787
persist-credentials: false
8888
- name: Restore cached pixi lockfile
@@ -98,7 +98,7 @@ jobs:
9898
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
9999
- name: Restore cached hypothesis directory
100100
id: restore-hypothesis-cache
101-
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
101+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
102102
with:
103103
path: .hypothesis/
104104
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
@@ -112,7 +112,7 @@ jobs:
112112
- name: Save cached hypothesis directory
113113
id: save-hypothesis-cache
114114
if: always() && steps.unit-test.outcome != 'skipped'
115-
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
115+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
116116
with:
117117
path: .hypothesis/
118118
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
@@ -142,7 +142,7 @@ jobs:
142142
os: [ubuntu]
143143
pixi-environment: [test]
144144
steps:
145-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
145+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
146146
with:
147147
persist-credentials: false
148148
- name: Restore cached pixi lockfile
@@ -158,7 +158,7 @@ jobs:
158158
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
159159
- name: Restore cached hypothesis directory
160160
id: restore-hypothesis-cache
161-
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
161+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
162162
with:
163163
path: .hypothesis/
164164
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
@@ -172,7 +172,7 @@ jobs:
172172
- name: Save cached hypothesis directory
173173
id: save-hypothesis-cache
174174
if: always() && steps.unit-test.outcome != 'skipped'
175-
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
175+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
176176
with:
177177
path: .hypothesis/
178178
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
@@ -197,7 +197,7 @@ jobs:
197197
env:
198198
COVERAGE_REPORT: "ubuntu_test_validation_test_report.html"
199199
steps:
200-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
200+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
201201
with:
202202
persist-credentials: false
203203
- name: Restore cached pixi lockfile
@@ -213,7 +213,7 @@ jobs:
213213
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
214214
- name: Restore cached hypothesis directory
215215
id: restore-hypothesis-cache
216-
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
216+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
217217
with:
218218
path: .hypothesis/
219219
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
@@ -227,7 +227,7 @@ jobs:
227227
- name: Save cached hypothesis directory
228228
id: save-hypothesis-cache
229229
if: always() && steps.unit-test.outcome != 'skipped'
230-
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
230+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
231231
with:
232232
path: .hypothesis/
233233
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
@@ -263,7 +263,7 @@ jobs:
263263
- os: ubuntu
264264
python-version: "3.11"
265265
steps:
266-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
266+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
267267
with:
268268
persist-credentials: false
269269
- name: Restore cached pixi lockfile
@@ -312,7 +312,7 @@ jobs:
312312
contents: read
313313
steps:
314314
- name: Checkout
315-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
315+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
316316
with:
317317
persist-credentials: false
318318
- name: Restore cached pixi lockfile
@@ -341,7 +341,7 @@ jobs:
341341
id-token: write
342342
runs-on: ubuntu-latest
343343
steps:
344-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
344+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
345345
with:
346346
fetch-depth: 0
347347
persist-credentials: false
@@ -375,9 +375,9 @@ jobs:
375375
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
376376
steps:
377377
- name: Checkout repository
378-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
378+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
379379
with:
380380
persist-credentials: false
381381

382382
- name: Run zizmor
383-
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
383+
uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7

.github/workflows/pypi-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
permissions:
1818
contents: read
1919
steps:
20-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2121
with:
2222
fetch-depth: 0
2323
persist-credentials: false

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
- id: zizmor
1616
args: ["--offline"]
1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.15.18
18+
rev: v0.15.20
1919
hooks:
2020
- id: ruff
2121
name: ruff lint (.py)
@@ -28,7 +28,7 @@ repos:
2828
- id: ruff-format
2929
types_or: [python, jupyter]
3030
- repo: https://github.com/rbubley/mirrors-prettier # Update mirror as official mirror is deprecated
31-
rev: v3.8.4
31+
rev: v3.9.1
3232
hooks:
3333
- id: prettier
3434

docs/user_guide/examples/tutorial_write_in_kernel.ipynb

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@
111111
"cell_type": "code",
112112
"execution_count": null,
113113
"id": "9",
114-
"metadata": {},
114+
"metadata": {
115+
"tags": [
116+
"hide-output"
117+
]
118+
},
115119
"outputs": [],
116120
"source": [
117121
"# Load the CopernicusMarine data in the Agulhas region from the example_datasets\n",
@@ -187,7 +191,11 @@
187191
"cell_type": "code",
188192
"execution_count": null,
189193
"id": "14",
190-
"metadata": {},
194+
"metadata": {
195+
"tags": [
196+
"hide-output"
197+
]
198+
},
191199
"outputs": [],
192200
"source": [
193201
"output_file_both = parcels.ParticleFile(\n",
@@ -217,16 +225,24 @@
217225
" runtime=np.timedelta64(4, \"h\"),\n",
218226
" dt=np.timedelta64(15, \"m\"),\n",
219227
" output_file=output_file_both, # the file that writes at regular intervals\n",
220-
")\n",
221-
"\n",
228+
")"
229+
]
230+
},
231+
{
232+
"cell_type": "code",
233+
"execution_count": null,
234+
"id": "15",
235+
"metadata": {},
236+
"outputs": [],
237+
"source": [
222238
"df = parcels.read_particlefile(output_file_both.path)\n",
223239
"assert len(df) == 6 # 2 particles * 3 time steps (0h, 2h, 2h15m)\n",
224240
"df"
225241
]
226242
},
227243
{
228244
"cell_type": "markdown",
229-
"id": "15",
245+
"id": "16",
230246
"metadata": {},
231247
"source": [
232248
"As you can see in the output above, each particle is now written three times, at 0h, at 2h, and at 2h15m when the particle is deleted.\n",

docs/user_guide/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ examples/tutorial_delaystart.ipynb
5151
examples/explanation_kernelloop.md
5252
examples/tutorial_sampling.ipynb
5353
examples/tutorial_statuscodes.ipynb
54+
examples/tutorial_write_in_kernel.ipynb
5455
```
5556

5657
```{toctree}

docs/user_guide/v4-migration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Version 4 of Parcels is unreleased at the moment. The information in this migrat
1818
- Users need to explicitly use `convert_z_to_sigma_croco` in sampling kernels (such as the `AdvectionRK4_3D_CROCO` or `SampleOMegaCroco` kernels) when working with CROCO data, as the automatic conversion from depth to sigma grids under the hood has been removed.
1919
- We added a new AdvectionRK2 Kernel. The AdvectionRK4 kernel is still available, but RK2 is now the recommended default advection scheme as it is faster while the accuracy is comparable for most applications. See also the Choosing an integration method tutorial.
2020
- Functions shouldn't be converted to Kernels before adding to a pset.execute() call. Instead, simply pass the function(s) as a list to pset.execute().
21+
- Kernel variables `lat` and `lon` have been renamed to `y` and `x`, and `dlat` and `dlon` have been renamed to `dy` and `dx`. These changes are also reflected on the ParticleSet as well as the ParticleFile output.
2122

2223
## FieldSet
2324

@@ -44,6 +45,7 @@ Version 4 of Parcels is unreleased at the moment. The information in this migrat
4445
- The `name` argument in `ParticleFile` has been replaced by `path` and can now be a string or a Path.
4546
- The `chunks` argument in `ParticleFile` has been removed.
4647
- The `to_write="once"`option has been removed. A variable can now only be either written at every output time step, or not written at all.
48+
- Particles are not written when they are deleted. You can use the functionality to call `ParticleFile.write()` inside a kernel to write out deleted particles if you want to keep track of them.
4749

4850
## Field
4951

pixi.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ holoviews = ">=1.22.0" # https://github.com/prefix-dev/rattler-build/issues/2326
3030
uxarray = ">=2026.04.1"
3131
dask = ">=2024.5.1"
3232
zarr = ">=3"
33-
xgcm = { git = "https://github.com/xgcm/xgcm", rev = "master" } # TODO: Switch to release version after release is cut
33+
xgcm = { git = "https://github.com/xgcm/xgcm", rev = "532a3c567c475cbe192f49b9961f8117806bbfb7" } # TODO: Switch to release version after release is cut
3434
cf_xarray = ">=0.8.6"
3535
cftime = ">=1.6.3"
3636
pooch = ">=1.8.0"

src/parcels/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import warnings as _stdlib_warnings
1111

1212
from parcels._core.fieldset import FieldSet
13+
from parcels._xarray import open_raw_zarr
1314
from parcels._core.particleset import ParticleSet
1415
from parcels._core.particlefile import ParticleFile, read_particlefile
1516
from parcels._core.particle import (
@@ -42,6 +43,7 @@
4243
__all__ = [ # noqa: RUF022
4344
# Core classes
4445
"FieldSet",
46+
"open_raw_zarr",
4547
"ParticleSet",
4648
"ParticleFile",
4749
"Variable",
@@ -61,6 +63,7 @@
6163
"OutsideTimeInterval",
6264
"StatusCode",
6365
# Warnings
66+
"FieldEvalWarning",
6467
"FieldSetWarning",
6568
"FileWarning",
6669
"KernelWarning",

src/parcels/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Import helpers for compatability between installations."""
22

33

4-
# for compat with v3 of parcels when users provide `initial=attrgetter("lon")` to a Variable
4+
# for compat with v3 of parcels when users provide `initial=attrgetter("...")` to a Variable
55
# so that particle initial state matches another variable
66
class _AttrgetterHelper:
77
"""

0 commit comments

Comments
 (0)