Skip to content

Rethinking repeatdt API for v4 #2085

@erikvansebille

Description

@erikvansebille

Working on Parcels v4, it might also be a good moment to rethink the API for ParticleSet.repeatdt. In v3, users can provide a time-interval on which to release the particles during ParticleSet creation (default is None). See also the delayed time tutorial

However, the functionality is slow, primarily because the number of trajectories in the zarr ParticleFile can now grow.

On the other hand, users like this feature a lot, which is why we axed my proposal earlier in #1387 to remove the functionality.

I see a few options:

  1. Keep the API as is now, and accept the performance loss in zarr-writing
  2. Remove the functionality altogether and ask users to provide the entire ParticleSet on initialisation (by assigning the time for each particle, as detailed in this part of the delayed time tutorial
  3. Move the repeatdt argument to pset.execute, so that we can calculate how ofter the repeat has to be done (based on runtime). Note that this will also mean ParticleFile needs to be initialised inside the pset.execute(), and that this could severely interfere with the capability to run pset.execute multiple times in e.g. a for-loop
  4. Ask the users to not only specify the repeatdt interval, but also the number of releases (or, alternatively the runtime), so that we can assign the full ParticleSet during initialisation under the hood

My preference would be option 4, but this places a (small) extra burden on users to specify the number of releases... What do others think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions