-
-
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
Introduce a consistent naming scheme for measure.regionprops #5254
Conversation
@maxfrei750 thanks for the PR! Is the PR a proof of concept that should be merged for 1.0 or do you intend to have it merged ASAP? In the latter case we should keep the old names as well for compatibility (and just return the new prop of course). |
@emmanuelle In #5213 @jni proposed to merge this in version 1.0, so I'd keep it that way, if you agree. |
@emmanuelle Does this PR need any changes to be merged in 1.0? |
The code here looks good to me and I think the naming scheme is better than before. I think the question is whether we want to provide a transition period in 0.19 where the old names still work, but warn users that the names will change in 1.0. @scikit-image/core what do you think? If we do just switch the names in 1.0, we should add a summary table somewhere in the release notes to help users with the transition. Most likely we can write a short guide to the main API changes in 1.0 outside of this PR. |
This was a related naming change discussed in #4821. While we are already changing things here, wouldn't it make sense to do this at the same time? |
Maybe a utililty function that can translate old names to new names would be useful for transitioning old code. |
It may be easiest to just leave the old names in place as well, but hide them (or not advertise them). |
Hi @maxfrei750, the naming scheme used here looks great and I want to try and help get this in for a 0.19 release (assuming we are going to also maintain the older snake case names in an undocumented fashion (as @stefanv suggested in the prior comment)) Actually, looking at this more closely, I think the current PROPS dictionary's purpose was to maintain compatibility with an even older set of CamelCase names used in |
fix mistake made during merge from main branch in __getattr__ add comment on PROPS dictionary purpose
@maxfrei750: Please see maxfrei750#1 which updates the PROPS dict in the suggested fashion and fixes a test failure that may have been introduced when I merged |
Keep all legacy names in PROPS dictionary
@grlee77 Thanks for your contribution and especially for catching my mistake with the |
I see that #4821 also suggested |
@grlee77 Good point! Thanks for pointing that out. Feel free to incorporate this change, or I will do it myself, as soon as I find the time. |
I will go ahead and add it now |
@grlee77 Thanks! |
Note that when recently discussing various API-related things, there was a point brought up that "max intensity", etc. read as more clearly than "intensity max", etc. While this is true, I don't personally think that outweighs the benefit of the more coherent organization proposed here (see also discussion in #5213) @scikit-image/core, please speak out in the next week or so if there are still any strong objections to making this change. If we are going to do it, let's get it in for 0.19. We had also discussed whether or not to drop the undocumented legacy property names at some point, but that is more suited to a separate PR if we decide to go that route. |
I agree that the more logical/hierarchical organization is worth the slight reduction in "intuitive" readability here. I.e., I am -0 on removing the legacy names—not a big deal. |
Hi @grlee77, Thanks for the reminder through #5169 (comment). I don't have strong objections either way. So I'm happy to follow @stefanv on this one. |
@@ -397,36 +421,36 @@ def intensity_image(self): | |||
) | |||
return self._intensity_image[self.slice] * image | |||
|
|||
def _intensity_image_double(self): | |||
return self.intensity_image.astype(np.double) | |||
def _image_intensity_double(self): |
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.
Since this is an internal function, I guess the renaming wasn't necessary... Fine, though.
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.
For example, function get_intensity_image
and attribute _intensity_image
are not being renamed here...
…able Follow up to scikit-imagegh-5254. This should have been deprecated in that PR instead of removed.
…able Follow up to scikit-imagegh-5254. This should have been deprecated in that PR instead of removed.
Description
Closes #5213.
For reviewers
later.
__init__.py
.doc/release/release_dev.rst
.