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

Bug: should return 0 if no regions found #3083

Merged
merged 2 commits into from
Nov 24, 2013

Conversation

tacaswell
Copy link
Contributor

Improved the test coverage to check that the returned number of regions is correct.

Added special case above the merge logic in _ni_label.pyx

It may be better to short-circuit this earlier, but I thought this would be the minimal change.

fixes #3082

added check on `n` for all tests of label()
Added special-case logic for the case were no regions were found so
that 0 is returned instead of 1

Fixes issue scipy#3082
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling fba0496 on tacaswell:bug_empty_label_3082 into 572aaf0 on scipy:master.

@rgommers
Copy link
Member

@thouis want to review this one?

@thouis
Copy link
Contributor

thouis commented Nov 19, 2013

Looks good to me.

rgommers added a commit that referenced this pull request Nov 24, 2013
Bug: should return 0 if no regions found
@rgommers rgommers merged commit ca668b4 into scipy:master Nov 24, 2013
@rgommers
Copy link
Member

Thanks, merged. Will backport to 0.13.x as well.

@rgommers
Copy link
Member

backported in aeac90a

@tacaswell tacaswell deleted the bug_empty_label_3082 branch November 24, 2013 17:35
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.

Wrong output of scipy.ndimage.measurements.label()
4 participants