-
Notifications
You must be signed in to change notification settings - Fork 43
Do not call __exit__ on Zarr store when opening #90
Conversation
@TomNicholas please take a look Tests were not passing for me locally prior to this fix. Edit: This was a problem with my zarr install -- all tests pass. |
The `with` context when opening the zarr group with result in calling __exit__ on the store when the function completes. This calls `.close()` on ZipStore's, which results in errors: ``` ValueError: Attempt to use ZIP archive that was already closed ```
Test added |
for more information, see https://pre-commit.ci
except zarr.errors.PathNotFoundError: | ||
subgroup_ds = Dataset() | ||
|
||
# TODO refactor to use __setitem__ once creation of new nodes by assigning Dataset works again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomNicholas - is this still an issue we need to work around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I'm curious if we still need the workaround in io.py:99 but its not a core part of the change here so I'm fine merging as is.
@jhamman @TomNicholas thanks!! |
@TomNicholas any plans to cut a 0.0.6 release? |
@thewtex I just released 0.0.6 just now! |
…ee#90 * Do not call __exit__ on Zarr store when opening The `with` context when opening the zarr group with result in calling __exit__ on the store when the function completes. This calls `.close()` on ZipStore's, which results in errors: ``` ValueError: Attempt to use ZIP archive that was already closed ``` * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
The
with
context when opening the zarr group with result in callingexit on the store when the function completes. This calls
.close()
on ZipStore's, which results in errors: