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

Silence a few RuntimeWarnings in the test suite #4838

Merged
merged 2 commits into from
Jul 12, 2020

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Jul 11, 2020

Description

The first commit avoids a RuntimeWarning from NumPy related to taking log(0) in pathological test cases of threshold_li.

The second fix is in a denoise_wavelet test case. Here, I modified the array used in the test to be non-constant to avoid the detail coefficient array being all zeros (internally to denoise_wavelet, values where the details are exactly 0 are assumed to be masked out, which was leading to an empty slice). The actual values in the array are irrelevant to that test case, so any non-constant array would work, I just chose arange arbitrarily.

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.

grlee77 added 2 commits July 11, 2020 14:25
Internally, denoise wavelet considers regions where the detail coefficients are
exactly zero to be masked. This leads to a warning about an empty slice that is
irrelevant to this test case. Suppress this warning by just using a non-constant
input array instead.
@grlee77 grlee77 added the 🔧 type: Maintenance Refactoring and maintenance of internals label Jul 11, 2020
@grlee77 grlee77 mentioned this pull request Jul 11, 2020
9 tasks
Copy link
Member

@emmanuelle emmanuelle left a comment

Choose a reason for hiding this comment

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

Thanks!

@jni jni merged commit df84166 into scikit-image:master Jul 12, 2020
@grlee77 grlee77 deleted the avoid_runtimewarnings branch August 19, 2020 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔧 type: Maintenance Refactoring and maintenance of internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants