Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tutorial to demonstrate image reading #59

Closed
wants to merge 9 commits into from

Conversation

dstansby
Copy link
Contributor

This:

  • Adds a bit of sample data we can use with the tutorial (and perhaps tests later?)
  • Demonstrates how to read this data in the tutorial, and shows a plot
  • Modifies Image a bit to hide away pydantic_zarr from the public API. Instead of sub-classing this just uses GroupSpec to do validation and then store the attributes, but these are provided to the user in the form of custom properties.

I'm not 100% sure this is the best way to go in terms of what our "top level" object is and looks like, but I'm wary about sub-classing from another library as we'll lose the flexibility of doing what we want. Very open to other suggestions/ideas though, ideally with modifications to the tutorial to show how they would work as public API.

docs/tutorial.py Outdated Show resolved Hide resolved
@dstansby dstansby marked this pull request as ready for review December 1, 2024 22:16

@classmethod
def from_zarr(cls, node: zarr.Group) -> Self:
def _from_spec(cls, spec: _ImageSpec) -> Self:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a bit of a hack for testing

@dstansby dstansby requested a review from d-v-b December 1, 2024 23:09
@dstansby
Copy link
Contributor Author

dstansby commented Dec 1, 2024

I need to fix the tutorial, but would be good to hear your thoughts on this @d-v-b, in particular:

Modifies Image a bit to hide away pydantic_zarr from the public API. Instead of sub-classing this just uses GroupSpec to do validation and then store the attributes, but these are provided to the user in the form of custom properties.

@dstansby
Copy link
Contributor Author

dstansby commented Dec 2, 2024

There's a better version of this at #64

@dstansby dstansby closed this Dec 2, 2024
@dstansby dstansby deleted the ds/update-tutorial branch December 10, 2024 16:22
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.

2 participants