Skip to content

Commit 0333dff

Browse files
Update default value of particlefile chunks to length of pset
This fixes a bug where zarr output file writing can be _very_ slow when only one particle is released on the first day of simulation (since the default chunksize was set to the number of particles to write the first time, instead of the length of the ParticleSet)
1 parent 92548e1 commit 0333dff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

parcels/particlefile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def write(self, pset, time: float | timedelta | np.timedelta64 | None, indices=N
304304

305305
if self.create_new_zarrfile:
306306
if self.chunks is None:
307-
self._chunks = (len(ids), 1)
307+
self._chunks = (len(pset), 1)
308308
if pset._repeatpclass is not None and self.chunks[0] < 1e4: # type: ignore[index]
309309
warnings.warn(
310310
f"ParticleFile chunks are set to {self.chunks}, but this may lead to "

0 commit comments

Comments
 (0)