Skip to content

Change feret_diameter to feret_diameter_max#4820

Merged
jni merged 3 commits intoscikit-image:masterfrom
maxfrei750:patch-1
Jul 14, 2020
Merged

Change feret_diameter to feret_diameter_max#4820
jni merged 3 commits intoscikit-image:masterfrom
maxfrei750:patch-1

Conversation

@maxfrei750
Copy link
Copy Markdown
Contributor

Description

Fixes #4817

  • Check that the PR title is short, concise, and will make sense 1 year
    later.
  • Check that new functions are imported in corresponding __init__.py.
  • Check that new features, API changes, and deprecations are mentioned in
    doc/release/release_dev.rst.

The calculated property is the maximum Feret diameter and should IMHO be named as such to avoid confusion.
@maxfrei750
Copy link
Copy Markdown
Contributor Author

I thought feret_diameter_max might make more sense than max_feret_diameter, because that way all potential Feret diameters would be grouped, in alphabetic property lists (e.g. documentation).

@jni
Copy link
Copy Markdown
Member

jni commented Jul 5, 2020

@maxfrei750 It looks like some tests are failing. I’m on my phone so I can’t investigate right now. The changes look ok to me.

@scikit-image/core I’m agnostic on max_feret vs feret_max. max- sounds better but I agree with @maxfrei750 that the grouping with -max/-min is a nice idea.

On the other hand, we have max-intensity, min-intensity, and mean-intensity...

Any thoughts?

@maxfrei750
Copy link
Copy Markdown
Contributor Author

@jni I already saw the errors, however I don't understand what they are caused by. There are loads of key errors like the following one in the "collection" section:
ERROR feature/tests/test_util.py - KeyError: 'feret_diameter_max'

Concerning max_feret vs feret_max: I agree that a consistency with min-intensity, etc. would be nice. However, I still like the idea of similar properties being grouped. Especially, since the Feret diameters would be mixed with the intensities, if both were to begin with min, mean, max. Therefore, IMHO it would be good to rename the intensities as well. Of course, breaking the API is quite drastic, so maybe for now, we could go with max_feret and change it in 1.0, along with the intensities.

@grlee77
Copy link
Copy Markdown
Contributor

grlee77 commented Jul 6, 2020

The docstring in regionprops needs to be updated as well. At the moment it still states

    **feret_diameter** : float
        Maximum Feret's diameter computed as the longest distance between

which doesn't match the update name. There is some code in _parse_docs that parses the regionprops docstring and might be the source of the errors you are seeing.

@maxfrei750
Copy link
Copy Markdown
Contributor Author

@grlee77 Thanks for the hint. Changing the docstring has fixed the problems.

Copy link
Copy Markdown
Contributor

@grlee77 grlee77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I don't have a strong opinion on feret_diameter_max vs. max_feret_diameter. The second reads a bit better to me, but the first would be easier to quickly find in the list if someone is searching for "Feret diameter".

There is an unrelated matplotlib-related CI failure in one case on Travis that shouldn't block this going in once Appveyor completes.

@maxfrei750
Copy link
Copy Markdown
Contributor Author

I'd like to finalize this PR. Any final thoughts concerning the naming?

@stefanv
Copy link
Copy Markdown
Member

stefanv commented Jul 14, 2020

I like the way it is now---it is more easily discoverable.

@jni
Copy link
Copy Markdown
Member

jni commented Jul 14, 2020

Looks like we have a consensus!!! Thank you @maxfrei750!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rename feret_diameter -> max_feret_diameter ?

4 participants