Repository navigation
enh: add a button for removing segmentation models from the list (#11) - #23
Merged
paulmueller merged 2 commits intoNov 26, 2026
Merged
Conversation
…analysis#11) The "-" button next to "+" removes the selected model from the model list. The model file is not deleted. Since ChipStream remembers the directories of model files (and lists all models in them), removed models are stored in the setting "segm/torch_model_files_removed" so that they stay hidden in the next session. Adding a removed model again with "+" lists it again. Adding the same model twice no longer creates a duplicate entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23 +/- ##
==========================================
+ Coverage 78.22% 78.41% +0.19%
==========================================
Files 20 20
Lines 1428 1464 +36
==========================================
+ Hits 1117 1148 +31
- Misses 311 316 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Other GUI tests add the same test model (same file name) from other temporary directories, so counting models by name failed in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #11.
Changes
ui/main_window.ui, regeneratedmain_window_ui.pywithui/run_uic.sh; only the new button changes). It is enabled whenever models are listed.on_torch_model_removeremoves the selected model from the list. The model file itself is not deleted.segm/torch_model_files) and lists all*.dcnmfiles in them at startup. To keep a removed model hidden in the next session, its path is stored in the new settingsegm/torch_model_files_removed(removed when empty) and filtered out at startup. I chose this over storing individual model files, because it leaves the existing setting (and dcnum's search paths for finding models by name) unchanged.QComboBox.findDatadoes not comparepathlib.Pathby value, so the paths are compared explicitly).Tests
test_gui_segm_torch_model_remove: adding a model twice lists it once; removing it takes it out of the list and stores it in the setting without deleting the file; a newChipStreamwindow (new session) does not list it; adding it again lists it again. It restores the originalsegm/torch_model_files_removedvalue (the GUI tests use the real user settings). It fails onmainand passes with the change.test_gui_basic,test_gui_set_pixel_sizeandtest_gui_basins[True]pass (offscreen).Lint
lint-compareagainstmain: ruff 0 → 0, pyright 1.1.408 0 → 0, flake8 clean.🤖 Generated with Claude Code