Fix #605: make background_array optional when skip_classification=True#607
Open
KpradeepKumar25 wants to merge 2 commits intobrainglobe:mainfrom
Open
Fix #605: make background_array optional when skip_classification=True#607KpradeepKumar25 wants to merge 2 commits intobrainglobe:mainfrom
KpradeepKumar25 wants to merge 2 commits intobrainglobe:mainfrom
Conversation
background_array was always required even when skip_classification=True. This fix makes it default to None and adds a ValueError with a clear message when classification is attempted without a background array. Fixes brainglobe#605
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background_array was always required even when skip_classification=True. This fix makes it default to None and adds
ValueError with a clear message when classification is attempted without a background array.
Fixes #605
Before submitting a pull request (PR), please read the contributing guide.
Please fill out as much of this template as you can, but if you have any problems or questions, just leave a comment and we will help out :)
Description
What is this PR
Why is this PR needed?
background_array was always a required argument even when skip_classification=True. This blocked researchers who only have
a single channel (signal only) from using cellfinder for detection without classification.
What does this PR do?
classification without providing background_array
References
Fixes #605
Related to #352
How has this PR been tested?
Manually verified that calling main() with skip_classification=True and no background_array no longer raises a TypeError.
Also verified that calling main() with skip_classification=False and no background_array now raises a clear ValueError.
Is this a breaking change?
No. Users who already pass background_array will see no change. Users who pass skip_classification=True without background_array will now get the expected behaviour instead of a TypeError.
Does this PR require an update to the documentation?
The docstring for background_array in main() has been updated to reflect it is now optional.
Checklist: