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

array tests: handle different hexdigests from zlib-ng (#1678) #1972

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AdamWill
Copy link

As explained in the issue, zlib-ng produces different hex digests from original zlib. This adjusts the tests slightly to allow for this.

TODO:

  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

Removed TODO items are irrelevant as this only changes tests. This is more or less the same as #1971 , but for the main (v2) branch rather than v3 branch.

@AdamWill AdamWill changed the title v2 array tests: handle different hexdigests from zlib-ng (#1678) array tests: handle different hexdigests from zlib-ng (#1678) Jun 17, 2024
@AdamWill
Copy link
Author

If I run black on the changed file here locally it does indeed want to change a bunch of stuff, but none of it is stuff this PR touches - the issues already exist.

@d-v-b
Copy link
Contributor

d-v-b commented Jun 17, 2024

Thanks for the fix. For posterity, the ideal way to handle two different versions of zlib would be to condition the test case on the detected zlib version, but our test design makes that very tedious and not worth the effort. I think what you have done here is good!

@d-v-b d-v-b self-assigned this Jun 17, 2024
@d-v-b d-v-b self-requested a review June 17, 2024 18:51
@d-v-b
Copy link
Contributor

d-v-b commented Jun 17, 2024

we are seeing test failures due to numpy 2.0 I think

@AdamWill
Copy link
Author

yeah, it looks like numpy got some custom types. I guess you might need to do stuff like:

diff --git a/src/zarr/v2/core.py b/src/zarr/v2/core.py
index c1223dac..04da6749 100644
--- a/src/zarr/v2/core.py
+++ b/src/zarr/v2/core.py
@@ -759,7 +759,7 @@ class Array:
 
         Retrieve a single item::
 
-            >>> z.get_basic_selection(5)
+            >>> int(z.get_basic_selection(5))
             5
 
         Retrieve a region via slicing::

or something along those lines.

@QuLogic
Copy link
Contributor

QuLogic commented Aug 19, 2024

I guess the NumPy stuff was fixed by #2073, so this might just need a rebase.

…s#1678)

As explained in the issue, zlib-ng produces different hex digests
from original zlib. This adjusts the tests slightly to allow for
this.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
@AdamWill
Copy link
Author

Rebased.

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.

None yet

3 participants