-
-
Notifications
You must be signed in to change notification settings - Fork 330
Fix N5Store dtype wrong behavior #1340
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
Conversation
Launched the workflows. Thanks, @mzouink! |
zarr/tests/test_n5.py
Outdated
z = zarr.open(n5_store) | ||
z.create_dataset("test", shape=100, dtype="u1") | ||
dtype_n5 = json.loads(n5_store["test/.zarray"])["dtype"] | ||
shutil.rmtree(store) |
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.
consider using atexit.register
here instead, e.g.
zarr-python/zarr/tests/test_storage.py
Line 992 in 4dc6f1f
atexit.register(atexit_rmtree, path) |
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.
Thank you! i am using it now
I feel like this case should be caught by existing tests. I will look through the test code later and see why this isn't happening. |
@d-v-b zarr-python/zarr/tests/test_core.py Lines 1734 to 1741 in 4dc6f1f
And it is hardcoded + overwritten for N5. I don't think it is the right way to do it |
Re-launched the workflows. Just a heads up, @mzouink, @d-v-b did a good deal of cleaning of test_core.py in https://github.com/zarr-developers/zarr-python/pull/1305/files#diff-acf894bdb70842660ec996213f7ff01514172d0fd4208cbc33a942929e1c7cb2 in case you want to compare there. |
Codecov Report
@@ Coverage Diff @@
## main #1340 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 36 36
Lines 14752 14768 +16
=========================================
+ Hits 14752 14768 +16
|
@@ -35,3 +39,14 @@ def test_partial_chunk_decode(chunk_shape: Tuple[int, ...]): | |||
chunk[subslices] = 1 | |||
subchunk = np.ascontiguousarray(chunk[subslices]) | |||
assert np.array_equal(codec_wrapped.decode(codec_wrapped.encode(subchunk)), chunk) | |||
|
|||
|
|||
def test_dtype_decode(): |
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 test will need the fsspec check:
@pytest.mark.skipif(have_fsspec is False, reason="needs fsspec")
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.
Thank you! i didn't know how to do it. i added it.
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.
Cheers!
yes @joshmoore. i think it is ready now. thank you for your time. |
looks good to me |
Great, thanks all. I'll get this into the next release. @mzouink, please feel free to add your contribution to docs/release.rst if you would like. |
🎉 |
[Description of PR]
Fixing issue: #1339
@d-v-b
TODO: