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

N5 hexdigest tests assume little-endianness #13

Open
QuLogic opened this issue Mar 26, 2023 · 1 comment
Open

N5 hexdigest tests assume little-endianness #13

QuLogic opened this issue Mar 26, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@QuLogic
Copy link

QuLogic commented Mar 26, 2023

Zarr version

2.14.2

Numcodecs version

0.11.0

Python Version

3.11.2

Operating System

Fedora Rawhide

Installation

from source

Description

When running tests on s390x (a big-endian machine), the N5 hexdigest tests fail. This seems to be a similar issue to zarr-developers/zarr-python#425 but in a new set of tests, and might perhaps be fixable in the same way.

_____________________ TestArrayWithN5Store.test_hexdigest ______________________
self = <zarr.tests.test_core.TestArrayWithN5Store testMethod=test_hexdigest>
    def test_hexdigest(self):
        found = []
    
        # Check basic 1-D array
        z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 1-D array with different type
        z = self.create_array(shape=(1050,), chunks=100, dtype='<f4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 2-D array
        z = self.create_array(shape=(20, 35,), chunks=10, dtype='<i4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 1-D array with some data
        z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
        z[200:400] = np.arange(200, 400, dtype='i4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 1-D array with attributes
        z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
        z.attrs['foo'] = 'bar'
        found.append(z.hexdigest())
        z.store.close()
    
>       assert self.expected() == found
E       AssertionError: assert ['8811a77d54c...d30c80dfc372'] == ['00227ef5c88...0d1b49aa77d4']
E         At index 0 diff: '8811a77d54caaa1901d5cc4452d946ae433c8d90' != '00227ef5c88a49c1f48be88b2bb17d37f7a5939e'
E         Use -v to get more diff
zarr/tests/test_core.py:615: AssertionError
____________________ TestArrayWithN5FSStore.test_hexdigest _____________________
self = <zarr.tests.test_core.TestArrayWithN5FSStore testMethod=test_hexdigest>
    def test_hexdigest(self):
        found = []
    
        # Check basic 1-D array
        z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 1-D array with different type
        z = self.create_array(shape=(1050,), chunks=100, dtype='<f4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 2-D array
        z = self.create_array(shape=(20, 35,), chunks=10, dtype='<i4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 1-D array with some data
        z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
        z[200:400] = np.arange(200, 400, dtype='i4')
        found.append(z.hexdigest())
        z.store.close()
    
        # Check basic 1-D array with attributes
        z = self.create_array(shape=(1050,), chunks=100, dtype='<i4')
        z.attrs['foo'] = 'bar'
        found.append(z.hexdigest())
        z.store.close()
    
>       assert self.expected() == found
E       AssertionError: assert ['8811a77d54c...d30c80dfc372'] == ['00227ef5c88...0d1b49aa77d4']
E         At index 0 diff: '8811a77d54caaa1901d5cc4452d946ae433c8d90' != '00227ef5c88a49c1f48be88b2bb17d37f7a5939e'
E         Use -v to get more diff
zarr/tests/test_core.py:615: AssertionError

Steps to reproduce

$ pytest

Additional output

No response

@QuLogic QuLogic added the bug Something isn't working label Mar 26, 2023
@d-v-b
Copy link
Collaborator

d-v-b commented Oct 18, 2024

I transferred this issue from zarr-python to n5py.

@d-v-b d-v-b transferred this issue from zarr-developers/zarr-python Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants