🐛 Fix handling of None return_predictions in NucleusInstanceSegmentor CLI#1089
Open
Anannya30 wants to merge 5 commits into
Open
🐛 Fix handling of None return_predictions in NucleusInstanceSegmentor CLI#1089Anannya30 wants to merge 5 commits into
None return_predictions in NucleusInstanceSegmentor CLI#1089Anannya30 wants to merge 5 commits into
Conversation
When CLI passes return_predictions=None, any() crashes on line 1972. Added 'or (False,)' to safely default to (False,) when None is passed. Fixes nucleus instance segmentor AnnotationStore output via CLI.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1089 +/- ##
========================================
Coverage 99.88% 99.88%
========================================
Files 85 85
Lines 11656 11657 +1
Branches 1531 1531
========================================
+ Hits 11643 11644 +1
Misses 7 7
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Thank you @Anannya30 . Please could you add a test to catch this error? Also as the bug is in CLI, this should be fixed in |
* 🔥 Remove `albumentations` dependencies * 🔥 Remove `albumentations` dependencies * ✅ Add tests for coverage * ✅ Add tests for coverage * 🐛 Fix deepsource error
…_cli_default_return_predictions to catch this regression.
Author
|
Hi @shaneahmed, thank you for the review! I have made both changes you requested:
Please review and let me know. |
None return_predictions in NucleusInstanceSegmentor CLI
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.
Problem :-
When running nucleus-instance-segmentor via CLI with AnnotationStore
output, it crashes with:
any(rp_ is True for rp_ in None)
TypeError: 'NoneType' is not iterable
This happens because CLI passes return_predictions=None but line 1972
expects a tuple.
Fix :-
Added
or (False,)fallback:return_predictions = kwargs.get("return_predictions") or (False,)
Testing :-
Verified fix works by running hovernet_fast-pannuke on a real WSI
region and successfully generating AnnotationStore output.