You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/community/v4-migration.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,18 @@
1
-
## Kernels:
1
+
#Parcels v4 migration guide
2
2
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.
3
+
```{warning}
4
+
Version 4 of Parcels is unreleased at the moment. The information in this migration guide is a work in progress, and is subject to change. If you would like to provide feedback on this migration guide (or generally on the development of v4) please [submit an issue](https://github.com/OceanParcels/Parcels/issues/new/choose).
5
+
```
6
+
7
+
## Kernels
8
+
9
+
- The Kernel loop has been 'vectorized', so that the input of a Kernel is not one particle anymore, but a collection of particles. This means that `if`-statements in Kernels don't work anymore. Replace `if`-statements with `numpy.where` statements.
4
10
-`particle.delete()` is no longer valid. Instead, use `particle.state = StatusCode.Delete`.
5
11
- Sharing state between kernels must be done via the particle data (as the kernels are not combined under the hood anymore).
6
12
-`particl_dlon`, `particle_dlat` etc have been renamed to `particle.dlon` and `particle.dlat`.
7
13
-`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
14
- 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.
15
+
-`math` functions should be replaced with array compatible equivalents (e.g., `math.sin` -> `np.sin`). Instead of `ParcelsRandom` you should use numpy's random functions.
9
16
10
17
## FieldSet
11
18
@@ -16,3 +23,7 @@
16
23
-`repeatdt` and `lonlatdepth_dtype` have been removed from the ParticleSet.
17
24
- ParticleSet.execute() expects `numpy.datetime64`/`numpy.timedelta.64` for `runtime`, `endtime` and `dt`.
18
25
-`ParticleSet.from_field()`, `ParticleSet.from_line()`, `ParticleSet.from_list()` have been removed.
26
+
27
+
## ParticleFile
28
+
29
+
- Particlefiles should be created by `ParticleFile(...)` instead of `pset.ParticleFile(...)`
0 commit comments