Skip to content

Clean-up 2/3: functions that do one thing (nothing over 60 lines) - #35

Merged
guijacquemet merged 7 commits into
mainfrom
claude/cleanup-split-functions
Oct 8, 2026
Merged

guijacquemet merged 7 commits into
mainfrom
claude/cleanup-split-functions

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Theme 2 of the clean-up pass (plan section 5). Pure refactor: no public name, output text, ordering, exception type, schema or protocol message changes, and no existing test was edited. 7 commits, one per module or related group.

Longest functions before -> after: introspection._param 102 -> short driver + _add_type_fields, _add_number_fields, _add_display_fields, _add_widget_fields, _add_dependency_fields (same order, so key order and the first error raised are unchanged); testing._compare 87 -> a dispatcher over six _compare_*; __main__.build_parser 85 -> one _add_<command>_command per subcommand (top-level and every subcommand help diffed byte for byte); client.WorkerProcess.__init__ 81 -> 51 (_worker_env, _spawn); testing.run_case 74 -> 42; cli.cmd_run 64 -> 43; cli.diagnose 63 -> _diagnose_app; registry.register 63 -> 40; worker._run_task 62 -> two outcome helpers. Nothing is over 60 lines now; nine are between 40 and 51 and were judged readable as they are.

Verification: the same test counts as before the change (225 passed, 2 skipped, 11 subtests; the one flaky-under-load test did not flake). Because the two riskiest splits (_param, _compare) have error paths the tests only partly cover, I also compared the generated schemas of every real app declaration on main vs this branch: the example apps, NucleiSky, GuessTheCondition, the Playground and VLab4Mic all produce byte-identical JSON (key order included); and I ran real tool cases through the split testing.py (Playground feature tour, NucleiSky devices): all pass. Not run: the root-only deselected test.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN


Generated by Claude Code

claude added 7 commits October 8, 2026 05:38
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
…helpers

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
@guijacquemet
guijacquemet merged commit a69aa82 into main Oct 8, 2026
0 of 14 checks passed
guijacquemet added a commit that referenced this pull request Oct 14, 2026
…y) (#134)

All three hosts honour the app_hosts_v1 rule (Napari #61, QuPath #35, Fiji #47 merged); template #33 is not merged. Sweeps README, HOST_FEATURES, REPOSITORIES, PROTOCOL, HUMAN_TEST_PROTOCOL, TESTING, the release sandbox README and two case files; OPERATIONS: Napari row (no main.zip since #60, placeholder <NAPARI_TAG>) and planned release numbers; TESTING: Known CI flake note.


Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN

Co-authored-by: Claude <noreply@anthropic.com>
@guijacquemet
guijacquemet deleted the claude/cleanup-split-functions branch October 14, 2026 16:09
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