Skip to content

Commit 9b196ea

Browse files
Updating the list of breaking changes in v3 to v4 API
1 parent 25fb9d0 commit 9b196ea

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

docs/v4/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The key goals of this update are
77
1. to support `Fields` on unstructured grids;
88
2. to allow for user-defined interpolation methods (somewhat similar to user-defined kernels);
99
3. to make the codebase more modular, easier to extend, and more maintainable;
10-
4. to align Parcels more with other tools in the [Pangeo ecosystemand](https://www.pangeo.io/#ecosystem), particularly by leveraging `xarray` more; and
10+
4. to align Parcels more with other tools in the [Pangeo ecosystem](https://www.pangeo.io/#ecosystem), particularly by leveraging `xarray` more; and
1111
5. to improve the performance of Parcels.
1212

1313
The timeline for the release of Parcels v4 is not yet fixed, but we are aiming for a release of an 'alpha' version in September 2025. This v4-alpha will have support for unstructured grids and user-defined interpolation methods, but is not yet performance-optimised.

v3to4-breaking-changes.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
Kernels:
1+
## Kernels:
22

3-
- `particle.delete()` is no longer valid. Have to do `particle.state = StatusCode.Delete`
4-
- Sharing state between kernels must be done via the particle data (as now the kernels are not combined under the hood).
5-
- dt is a np.timedelta64 object
3+
- The Kernel loop has been 'vectorized', so that the input of a Kernel is not one particle anymore, but a list of particles. This means that `if`-statements in Kernels don't work anymore. Replace `if`-statements with `numpy.where` statements.
4+
- `particle.delete()` is no longer valid. Instead, use `particle.state = StatusCode.Delete`.
5+
- Sharing state between kernels must be done via the particle data (as the kernels are not combined under the hood anymore).
6+
- `particl_dlon`, `particle_dlat` etc have been renamed to `particle.dlon` and `particle.dlat`.
7+
- `particle.dt` is a np.timedelta64 object; be careful when multiplying `particle.dt` with a velocity, as its value may be cast to nanoseconds.
8+
- The `time` argument in the Kernel signature is now standard `None` (and may be removed in the Kernel API before release of v4), so can't be used. Use `particle.time` instead.
69

7-
FieldSet
10+
## FieldSet
811

9-
- `interp_method` has to be an Interpolation function, instead of a string
12+
- `interp_method` has to be an Interpolation function, instead of a string.
1013

11-
ParticleSet
14+
## ParticleSet
1215

13-
- ParticleSet init had `repeatdt` and `lonlatdepth_dtype` removed
14-
- ParticleSet.execute() expects `numpy.datetime64`/`numpy.timedelta.64` for `runtime`, `endtime` and `dt`
15-
- `ParticleSet.from_field()`, `ParticleSet.from_line()`, `ParticleSet.from_list()` has been removed
16+
- `repeatdt` and `lonlatdepth_dtype` have been removed from the ParticleSet.
17+
- ParticleSet.execute() expects `numpy.datetime64`/`numpy.timedelta.64` for `runtime`, `endtime` and `dt`.
18+
- `ParticleSet.from_field()`, `ParticleSet.from_line()`, `ParticleSet.from_list()` have been removed.

0 commit comments

Comments
 (0)