Skip to content

Conversation

@d-v-b
Copy link
Collaborator

@d-v-b d-v-b commented Nov 23, 2025

this PR adds a new top-level module experimental that contain versions of GroupSpec and ArraySpec with the following changes:

  • no more generic type parameters
  • GroupSpec.members is not nullable. Instead, GroupSpec inherits from BaseGroupSpec, which doesn't have a members attribute. This means we can statically distinguish between a model of a model of a zarr group in isolation (BaseGroupSpec) from a model of a Zarr group as a node in a hierarchy (`GroupSpec).
  • allow declaring the full type of the keys + values of members of a GroupSpec. This means enabling the use of typeddicts with specific keys to declare that certain members must have specific names.

I think this design is an improvement over the current ArraySpec / GroupSpec models, but I also want to improve gracefully, so my current thinking is to iterate on these new models in the experimental module and then at some point in time make the breaking change of replacing the models in the top-level .v2 and .v3 modules with the stuff formerly defined in experimental.

curious to get thoughts on that plan / anything else @dstansby @tlambert03

@d-v-b d-v-b marked this pull request as ready for review November 24, 2025 16:04
@d-v-b d-v-b requested a review from dstansby November 24, 2025 16:34
@d-v-b d-v-b mentioned this pull request Nov 24, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant