BF: Ensure little-endian whatever the platform. trx should works on s…#89
BF: Ensure little-endian whatever the platform. trx should works on s…#89arokem merged 1 commit intotee-ar-ex:masterfrom
Conversation
…390x platform now.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #89 +/- ##
=========================================
Coverage ? 59.76%
=========================================
Files ? 12
Lines ? 2411
Branches ? 0
=========================================
Hits ? 1441
Misses ? 970
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I just tested on Fedora machine and it seems all good. see the screenshot below:
ready to be merged @arokem |
|
I believe I just approved the codecov request. |
I confirm, and I do not have the permission to configure it. So I let you do it and add the secret to make it work. Thanks @arokem |
|
@skoudoro Do you have a branch on the Dipy repo using this PR content to ensure that these changes are not breaking outside of the repo. This could avoid surprises down the line. |
|
Hi @frheault, I tried with the last release, no issue. but let me connect to fedora and try with master branch |
|
Given it works with the released DIPY, let's go ahead and merge this. We can keep an eye on this with future DIPY versions as well. |

fixes #83
This pull request introduces a better handling of endianness to ensure cross-platform compatibility when reading and writing TRX files. The changes add utility functions to enforce little-endian byte order, update all relevant file writing operations to use these utilities, and include extensive tests to verify correct behavior for various data types and scenarios.
_get_dtype_little_endianand_ensure_little_endianutility functions intrx_file_memmap.pyto convert data types and arrays to little-endian format, ensuring all data written to disk conforms to the TRX file specification for cross-platform compatibility.TrxFile.deepcopyand related functions to use_ensure_little_endian, ensuring that positions, offsets, and all per-vertex, per-streamline, and per-group data are saved in little-endian byte order. [1] [2] [3] [4] [5] [6]_create_memmapfunction to always use little-endian dtypes when mapping files, and updated the test for memmap creation accordingly. [1] [2]trx/workflows.pyto ensure all streamline and data arrays are written in little-endian order using the new utility functions, covering positions, offsets, and additional data arrays. [1] [2]test_memmap.pyto verify correct dtype conversion, array onversion, and roundtrip data integrity for various data types and endianness scenarios.