Skip to content

Migrate to Parcels v4 - #342

Draft
j-atkins wants to merge 62 commits into
mainfrom
migrate-v4
Draft

Migrate to Parcels v4#342
j-atkins wants to merge 62 commits into
mainfrom
migrate-v4

Conversation

@j-atkins

@j-atkins j-atkins commented May 20, 2026

Copy link
Copy Markdown
Collaborator

WIP

Checklist/current status:

  • Update instrument kernels
  • Update fieldset ingestion workflows
  • Update to Parquet output
  • Implement new fieldset/performance handling strategy, i.e. new v4 docs
  • Implement Refactor underway instruments #231
  • Check expedition / workflow
    • including underway instruments
    • Argo float bug [in kernel(s)?], immediately goes out of bounds after first timestep... likely depth convention related
  • Implement initial timestep sampling (i.e. Parcels #2622)
  • Update tests
  • Add new tests for v4 specific logic(?)
  • Update docs / tutorials (e.g. notebooks using .zarr output) [new PR?]

@j-atkins
j-atkins changed the base branch from main to update-docs-sensors May 20, 2026 15:02
@j-atkins
j-atkins force-pushed the update-docs-sensors branch from f474279 to 0fe1340 Compare May 21, 2026 08:24
Base automatically changed from update-docs-sensors to main May 21, 2026 09:08
@j-atkins

j-atkins commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Hi @erikvansebille and @VeckoTheGecko, here's the latest draft of VirtualShip migration to Parcels v4 (still a WIP though). No need to review properly at this point, it's for your reference in case you are curious whilst I'm away over the next couple of weeks!

j-atkins added 4 commits July 17, 2026 13:10
* small refactor: consolidate spacetime_buffer_size and limit_spec dicts for clarity

* to FetchSpec dataclass

* new test for FetchSpec class
* add tmp file write/read step

* small refactor: consolidate spacetime_buffer_size and limit_spec dicts for clarity

* to FetchSpec dataclass

* add tmp file write/read step

* remove depth axis reversal now using depth='elevation' in copernicusmarine.open_dataset()

* tidy up todo

* small update: fetch spec to match changes implemented in #359

* add test for _via_tmp_ds

* add to_windowed_arrays() back in
* instrument type property, conditional windowed arrays

* add instrument_type/is_underway property tests to ADCP instrument tests

* update tests across all instruments for instrument type property/is underway, incl. some refactoring

* clean-up for review

* Apply suggestions from code review

Co-authored-by: Erik van Sebille <e.vansebille@uu.nl>

---------

Co-authored-by: Erik van Sebille <e.vansebille@uu.nl>
@j-atkins j-atkins mentioned this pull request Jul 30, 2026
* first changes; Parcels v4 API

* move to using field.eval for UV sampling, plus call to custom write-to-parquet

* custom write-to-parquet for underway instruments

* instrument type property, conditional windowed arrays

* tidy up

* sample individual U and V fields for m s-1 units

* fix u, v sampling to use correct sampling and conversions

* new intermediate UnderwayInstrument base class (parquet writing moved over from utils), change kernels to special-case underway kernels

* fix intermediate class logic so that sensor_kernels check is only triggered for final instrument child classes

* remove support for depth as None

* use coords for adcp 'kernel'

* add validtion to UnderwayCoordinates class, rename func

* migrate UnderwaterST instrument to new underway instrument logic

* fix func name

* add new tests and refine for intermediate UnderwayInstrument class

* update ADCP tests

* tidy up comments

* update UnderwaterST tests

* use fieldset.time_interval.left / right for fieldset start / end times

* particle_id is constant for underway instruments

* dt and state are unnecessary for public facing output

* add test for monitoring for schema drift vs. parcels, plus some refactoring

* Update tests/instruments/test_base.py

Co-authored-by: Erik van Sebille <erikvansebille@gmail.com>

* remove dev spinner bypass option

* parcels simulation only needs one write step

---------

Co-authored-by: Erik van Sebille <erikvansebille@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant