fix: allow detection-only runs without background channel#610
Open
NiShITa-code wants to merge 1 commit into
Open
fix: allow detection-only runs without background channel#610NiShITa-code wants to merge 1 commit into
NiShITa-code wants to merge 1 commit into
Conversation
alessandrofelder
requested changes
May 4, 2026
Member
alessandrofelder
left a comment
There was a problem hiding this comment.
Thanks for contributing @NiShITa-code and sorry it took so long to get back to you.
I understand your approach, but I don't think it's clean enough - have explained in a comment.
I suggest instead that we keep the arguments, but allow None to be explicitly passed for the background array, rather than being the default.
|
|
||
| # Preserve the historical positional API while allowing callers to omit | ||
| # background data for detection-only runs. | ||
| if voxel_sizes is None: |
Member
There was a problem hiding this comment.
I don't think this is a clean way to retain the API, because while the positional API is maintained, you could pass the voxel sizes via the background array keyword argument, and these are very different things!
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.
Description
What is this PR
Why is this PR needed?
cellfinder.core.main.main(...)currently requires abackground_arrayeven whenskip_classification=True.That blocks single-channel detection-only use cases and causes the Python API to fail before the skip-classification logic is reached. This is also a concrete blocker related to optional-background support discussed in #352.
What does this PR do?
background_arrayoptional at thecellfinder.core.main.main(...)entrypointskip_classification=Trueand no background channel is providedbackground_arraywhen classification is enabledReferences
How has this PR been tested?
I added regression tests covering:
background_arraybackground_arrayI also manually reviewed the changed code paths to ensure classification still requires background input.
Is this a breaking change?
No.
This change preserves existing behavior for classification workflows and only relaxes the API for detection-only runs when
skip_classification=True.Does this PR require an update to the documentation?
No documentation changes were made in this PR.
This is a small bug fix to the Python API behavior. If preferred, I’m happy to add a short note to the API docs in a follow-up PR.
Checklist: