Repository navigation
Conversation
update docs and gallery to use rescale_to_*
|
Hello @grlee77! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2022-04-05 17:52:16 UTC |
There was a problem hiding this comment.
Thanks @grlee77. I'm not through yet but I have a few comments.
Also there still is a lonely img_as_float in doc/CONTRIBUTING.rst under "Stylistic Guidelines".
| return _img_as_float(image, force_copy, preserve_range=False) | ||
|
|
||
|
|
||
| def _img_as_float(image, force_copy=False, *, preserve_range=True, dtype=None): |
There was a problem hiding this comment.
I think _rescale_to_float would be the clearer and more consistent name.
There was a problem hiding this comment.
_img_as_float has been removed and _convert is just used directy now.
| return _convert(image, np.floating, force_copy) | ||
| return _img_as_float(image, force_copy, preserve_range=False) |
There was a problem hiding this comment.
I don't understand this change. Why did you wrap _convert with the new function _img_as_float?
Also one could argue that it would be more explicit to use dtype=np.floating here and not rely on _img_as_float's implicit behavior for dtype=None. Or rather use np.floating as the default in the function signature?
There was a problem hiding this comment.
not sure why I did that, will take a look again.
There was a problem hiding this comment.
_img_as_float has been removed and _convert is just used directy now.
|
Per #1234 (comment), we need to decide on Also, we do already have a private |
|
We will need to hold off on merging this PR until after we branch 1.0 |
This comment was marked as outdated.
This comment was marked as outdated.
Why? I'm assuming that 1.0 was the former "breaking API" milestone. This seems like a deprecation that doesn't require a major version or namespace change. If this was decided on I would like to pick it up again. I'm also +1 on |
|
We have changed the base branch for this PR from the Summary - what this means for your PRYou can continue to work on your PR, now based on Once we've merged your PR into the In addition - our automated script detected that your branch had merge conflicts with the pre-Megamove branch. Please make sure to merge in the Read on for the Megamove rationale, and more detailed instructions. DetailsRationaleWe've changed the base branch to make it easier and smoother to continue to work on your PR, while we work through a rather large change in the directory structure of the repository - a change that we have called Megamove. See the Megamove explanation issue for more detail. Changing the base branch means you do not see merge conflicts related to the Megamove change, and can continue to work with the repository in its original state, without worrying about porting those changes across to the new post-Megamove structure. As you'll see in the linked issue, you can continue to work on your PR as before, and you can continue to use the Github GUI to "Update branch" - this updates from the new To emphasize again, do not try and merge the scikit-image When we've approved your PR, we'll merge into the Any questions, please reply here. |
Description
This PR implements a prior suggestion to rename
img_as_floattorescale_to_float, etc. This is done primarily to make it clearer that these function rescale the range of the inputs. This change has been discussed a few of times in the past (#1234, #3009 (comment) and #5439)At the moment,
img_as_float,img_as_float32andimg_as_float64are also still here, but no longer rescale the range. We can likely just go ahead and remove this asastypecan already be used to convert dtypes without scaling.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.example, to backport to v0.19.x after merging, add the following in a PR
comment:
@meeseeksdev backport to v0.19.xrun-benchmarklabel. To rerun, the labelcan be removed and then added again. The benchmark output can be checked in
the "Actions" tab.