-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
WIP: Overhaul transform
module
#3148
Conversation
Hello @kne42! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2019-04-06 00:49:31 UTC |
cc @jni |
@kne42 Since this is going to touch so many files, it's important for the commit messages to be extremely thorough, and for the commits to be nicely separated. Specifically, I suggest making one commit for moving transform/ to transform_xy/, another for creating the alias for transform -> transform_xy, together with a deprecation message, and another for creating transform_rc. Also, for the initial transform_rc "port", you could simply use the existing warps functions, but transpose the coordinates. This would let us actually merge this and then add nD capabilities little by little. What do you think? |
While I do agree on making the commit messages thorough, I typically prefer to group commits together with message prefixes and then squash them prior to a merge. However, I suppose that this, being the massive change that it is, warrants individual commit messages for each task at hand.
Oooh yes I like this idea! Cleans up PR history too :P |
Oopsies, that was an accident! Anyways, @jni lmk if you spot me missing anything! This is a pretty large change so I'm not quite sure if I covered everything necessary/went too far. Also, for the functions that are already nD/take in full-on images instead of just coordinates, do you think that we should put them in |
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.
@kne42 Unless I missed it, this doesn't yet handle the transform deprecation or the creation of transform_rc?
And, to answer your question, yes, I think I was too optimistic in recommending the wholesale move of transform->transform_xy. I think only the parts depending on _warp
need to be moved...
@@ -36,7 +36,7 @@ | |||
from sklearn.metrics import roc_auc_score | |||
|
|||
from skimage.data import lfw_subset | |||
from skimage.transform import integral_image | |||
from skimage.transform_xy import integral_image |
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'm kinda thinking that the examples should be updated to use transform_rc
...
skimage/transform_xy/_warps.py
Outdated
@@ -37,7 +37,7 @@ def resize(image, output_shape, order=1, mode='reflect', cval=0, clip=True, | |||
Performs interpolation to up-size or down-size images. Note that anti- | |||
aliasing should be enabled when down-sizing images to avoid aliasing | |||
artifacts. For down-sampling N-dimensional images with an integer factor | |||
also see `skimage.transform.downscale_local_mean`. | |||
also see `skimage.transform_xy.downscale_local_mean`. |
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.
Despite my initial suggestion, I think I'd like to apply a bit of smarts to this migration... Specifically, transforms that don't rely on coordinate conventions, such as this one, should not be deprecated/migrated.
In other words, to answer your question: yes I think we should only migrate the transforms that rely on x/y coordinates. I think that's a large proportion, but maybe I'm wrong...
skimage/transform_xy/_warps.py
Outdated
@@ -208,7 +208,7 @@ def rescale(image, scale, order=1, mode='reflect', cval=0, clip=True, | |||
---------------- | |||
order : int, optional | |||
The order of the spline interpolation, default is 1. The order has to | |||
be in the range 0-5. See `skimage.transform.warp` for detail. | |||
be in the range 0-5. See `skimage.transform_xy.warp` for detail. |
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'm concerned about the documentation. Generally, when we deprecate, we want to point to the new way of doing things. The only reason to keep the old way hanging around is for backwards compatibility. But anyone new who checks the docs should be pointed to the One True Way of doing things, and that's the new way.
Hey everyone, what is the status of this PR? Is this something you or we as a team want to pick at some point? I'm asking because I'm preparing a proposal for an Outreachy project that would focus on our |
@lagru I would say that this should at this point get subsumed into the skimage2 plans, so we can close this. |
Fine by me. I added it to https://hackmd.io/@mkcor/HyYOmLnaO so that it's not forgotten. |
Refactorizations & Deprecations
transform
module totransform_xy
transform_rc
moduletransform
module aroundtransform_xy
with automatic deprecation messagesChanges (implemented in
transform_rc
)scipy
'sLowLevelCallable
sOther
LowLevelCallable
notes may be found in this notebook.