-
Notifications
You must be signed in to change notification settings - Fork 168
Open
Labels
featurehackathon2025Good issues for the hackathon at the Parcels anniversary event in 2025.Good issues for the hackathon at the Parcels anniversary event in 2025.v4
Description
Part of #2106
With the JIT code conversion gone in v4-dev of Parcels, there are some warnings that were implemented in codegenerator.py regarding correctness:
- "Don't change the location of a particle directly in a Kernel. Use particle_dlon, particle_dlat, etc."
- "Be careful when sampling particle.(xi/yi/zi), as this is updated in the kernel loop. Best to place the sampling statement before advection."
That aren't implemented anymore. AFAIK (please confirm @erikvansebille) these warnings only came up during JIT mode, and never during Scipy mode.
Additionally, with the kernel syntax changes we can expect to land in v4 (see parent issue), having warnings in the following format would be helpful:
`particle.delete()` is no longer valid syntax in Parcels kernels - it looks like you're using a kernel written for parcels<4 . HINT: Use `particle.status = StatusCode.Delete` instead. See our migration guide at https://docs.oceanparcels.org/... for more info.
This would also allow us to identify kernels that are written for older versions of Parcels (not just for v3->v4, but also for older versions if we want), and giving users helpful error messages with instructions for upgrading their kernels.
Suggestion:
- Before compiling kernels with numba, we have a kernel linting step.
- This will inspect the source code and:
- Error out informatively if the kernel is incompatible with the new version of Parcels
- Provide a warning if correctness is a concern
- Importantly, the users code will not be altered under the hood.
- This will inspect the source code and:
Metadata
Metadata
Assignees
Labels
featurehackathon2025Good issues for the hackathon at the Parcels anniversary event in 2025.Good issues for the hackathon at the Parcels anniversary event in 2025.v4
Type
Projects
Status
Backlog
Status
Backlog