Skip to content

Refactor indexing#734

Merged
TomNicholas merged 18 commits intozarr-developers:mainfrom
TomNicholas:refactor_indexing
Jul 24, 2025
Merged

Refactor indexing#734
TomNicholas merged 18 commits intozarr-developers:mainfrom
TomNicholas:refactor_indexing

Conversation

@TomNicholas
Copy link
Member

@TomNicholas TomNicholas commented Jul 24, 2025

Rewrites the implementation of __getitem__ to actually satisfy the myriad edge cases in the array API standard. I didn't realise just how gnarly this could get until I was debugging #728.

The test coverage is now way better, and the algorithm by which we do indexing much more explicit.

In this refactor it becomes obvious that 95% of the logic is for dealing with None and Ellipsis - the actual 1D indexing is extremely simple (partly because we only support specific no-ops right now).

This refactor should also make it much easier to add support for #51.

  • Closes #xxxx
  • Tests added
  • Tests passing
  • Full type hint coverage
  • Changes are documented in docs/releases.rst
  • New functions/methods are listed in api.rst
  • New functionality has documentation

@TomNicholas TomNicholas merged commit 8230c36 into zarr-developers:main Jul 24, 2025
13 checks passed
@TomNicholas TomNicholas deleted the refactor_indexing branch July 24, 2025 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant