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

test_streamwarp.py: Little-endian buffer not supported on big-endian compiler #2886

Open
4 tasks done
Tracked by #2911
nteodosio opened this issue Sep 4, 2023 · 3 comments
Open
4 tasks done
Tracked by #2911

Comments

@nteodosio
Copy link

Description

Tests from test_streamwarp.py fail in big endian architectures. On s390x:

=================================== FAILURES ===================================
_______________________________ test_bundlewarp ________________________________

    def test_bundlewarp():
    
        cingulum_bundles = two_cingulum_bundles()
    
        cb1 = Streamlines(cingulum_bundles[0])
>       cb1 = set_number_of_points(cb1, 20)

dipy/align/tests/test_streamwarp.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   ValueError: Little-endian buffer not supported on big-endian compiler

dipy/tracking/streamlinespeed.pyx:338: ValueError
_________________________ test_bundlewarp_vector_filed _________________________

    def test_bundlewarp_vector_filed():
    
        cingulum_bundles = two_cingulum_bundles()
    
        cb1 = Streamlines(cingulum_bundles[0])
>       cb1 = set_number_of_points(cb1, 20)

dipy/align/tests/test_streamwarp.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   ValueError: Little-endian buffer not supported on big-endian compiler

dipy/tracking/streamlinespeed.pyx:338: ValueError
__________________________ test_bundle_shape_profile ___________________________

    def test_bundle_shape_profile():
    
        cingulum_bundles = two_cingulum_bundles()
    
        cb1 = Streamlines(cingulum_bundles[0])
>       cb1 = set_number_of_points(cb1, 20)

dipy/align/tests/test_streamwarp.py:62: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   ValueError: Little-endian buffer not supported on big-endian compiler

dipy/tracking/streamlinespeed.pyx:338: ValueError

I suppose a adding big endian checks are desired, but for what it's worth downstream I proposed the attached patch to simply skip the tests on big endian architectures.
skip-streamwarp-test-in-big-endian.txt

Way to reproduce

  • Operating system and version: Ubuntu 23.10.
  • Python version: 3.11.
  • dipy version: 1.7.0
  • dependency version (numpy, scipy, nibabel, h5py, cvxpy, fury)
    • import numpy; 1.24.2
    • import scipy; 1:10.1
    • import nibabel; 5.1.0
    • import h5py; 3.7.0
    • import cvxpy;
    • import fury;
@skoudoro
Copy link
Member

skoudoro commented Sep 5, 2023

thank you for this report @nteodosio.

For now, we will apply your patch but we will try to figure out why it is failing on big endian.

What surprise me is set_number_of_points is used everywhere, so I wonder why it failed only for this test

@skoudoro skoudoro mentioned this issue Sep 26, 2023
41 tasks
@penguinpee
Copy link
Contributor

I'm still seeing those endianness errors in 1.8.0:

Test failures on `s390x`
=================================== FAILURES ===================================
_______________________________ test_bundlewarp ________________________________
    def test_bundlewarp():
    
        cingulum_bundles = two_cingulum_bundles()
    
        cb1 = Streamlines(cingulum_bundles[0])
>       cb1 = set_number_of_points(cb1, 20)
dipy/align/tests/test_streamwarp.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
>   ???
E   ValueError: Little-endian buffer not supported on big-endian compiler
streamlinespeed.pyx:338: ValueError
_________________________ test_bundlewarp_vector_filed _________________________
    def test_bundlewarp_vector_filed():
    
        cingulum_bundles = two_cingulum_bundles()
    
        cb1 = Streamlines(cingulum_bundles[0])
>       cb1 = set_number_of_points(cb1, 20)
dipy/align/tests/test_streamwarp.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
>   ???
E   ValueError: Little-endian buffer not supported on big-endian compiler
streamlinespeed.pyx:338: ValueError
__________________________ test_bundle_shape_profile ___________________________
    def test_bundle_shape_profile():
    
        cingulum_bundles = two_cingulum_bundles()
    
        cb1 = Streamlines(cingulum_bundles[0])
>       cb1 = set_number_of_points(cb1, 20)
dipy/align/tests/test_streamwarp.py:62: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
>   ???
E   ValueError: Little-endian buffer not supported on big-endian compiler
streamlinespeed.pyx:338: ValueError
______________________________ test_sphere_dtypes ______________________________
    def test_sphere_dtypes():
        for sphere_name, sphere_path in SPHERE_FILES.items():
            sphere_data = np.load(sphere_path)
>           npt.assert_equal(sphere_data['vertices'].dtype, np.float64)
E           AssertionError: 
E           Items are not equal:
E            ACTUAL: dtype('<f8')
E            DESIRED: <class 'numpy.float64'>
dipy/data/tests/test_data.py:8: AssertionError
=============================== warnings summary ===============================
../../BUILDROOT/python-dipy-1.8.0-5.fc41.s390x/usr/lib64/python3.12/site-packages/dipy/viz/__init__.py:22
  /builddir/build/BUILDROOT/python-dipy-1.8.0-5.fc41.s390x/usr/lib64/python3.12/site-packages/dipy/viz/__init__.py:22: UserWarning: You do not have FURY installed. Therefore, 3D visualization functions will not work for you. Please install or upgrade FURY using pip install -U furyFor detailed installation instructions visit: https://fury.gl/
    warnings.warn(
dipy/align/tests/test_reslice.py: 7 warnings
dipy/denoise/tests/test_gibbs.py: 18 warnings
dipy/workflows/tests/test_denoise.py: 1 warning
  /usr/lib64/python3.12/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=9419) is multi-threaded, use of fork() may lead to deadlocks in the child.
    self.pid = os.fork()
dipy/workflows/tests/test_tracking.py::test_particle_filtering_tracking_workflows
  /builddir/build/BUILD/dipy-1.8.0/dipy/workflows/tests/test_tracking.py:73: RuntimeWarning: invalid value encountered in cast
    save_nifti(path, arr.astype(np.uint8), affine)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED dipy/align/tests/test_streamwarp.py::test_bundlewarp - ValueError: Lit...
FAILED dipy/align/tests/test_streamwarp.py::test_bundlewarp_vector_filed - Va...
FAILED dipy/align/tests/test_streamwarp.py::test_bundle_shape_profile - Value...
FAILED dipy/data/tests/test_data.py::test_sphere_dtypes - AssertionError: 
= 4 failed, 784 passed, 81 skipped, 16 deselected, 28 warnings in 881.67s (0:14:41) =

Let me know if you prefer a new issue. But this looks pretty much like what OP reported.

@penguinpee
Copy link
Contributor

I just updated the package in Fedora to 1.9.0. Unfortunately tests still fail on s390x.

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

No branches or pull requests

3 participants