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

[v3] Groups and Arrays do not implement __enter__ / __exit__ protocols #2619

Open
jhamman opened this issue Jan 2, 2025 · 1 comment · May be fixed by #2691
Open

[v3] Groups and Arrays do not implement __enter__ / __exit__ protocols #2619

jhamman opened this issue Jan 2, 2025 · 1 comment · May be fixed by #2691

Comments

@jhamman
Copy link
Member

jhamman commented Jan 2, 2025

In Zarr-Python 2, Groups and Arrays implemented __enter__ and __exit__ so that they could be used in a context manager and the underlying store would be automatically closed. We have not implemented this in Zarr-Python 3 yet though I can't think of a specific reason as to why we couldn't.

This issue tracks the development of this feature in Zarr-Python 3.

@dikwickley
Copy link

@jhamman I added a draft PR that can add these methods.

I found the older implementation here for groups

but couldn't find for arrays.

are there any other cases I need to handle?

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 a pull request may close this issue.

2 participants