BF: Ensure little-endian whatever the platform. trx should works on s… #89
+181
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

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.