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 failures with Numpy 2.0 #8332

Open
arkamar opened this issue Jun 15, 2024 · 0 comments
Open

Test failures with Numpy 2.0 #8332

arkamar opened this issue Jun 15, 2024 · 0 comments

Comments

@arkamar
Copy link

arkamar commented Jun 15, 2024

I tried to run tests with Numpy-2.0.0-rc2 and they fail with following errors:

 * python3_10: running distutils-r1_run_phase python_test
======================================================================
ERROR: test_create_numpy_vector_bool (__main__.TestByteLayout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/flatbuffers-24.3.25/work/flatbuffers-24.3.25/tests/py_test.py", line 1430, in test_create_numpy_vector_bool
    x_other_endian = x.byteswap().newbyteorder()
AttributeError: `newbyteorder` was removed from the ndarray class in NumPy 2.0. Use `arr.view(arr.dtype.newbyteorder(order))` instead.

======================================================================
ERROR: test_create_numpy_vector_float32 (__main__.TestByteLayout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/flatbuffers-24.3.25/work/flatbuffers-24.3.25/tests/py_test.py", line 1290, in test_create_numpy_vector_float32
    x_other_endian = x.byteswap().newbyteorder()
AttributeError: `newbyteorder` was removed from the ndarray class in NumPy 2.0. Use `arr.view(arr.dtype.newbyteorder(order))` instead.

======================================================================
ERROR: test_create_numpy_vector_float64 (__main__.TestByteLayout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/flatbuffers-24.3.25/work/flatbuffers-24.3.25/tests/py_test.py", line 1364, in test_create_numpy_vector_float64
    x_other_endian = x.byteswap().newbyteorder()
AttributeError: `newbyteorder` was removed from the ndarray class in NumPy 2.0. Use `arr.view(arr.dtype.newbyteorder(order))` instead.

======================================================================
ERROR: test_create_numpy_vector_int64 (__main__.TestByteLayout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/flatbuffers-24.3.25/work/flatbuffers-24.3.25/tests/py_test.py", line 1216, in test_create_numpy_vector_int64
    x_other_endian = x.byteswap().newbyteorder()
AttributeError: `newbyteorder` was removed from the ndarray class in NumPy 2.0. Use `arr.view(arr.dtype.newbyteorder(order))` instead.

======================================================================
ERROR: test_create_numpy_vector_int8 (__main__.TestByteLayout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/flatbuffers-24.3.25/work/flatbuffers-24.3.25/tests/py_test.py", line 1098, in test_create_numpy_vector_int8
    x_other_endian = x.byteswap().newbyteorder()
AttributeError: `newbyteorder` was removed from the ndarray class in NumPy 2.0. Use `arr.view(arr.dtype.newbyteorder(order))` instead.

======================================================================
ERROR: test_create_numpy_vector_uint16 (__main__.TestByteLayout)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/flatbuffers-24.3.25/work/flatbuffers-24.3.25/tests/py_test.py", line 1147, in test_create_numpy_vector_uint16
    x_other_endian = x.byteswap().newbyteorder()
AttributeError: `newbyteorder` was removed from the ndarray class in NumPy 2.0. Use `arr.view(arr.dtype.newbyteorder(order))` instead.

----------------------------------------------------------------------
Ran 123 tests in 0.079s

FAILED (errors=6)
  • OS: Gentoo
  • Python 3.10.14
  • Numpy 2.0.0-rc2
  • GCC 15
  • FlatBuffers 24.3.25

It seems that the issue is still present in master branch but I didn't test it. I didn't find any related Issue nor PR.

gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Jun 15, 2024
Tests require newbyteorder method, which was removed from the ndarray
class in NumPy 2.0. The issue was reported upstream, see [1].

[1] google/flatbuffers#8332

Signed-off-by: Petr Vaněk <[email protected]>
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

1 participant