Repository navigation
[BUGFIX] ParticleFile.write and read_particlefile memory footprint - #3083
Merged
erikvansebille merged 4 commits intoDec 1, 2026
Merged
erikvansebille merged 4 commits into
erikvansebille merged 4 commits into
Conversation
ShaivanBhagat
approved these changes
Nov 30, 2026
ShaivanBhagat
left a comment
There was a problem hiding this comment.
Looks good. Is now quicker to load data. Tested using the ctd.parquet file (https://surfdrive.surf.nl/s/PsaG23Psn2jpXb4) against Parcels 4.0.3 (current release)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Following work in the VirtualShip repository (Parcels-code/virtualship#433), I was surprised that the
read_particlefile()function had such a large memory footprint. So I compared reading in a 90MB CTD file (see https://surfdrive.surf.nl/s/PsaG23Psn2jpXb4) withparcels.read_particlefile(),polars.read_parquet()andpandas.read_parquet()With help of CoPilot, I found two issues in our particlefile writing and reading routines:
ParticleFile.write(), even if there were no particles to write. This is now fixed in e191027These two changes make writing and reading Parcels parquet files much more efficient
Checklist
mainfor normal development,v3-supportfor v3 support)AI Disclosure
I have asked COPilot to help me profile the
parcels.read_particlefile()method, and then help me fix its large memory footprint