Skip to content
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

Slight shape_index docstring modification to specify 2D array #5509

Merged
merged 1 commit into from
Aug 14, 2021

Conversation

Yash-10
Copy link
Contributor

@Yash-10 Yash-10 commented Aug 11, 2021

Description

I was recently exploring the shape_index function and found some discussion here: https://mail.python.org/archives/list/scikit-image@python.org/thread/Q5FNUVXJBCB7YDAGHKTO7EUQORR7WMGF/ where, I think, @emmanuelle had suggested changing the docstring to explicitly state that 2D arrays are expected. From what I see, this change seems to not have been added yet, so I have tried to do it here.

Thanks!

Checklist

For reviewers

  • 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.

Copy link
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.

Thanks @Yash-10

I made a suggestion, but it would be good for other maintainers to confirm if this is indeed the style we settled on (I did not look up the issue just now)

@@ -455,7 +455,7 @@ def shape_index(image, sigma=1, mode='constant', cval=0):

Parameters
----------
image : ndarray
image : 2D array
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
image : 2D array
image : (M, N) ndarray

I think this should probably be (M, N) ndarray, but haven't tracked down the issue where we discussed the style to use previously.

None of the functions in this corner.py file use that style, but many others in the library do (See for example haar.py, match.py, orb.py in this same folder)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion!

Copy link
Member

Choose a reason for hiding this comment

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

I can not either remember if we already specified the style to use, but I think that you are right @grlee77: the style you are suggesting is already used in many places in the repo.

Copy link
Member

Choose a reason for hiding this comment

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

Right. Apparently, we also have:

footprint : 2D array, shape (M, N)

in some places. Let's stick with (M, N) ndarray.

Copy link
Member

@rfezzani rfezzani left a comment

Choose a reason for hiding this comment

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

Thank you @Yash-10 for your contribution 😉

@grlee77 grlee77 merged commit 506114f into scikit-image:main Aug 14, 2021
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.

None yet

4 participants