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

Pack Zarr-related config into a dataclass #35

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

calvinchai
Copy link
Contributor

The use of this dataclass is dummy now, but it will be used when we started to use the AbstractZarrIO class and used to initialize the class instance

@calvinchai calvinchai requested a review from balbasty November 26, 2024 18:34
@balbasty
Copy link
Collaborator

This looks great.

One thing I was wondering so that we can keep using the previous functional api (I.e be able to pass convert(..., out=...)) is whether we should let convert accept additional **kwargs and pass these kwargs to the zarr_config if they exist.

Something like zarr_config = replace(zarr_config, kwargs) as in this stackoverflow: https://stackoverflow.com/questions/52556605/update-a-field-in-a-dataclass-with-a-field-name-known-only-during-runtime/53029448#53029448

@calvinchai
Copy link
Contributor Author

Yes, we can probably do that for each conversion function at the begining and pack that into a function for reuse. The only downside I see of for now after trying add it is that it will make the function intake arbitrary arguments and we need to check the argument one by one since replace will panic if a unknown parameter exists.

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