Conversation
Contributor
|
Hi @mvanhorn . Can you please complete the AI disclosure part of the PR template? We want to make sure all PRs submitted to our project have a human behind the wheel. |
Author
|
Done, the AI disclosure section is filled in. I used AI assistance for the fix and tests, reviewed them, and ran |
Contributor
|
superceded by #2921 |
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
Fixes
ChunkCachedArray._vindex_getfor mixed vectorized keys (integer arrays plus slices), which xarray produces when some dimensions are indexed and others are left whole.A Delft3D surface field loaded with
to_chunk_cached_arrays()failed in_gather_corners: the array is(time, mockZ, N, M)with a singletonmockZ, time/N/M are indexed, andmockZis left asslice(None)._raw_vindextreated that slice as a 1-D integer array during negative-index normalization. The same simulation works with windowed arrays, so this is local to the cache backend.Changes, all in
_vindex_get:slice.indicesfor its dimension._raw_vindex, and reshape the result.IndexErrorfor integer indices out of range before chunk lookup. Valid negative indices still work.The per-chunk LRU fetch path is unchanged. The bug reproduces with synthetic arrays, so the tests don't need the reporter's data.
Closes #2897
Checklist
mainfor normal development,v3-supportfor v3 support)AI Disclosure
I used AI assistance to write the fix and tests.
tests/test_chunk_cached_array.pyandtests/test_interpolation.pypass locally (59 passed, Python 3.13).