You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently indexing a particleset doesn't work with slice objects.
pset[0]
->givesfirstparticlepset[:7]
self = <parcels.particledata.ParticleData object at 0x1620e3110>, index = slice(None, 7, None)
def get_single_by_index(self, index):
"""Get a particle object from the ParticleData instance based on its index."""
> assert type(index) in [
int,
np.int32,
np.intp,
], f"Trying to get a particle by index, but index {index} is not a 32-bit integer - invalid operation."
E AssertionError: Trying to get a particle by index, but index slice(None, 7, None) is not a 32-bit integer - invalid operation.
It would be a nice quality of life change for pset to support slicing
The text was updated successfully, but these errors were encountered:
Currently indexing a particleset doesn't work with slice objects.
It would be a nice quality of life change for pset to support slicing
The text was updated successfully, but these errors were encountered: