Using numpy=2 I am seeing problems in test_image.py because of _addValue in image.py. Specifically, the usage arr[y, x] += value now apparently does strict type/bounds checking such that trying to add a negative value to an unsigned integer array is an OverflowError. (With numpy=1 arr += value would fail in the same way, but doing the specific index would not for ... reasons.).
A possible workaround is to force unsafe casting such that the RHS can be np.array(value).astype(self._array.dtype, casting="unsafe"). I don't know if this has performance implications or if somebody has a cleverer idea.
Using numpy=2 I am seeing problems in
test_image.py
because of_addValue
inimage.py
. Specifically, the usagearr[y, x] += value
now apparently does strict type/bounds checking such that trying to add a negative value to an unsigned integer array is anOverflowError
. (With numpy=1arr += value
would fail in the same way, but doing the specific index would not for ... reasons.).A possible workaround is to force unsafe casting such that the RHS can be
np.array(value).astype(self._array.dtype, casting="unsafe")
. I don't know if this has performance implications or if somebody has a cleverer idea.