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

DOC: Add missing description to brute_force parameter. #8507

Conversation

jhlegarreta
Copy link

Add missing description to the brute_force parameter to the docstrings
of the ndimage.morphology.binary_dilation and
ndimage.morphology.binary_erosion methods.

Also made the origin parameter description come after the one for
border_value to match the method signature.

Resolves #8492.

Add missing description to the `brute_force` parameter to the docstrings
of the `ndimage.morphology.binary_dilation` and
`ndimage.morphology.binary_erosion` methods.

Also made the `origin` parameter description come after the one for
`border_value` to match the method signature.

Resolves scipy#8492.
@jaimefrio
Copy link
Member

I took a closer look after seeing your #8492 (comment).

The low level function to call is decided here:

if iterations == 1:
and the branches are:

if iterations == 1:
    _nd_image.binary_erosion(...)  # the "dumb" erosion function
elif cit and not brute_force:
    _nd_image.binary_erosion2(...)  # the "smart" erosion function
else:
    _nd_image.binary_erosion(...)  # the "dumb" erosion function

So if we wanted to be picky, setting brute_force = True ensures that all iterations will be dumb, while with the default brute_force = False an attempt will be made to be smart, if possible, i.e. if the center of the structuring element is true.

If you want to redo the text, I'll let this sit for a day or two before merging, but I think the current wording is sufficiently accurate.

@jhlegarreta
Copy link
Author

@jaimefrio OK, thanks for clarifying this. In light of your explanation, I'd also say that the current wording is sufficient. So ready to be merged.

@jaimefrio jaimefrio merged commit e87e071 into scipy:master Mar 2, 2018
@jaimefrio
Copy link
Member

In it goes then, thanks!

@ilayn ilayn added this to the 1.1.0 milestone Mar 2, 2018
@ilayn ilayn added scipy.ndimage Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org labels Mar 2, 2018
@jhlegarreta jhlegarreta deleted the FixMissingMorphologyParameterDocumentation branch June 24, 2019 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.ndimage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants