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
@d-v-b
Copy link
Collaborator Author

d-v-b commented Dec 4, 2025

@dstansby is it OK if this gets merged + I cut a release? I need the changes in this PR, and the changes are non-breaking

@dstansby
Copy link
Collaborator

dstansby commented Dec 4, 2025

Sounds good to me 👍 #112 is breaking though, so I think it'll have to be a breaking release regardless of this PR.

@tlambert03
Copy link
Contributor

just looked at the new experimental modules and they look good by me! I think it's a nice simplification: less confusing, and the lost typing subtleties can be worked around in more explicit ways. Would also like to see a new release :)

@tlambert03
Copy link
Contributor

see also #125 (which be merged before a new release)

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.

3 participants