Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/parcels/_chunk_cached_array/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ def _raw_vindex(self, *indices: np.ndarray) -> np.ndarray:

def _vindex_get(self, indexer: VectorizedIndexer):
key = indexer.tuple
# The chunk-cache fast path requires a fancy integer array per dimension.
# Some dims (e.g. unindexed extra dims) may come through as a bare slice
# instead, so fall back to dask's own vectorized indexing in that case.
if any(isinstance(k, slice) for k in key):
return self.array.vindex[key].compute()
Comment on lines +143 to +147

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This completely bypasses the chunk caching mechanism and will degrade performance

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK thanks; that's clear then. I'll close this PR

return self._raw_vindex(*key)

def _oindex_get(self, indexer: OuterIndexer):
Expand Down