Skip to content

Commit 6670b40

Browse files
authored
Update particleset.py to make partition_function work when repeatdt is used
There was a bug where deleting the partition_function from the _repeatkwargs property of the particleset class also removed from the kwargs for the initial particleset creation when the repeatdt option was used. This fixes that bug by making a shallow copy of kwargs when creating _repeatkwargs.
1 parent 76e3233 commit 6670b40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

parcels/particleset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def ArrayClass_init(self, *args, **kwargs):
199199
if time[0] and not np.allclose(time, time[0]):
200200
raise ValueError("All Particle.time should be the same when repeatdt is not None")
201201
self._repeatpclass = pclass
202-
self._repeatkwargs = kwargs
202+
self._repeatkwargs = kwargs.copy()
203203
self._repeatkwargs.pop("partition_function", None)
204204

205205
ngrids = fieldset.gridset.size

0 commit comments

Comments
 (0)