Repository navigation
enh: expert settings for keyword arguments in the GUI (#12) - #25
Merged
paulmueller merged 1 commit intoNov 26, 2026
Merged
Conversation
- "Settings -> Expert settings..." opens a dialog where users can enter additional `KEY=VALUE` keyword arguments (one per line) for background computation, segmentation, feature extraction and gating, as with `-kb`/`-ks`/`-kf`/`-kg` of `chipstream-cli`. They override the settings of the main window and are kept for the session only. - The dialog validates the arguments for the selected segmenter when OK is clicked; invalid arguments for the segmenter selected at run time prevent the run with an error message. - A warning in the status bar is shown while expert settings are active (tooltip lists them). - The job manager only detects flickering (offset correction) if `offset_correction` is not set explicitly. - ref: the `KEY=VALUE` parsing moved from `chipstream.cli.cli_valid` to the click-free module `chipstream.kwargs_parse`; `cli_valid` wraps it and converts `KeywordArgumentError` to `click.BadParameter`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
==========================================
+ Coverage 78.72% 79.95% +1.22%
==========================================
Files 21 23 +2
Lines 1485 1611 +126
==========================================
+ Hits 1169 1288 +119
- Misses 316 323 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
paulmueller
approved these changes
Nov 26, 2026
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.
Closes #12.
Changes
Expert settings in the GUI
ExpertSettingsDialog(chipstream/gui/dlg_expert.py). It has one text field per pipeline step: background computation (sparsemed), segmentation, feature extraction, and gating. Users enterKEY=VALUEarguments there, one per line, as with-kb/-ks/-kf/-kgofchipstream-cli. Empty lines and lines starting with#are ignored; "Reset" clears all fields.thresh=-4overrides the threshold spin box). Segmentation arguments for mask post-processing (clear_border,fill_holes,closing_disk) go intokwargs_mask.model_file=...while thresholding is selected), the run does not start and an error message is shown.offset_correctioncan now be set in the expert settings. Until now, the job manager always overwrote it with the automatic flickering detection; it now only detects flickering ifoffset_correctionis not given (the main window no longer passes the default value).Refactoring
KEY=VALUEparsing from fix: malformed-ks/-kb/-kf/-kgarguments caused tracebacks #16 moved fromchipstream/cli/cli_valid.pyto the new modulechipstream/kwargs_parse.py, which does not depend on click (the GUI can be installed without thecliextra). It raisesKeywordArgumentError(aValueErrorwith the option name).cli_validkeeps its function names and wraps them, convertingKeywordArgumentErrortoclick.BadParameter, so the CLI messages are unchanged.Tests
test_gui_expert_kwargs_job_kwargs: all four steps end up in the job kwargs and override the main window; the warning is shown/hidden; without expert settings,offset_correctionis not passed.test_gui_expert_kwargs_invalid: invalid arguments for the selected segmenter show an error and do not start the run.test_gui_expert_kwargs_dialog: the dialog keeps invalid input open, ignores comments and empty lines, and returns the arguments.test_gui_expert_kwargs_run: a full run uses the expert settings (thresh:t=-4:cle=1^f=1^clo=3,legacy:b=1^h=0^v=1,o=1).The first three fail on
mainand pass with the change. The CLI tests (-k "kwargs or invalid or parse", 38 tests),test_gui_manager.py,test_gui_correct_offset[True/False],test_gui_basic,test_gui_sys_usageandtest_gui_segm_torch_model_removepass.Lint
lint-compareagainstmain: ruff 0 → 0, pyright 1.1.408 0 → 0, flake8 clean.🤖 Generated with Claude Code