-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix CI failures related to conversion of np.floating to dtype #4731
Fix CI failures related to conversion of np.floating to dtype #4731
Conversation
looks like it does not fully fix the CI :) |
skimage/util/dtype.py
Outdated
@@ -244,6 +244,8 @@ def _convert(image, dtype, force_copy=False, uniform=False): | |||
if force_copy: | |||
image = image.copy() | |||
return image | |||
else: | |||
dtype = np.float64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean dtypeobj_out
? I think dtype
is never used from this point onwards...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, it should be dtype_out
;)
…into Remove_conversion_to_np_floating
Ci failures are fixed by #4735 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the correct fix. Instead, I think we should change img_as_float
's call to _convert(img, np.floating)
to _convert(img, np.float)
. Or np.float64
, I'm not sure. np.float64
is the current behaviour, but np.float
(ie 32-bit on 32-bit-default platforms, 64-bit on 64-bit-default platforms) is the intended behaviour, I believe.
To clarify my position: this PR currently takes NumPy's deprecated behaviour and hardcodes it into skimage. Instead, we should follow NumPy's guidance here. Users doing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore me! 😂 The np.issubdtype
change becomes nearly impossible with my half-baked proposal. 😂
fwiw, I do think we should consider making |
numpy 1.19 deprecates (See NEP 34) automatic dtype for ragged input. This causes CI failures (please see #4731).
numpy 1.19 deprecates (See NEP 34) automatic dtype for ragged input. This causes CI failures (please see scikit-image#4731).
…-image#4731) * Prevent type conversion to np.floating * Fix conversion to np.floating
* Fix array ragged input numpy deprecation (#4735) numpy 1.19 deprecates (See NEP 34) automatic dtype for ragged input. This causes CI failures (please see #4731). * Fix CI failures related to conversion of np.floating to dtype (#4731) * Prevent type conversion to np.floating * Fix conversion to np.floating Co-authored-by: Riadh Fezzani <rfezzani@gmail.com>
Does anyone know which release number this is targeted for? |
@scikit-image/core Do we plan to release a minor version to include this fix? |
Looks like it was backported to the 0.17.x branch, so I think we could release 0.17.3 with this. @emmanuelle could you handle that? I'd be available today and/or Thursday to help if needed. |
Description
This PR prevent the conversion using
np.floating
as it is deprecated in numpy 1.19.It fixes CI failures in #4730
Checklist
./doc/examples
(new features only)./benchmarks
, if your changes aren't covered by anexisting benchmark
For reviewers
later.
__init__.py
.doc/release/release_dev.rst
.