-
Notifications
You must be signed in to change notification settings - Fork 168
Rework of Particle class, and Particle data creation #2134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…assert .zarr file extension MPI is not yet supported in v4-dev anyway, and MPI will likely be implemented differently (#2074).
This makes it distinct what a particle is on the "particle type" level (defining what attributes exist etc) and on the kernel level (i.e., just a link to the particle data. Naming is a WIP
This allows users to get a default particle of differing spatial precision. This replaces the argument `lonlatdepth_dtype` that was previously used on the ParticleSet init.
Make it explicitly an initial dict rather than as kwargs
Not sure why this is necessary since I only refactored the way the particle data was created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the code (see below) to temporarily set time to np.nat until we know the sign of dt in execute() stays as it is?
https://github.com/OceanParcels/Parcels/blob/30aec22d2939e285bfbd44f6617e36019002f6d3/parcels/particleset.py#L100-L103
and
https://github.com/OceanParcels/Parcels/blob/30aec22d2939e285bfbd44f6617e36019002f6d3/parcels/particleset.py#L536-L540
That would be fine with me; but it could perhaps be a bit more transparently coded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, something to keep in mind when we refactor the particleset execute loop
0afb92a to
6d8bbce
Compare
6d8bbce to
ab67bd4
Compare
For internal consistency with the CF trajectory output spec. cc @erikvansebille
|
@erikvansebille after syncing this branch with v4-dev, I am getting some strange infinite loop bugs in the following tests to do with the RK45 kernel ..... I'm not really sure how to go about solving them at the moment, perhaps if you have a second tomorrow we can look through together since you're familiar with the rk45 kernel? (or can
|
For some reason RK45 was set so strict that it reduced dt to 1 second, severely slowing down the tests
Local environment was desynced with CI - accidentally included zarr v3 code. Let's stick to v2 for now then upgrade later
Changes:
VariableandParticleclasses, making the dictinction between aParticleClass(a type of Particle), and aKernelParticle(an accessor class used to read and set particle data in the arrays). This clarification allows for clearer abstractions and consolidation of responsibility (helping with testing).lonlatdepth_dtypefrom particleset initget_default_particle(dtype: np.float32 | np.float64)which allows users to create particles with the right precision from the beginning (rather than redefining after the fact).create_particle_datathat works from the particle class, ngrids, time_interval, initialWould be good to also discuss variable naming - let me know if you have any suggestions.
v4-devfor v4 changes)