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

d/d/t/test_data.py: endian independent dtype. #3043

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

emollier
Copy link
Contributor

test_sphere_dtypes produces consistently little endian float64 numpy objects. This is usually not an issue, but big endian systems, the little endian value is compared against a big endian float64, causing the test to fail. This fixes/worksaround the test failure on big endian CPUs.

test_sphere_dtypes produces consistently little endian float64 numpy
objects.  This is usually not an issue, but big endian systems, the
little endian value is compared against a big endian float64, causing
the test to fail.  This fixes/worksaround the test failure on big
endian CPUs.

Signed-off-by: Étienne Mollier <emollier@debian.org>
@skoudoro
Copy link
Member

Thank you for doing this.

We might need to set up a Github Action with big endian systems to avoid those recurring issue (something using QEMU I suppose, I need to look into it - if you have an example, feel free to share! )

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (24f76c8) 81.91% compared to head (6966cbe) 81.91%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3043   +/-   ##
=======================================
  Coverage   81.91%   81.91%           
=======================================
  Files         147      147           
  Lines       20652    20652           
  Branches     3317     3317           
=======================================
  Hits        16917    16917           
  Misses       2903     2903           
  Partials      832      832           

@emollier
Copy link
Contributor Author

I don't know how to bind the below on Github Actions, but maybe this will give you ideas.

To test on big endian, my go to platform is to use qemu-system-s390x coupled to binfmt kernel settings, provided by Debian packages qemu-system-misc and qemu-user-static. Once installed, I can spawn a Debian s390x system root tree with e.g.:

# debootstrap --arch s390x sid /srv/chroot/sid-390x http://ftp.fr.debian.org/debian

Once done, I can chroot straight into the tree and, thanks to binfmt, qemu-system-s390x will "interpret" the s390x executables:

# uname -m
x86_64
# chroot /srv/chroot/sid-390x
# uname -m
s390x

Crude yet effective. Main drawback is, that emulation for s390x is slow: running the test suite took some eight hours to run on my machine, to compare to one quarter of hour on the native cpu.

I'm using actually a configuration a bit more elaborate, but you get the idea.

@skoudoro
Copy link
Member

all green, merging. I will create an issue to remember the s390x github action (to do later during the year)

@skoudoro skoudoro merged commit ed63059 into dipy:master Jan 15, 2024
27 checks passed
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

2 participants