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

compatibility with numpy>2.0 #74

Open
matthewpendleton opened this issue Aug 13, 2024 · 1 comment
Open

compatibility with numpy>2.0 #74

matthewpendleton opened this issue Aug 13, 2024 · 1 comment

Comments

@matthewpendleton
Copy link

numpy >2.0 is not backwards compatible, and specifically fails in the endian/byteorder check. An updated implementation (along with explicitly specifying the proper endianness) that is compliant with the changes made in numpy 2.0 and later would be:

        # Convert to native byte order
        # This is needed for working with pandas data structures
        sys_is_le = sys.byteorder == 'little'
        native_code = '<' if sys_is_le else '>'
        swapped_code = '>' if sys_is_le else '<'
        if endian != native_code:
            # swaps the actual bytes and also the endianness
            # updated to be numpy>= 2.0 compliant
            data = data.view(data.dtype.newbyteorder(swapped_code)).byteswap()
@eyurtsev
Copy link
Owner

I do not work in the field anymore, but happy to merge a PR and make a package release if you're able to make the necessary changes and include or point out to the relevant unit tests that cover this functionality

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

2 participants