Skip to content

enh: sort the list of segmentation models by name - #26

Merged
paulmueller merged 1 commit into
DC-analysis:mainfrom
paulmueller-agent:sort-torch-models
Nov 26, 2026
Merged

paulmueller merged 1 commit into
DC-analysis:mainfrom
paulmueller-agent:sort-torch-models

Conversation

@paulmueller-agent

Copy link
Copy Markdown

Problem

The model dropdown was sorted by full path at startup (so the directory decided the order), and models added with "+" were appended at the end of the list.

Change

  • New torch_model_sort_key(path) in chipstream/gui/main_window.py: sorts by file name, case-insensitive, with numbers compared by value, e.g. 9x, 10x, Alpha, beta, model_1, Model_2, model_10. Models with the same name are ordered by their full path.
  • The list is sorted with this key at startup, and a model added with "+" is inserted at its sorted position.

Tests

test_gui_segm_torch_models_sorted adds copies of the test model named model_10, Model_2, beta, Alpha, model_1 (in that order) and checks that the list shows Alpha, beta, model_1, Model_2, model_10. It checks the same order again in a new ChipStream window (startup path). It fails on main and passes with the change. The other GUI tests for the model list (test_gui_segm_torch_model_remove) and the expert settings pass.

Lint

lint-compare against main: ruff 0 → 0, pyright 1.1.408 0 → 0, flake8 clean.

🤖 Generated with Claude Code

The model dropdown was sorted by full path at startup, and models added
with "+" were appended at the end. Now the models are sorted by file
name, case-insensitive and with numbers compared by value ("model_2"
before "model_10"); added models are inserted at their sorted position.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.08%. Comparing base (2a6989a) to head (22520a6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
+ Coverage   79.95%   80.08%   +0.13%     
==========================================
  Files          23       23              
  Lines        1611     1622      +11     
==========================================
+ Hits         1288     1299      +11     
  Misses        323      323              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@paulmueller
paulmueller merged commit f7870ce into DC-analysis:main Nov 26, 2026
8 checks passed
paulmueller-agent pushed a commit to paulmueller-agent/ChipStream that referenced this pull request Nov 26, 2026
`test_gui_segm_torch_models_sorted` (DC-analysis#26) added copies of the test
model with names that do not end with the MD5 sum ("Alpha.dcnm"), which
dcnum rejects, and left their directory in the user settings. Every
later ChipStream window preselected the machine-learning segmenter with
"Alpha.dcnm", so the pipeline in `test_gui_pause_button` failed with
"MD5 mismatch".

- name the model copies "<name>_910c2.dcnm" and restore the
  "segm/torch_model_files" setting after the test
- select the thresholding segmenter in `test_gui_pause_button`

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants