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

FIX: handle 1D array in gaussian filter #5201

Merged
merged 7 commits into from
Feb 1, 2021
Merged

Conversation

sciunto
Copy link
Member

@sciunto sciunto commented Jan 28, 2021

Description

See #5195

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.

@rfezzani rfezzani added the 🩹 type: Bug fix Fixes unexpected or incorrect behavior label Jan 28, 2021
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 @sciunto, I think that the beginning of the gaussian function and may be the _guess_spatial_dimensions error message must be refactored. But I am not sure that an error have to be raised since it is filtered by a try ... Except ... block...

skimage/filters/tests/test_gaussian.py Outdated Show resolved Hide resolved
Co-authored-by: Riadh Fezzani <rfezzani@gmail.com>
@sciunto
Copy link
Member Author

sciunto commented Jan 29, 2021

Thank you @sciunto, I think that the beginning of the gaussian function and may be the _guess_spatial_dimensions error message must be refactored. But I am not sure that an error have to be raised since it is filtered by a try ... Except ... block...

I would even wonder whether keeping a guess is the right thing. I thought we want to avoid as much as possible magic. Other opinions @jni @emmanuelle ?

@pep8speaks
Copy link

pep8speaks commented Jan 29, 2021

Hello @sciunto! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 159:80: E501 line too long (83 > 79 characters)

Line 20:1: W293 blank line contains whitespace

Comment last updated at 2021-02-01 10:51:32 UTC

@grlee77
Copy link
Contributor

grlee77 commented Jan 29, 2021

I would even wonder whether keeping a guess is the right thing. I thought we want to avoid as much as possible magic. Other opinions @jni @emmanuelle ?

We have mostly gotten rid of this type of guessing elsewhere (this function is one exception noted in the list at the top of #2613). It looks like @jni and I discussed it here: #2613 (comment) and decided to address it as part of #4294. Working on that issue is one of my near-term priorities for the CZI grant, so we should be able to make progress soon.

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.

I vote for merging this as-is and then deal with removing _guess_spatial_dimensions separately

skimage/filters/_gaussian.py Outdated Show resolved Hide resolved
sciunto and others added 2 commits February 1, 2021 11:42
Co-authored-by: Gregory R. Lee <grlee77@gmail.com>
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 @sciunto, waiting for the green button before merging 😉

@jni
Copy link
Member

jni commented Feb 1, 2021

Failure is expected from #5211, so I'll merge now. Thanks everyone!

@jni jni merged commit 076497c into scikit-image:master Feb 1, 2021
@stefanv
Copy link
Member

stefanv commented Feb 2, 2021

Thanks for fixing this @sciunto!

The new docstring does not look right: ValueError "If the image array has less than four dimensions.".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🩹 type: Bug fix Fixes unexpected or incorrect behavior 🧐 Needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants