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
You're right, it's a failure of dask.array with __array_function__ and np.min. That should definitely work! Using image.min() instead works fine. Reporting now.
Yes, that's right, we are merely testing for basic compatibility, ie that we won't barf with an error if a dask array is given as input. Which is exactly what we are en-route to doing at this point. 😂
In response to a question by @hmaarrfk in #3987 about what we can do here: we could replace np.min by np.amin and it should go back to working as expected.
I think this will be fixed shortly in a bug-fix release of dask -- see the linked issue for discussion. This operation will work (by using dask array operations), and other, non-implemented operations (e.g., np.median) will work but dask will issue a warning.
But it is definitely true that at least some of these operations will start to be parallelized with dask rather than executed by automatic coercion into NumPy arrays. That will probably be a welcome change for skimage users, but it's definitely a change.
@shoyer as I commented on the dask issue, that's only a partial fix, as it will still leave a whole bunch of incompatible NumPy/dask combinations out in the wild. The real fix is to have 1.17 issue a warning instead of a TypeError.
That will probably be a welcome change for skimage users, but it's definitely a change.
Yes, this is totally fine. The int() was actually added to make sure that it would continue to work in a future in which __array_function__ became a thing. It would be ideal for np.min to work correctly with array-function, but it should also work with intermediate versions of dask.
Activity
hmaarrfk commentedon Jul 1, 2019
this seems like a numpy + dask issue. Probably should report it upstream.
jni commentedon Jul 1, 2019
You're right, it's a failure of dask.array with
__array_function__and np.min. That should definitely work! Usingimage.min()instead works fine. Reporting now.shoyer commentedon Jul 1, 2019
Is this code intended to work by coercing a dask array into a NumPy array? That's definitely what it's doing right now, pre-NumPy 1.17.
jni commentedon Jul 1, 2019
Yes, that's right, we are merely testing for basic compatibility, ie that we won't barf with an error if a dask array is given as input. Which is exactly what we are en-route to doing at this point. 😂
jni commentedon Jul 2, 2019
In response to a question by @hmaarrfk in #3987 about what we can do here: we could replace
np.minbynp.aminand it should go back to working as expected.jni commentedon Jul 2, 2019
(Or we can wait for
rc2which might fix the problem for us.)hmaarrfk commentedon Jul 2, 2019
This comment from @shoyer makes it seem like it was a deliberate change.
shoyer commentedon Jul 2, 2019
I think this will be fixed shortly in a bug-fix release of dask -- see the linked issue for discussion. This operation will work (by using dask array operations), and other, non-implemented operations (e.g.,
np.median) will work but dask will issue a warning.But it is definitely true that at least some of these operations will start to be parallelized with dask rather than executed by automatic coercion into NumPy arrays. That will probably be a welcome change for skimage users, but it's definitely a change.
jni commentedon Jul 2, 2019
@shoyer as I commented on the dask issue, that's only a partial fix, as it will still leave a whole bunch of incompatible NumPy/dask combinations out in the wild. The real fix is to have 1.17 issue a warning instead of a TypeError.
Yes, this is totally fine. The
int()was actually added to make sure that it would continue to work in a future in which__array_function__became a thing. It would be ideal fornp.minto work correctly with array-function, but it should also work with intermediate versions of dask.