You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When multi-dimensional inputs are passed to np.unique with return_inverse=True, the unique_inverse output is now shaped such that the input can be reconstructed directly using np.take(unique, unique_inverse) when axis=None, and np.take_along_axis(unique, unique_inverse, axis=axis) otherwise.
Breaking Example
In practice, this means that the unit tests of ismember fail and, e.g. the following code breaks when switching from numpy==1.26.0 to numpy==2.0.0:
@erdogant Do you have any suggestions/ideas on how to handle the situation? In case you do not have time but would appreciate someone looking into it, just let me know and I'll try my best :) For now, I will force usage of numpy<2.0.0 by hand whenever I use ismember.
What has changed
From Numpy's
2.0.0
release notes, we know thatBreaking Example
In practice, this means that the unit tests of
ismember
fail and, e.g. the following code breaks when switching fromnumpy==1.26.0
tonumpy==2.0.0
:IndexError: boolean index did not match indexed array along axis 1; size of axis is 2 but size of corresponding boolean axis is 1
Explanation
numpy==2.0.0
:is_local_boundary
has shape(4,1)
numpy==1.26.0
:is_local_boundary
has shape(4,)
The text was updated successfully, but these errors were encountered: