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

The test "Python.Test.ArrayView" is failing in CI. #1805

Closed
blowekamp opened this issue Jan 3, 2023 · 3 comments
Closed

The test "Python.Test.ArrayView" is failing in CI. #1805

blowekamp opened this issue Jan 3, 2023 · 3 comments

Comments

@blowekamp
Copy link
Member

The test failure is producing the following output:

1040: FAIL: test_arrayview_writable (__main__.TestNumpySimpleITKMemoryviewInterface.test_arrayview_writable)
1040: Test correct behavior of writablity to the returned array view.
1040: ----------------------------------------------------------------------
1040: Traceback (most recent call last):
1040:   File "/Users/blowekamp/src/SimpleITK/Testing/Unit/Python/sitkGetArrayViewFromImageTest.py", line 132, in test_arrayview_writable
1040:     with self.assertRaises(ValueError):
1040: AssertionError: ValueError not raised
1040: 
1040: ----------------------------------------------------------------------
1040: Ran 5 tests in 0.072s

It appears a.fill(0) is being executed on the read-only array view of the SimpleITK buffer.

@blowekamp
Copy link
Member Author

blowekamp commented Jan 3, 2023

The following code raises an ValueError exception with numpy 1.23.5, and writes to the read-only buffer with 1.24.1

import numpy as np
a = np.zeros(11)
a.setflags(write=False)
a.fill(0)

@blowekamp
Copy link
Member Author

Reported issue numpy/numpy#22922

blowekamp added a commit to blowekamp/SimpleITK that referenced this issue Jan 6, 2023
See SimpleITK#1805 for details.

Explude version of numpy which cause Python.Test.ArrayView to fail.
@blowekamp
Copy link
Member Author

Addressed in numpy, and the problematic versions excluded from SimpleITK's build

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