feat(gui): add data clean-up menu (duplicates, pixel dust, empty traces)#88
Merged
Conversation
Add a "Clean up" submenu under the Series menu (issue #67) grouping three series-wide data-maintenance operations, each a single undoable action with a progress bar via the existing enumerateSections/SeriesStates path: - Remove duplicate traces (pre-existing op, folded into the submenu): same object name AND geometrically coincident on the same section (exact points or IoU overlap above a threshold, default 0.95). Never merges distinct objects. - Remove pixel-dust traces: small closed traces at or below a user-chosen area threshold (um^2, computed like the object/trace tables), presented in a reviewable list (PixelDustDialog) so the user inspects and deselects before anything is deleted. Deletion reuses deleteMalformedTraces (signature match). - Remove empty traces: degenerate geometry only (no points, zero-area closed, zero-length open), removed after a count-stating confirmation. Locked objects are left untouched (the review-list delete path refuses them). Generalizes MalformedContoursDialog with an overridable column/heading spec so PixelDustDialog reuses its selection/navigation/delete/export behaviour. Tests: tests/test_data_cleanup.py exercises each op end-to-end on shapes1.jser with synthetic traces, including threshold edges, locked skipping, the distinct-object false-positive guard, and single-undo restoration across multiple sections. Full suite green (1243 passed). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LiM1igjbwUJfVBgR7Y31Kp
dustenhubbard
enabled auto-merge (squash)
July 21, 2026 23:49
dustenhubbard
added a commit
that referenced
this pull request
Jul 23, 2026
…es) (#88) Add a "Clean up" submenu under the Series menu (issue #67) grouping three series-wide data-maintenance operations, each a single undoable action with a progress bar via the existing enumerateSections/SeriesStates path: - Remove duplicate traces (pre-existing op, folded into the submenu): same object name AND geometrically coincident on the same section (exact points or IoU overlap above a threshold, default 0.95). Never merges distinct objects. - Remove pixel-dust traces: small closed traces at or below a user-chosen area threshold (um^2, computed like the object/trace tables), presented in a reviewable list (PixelDustDialog) so the user inspects and deselects before anything is deleted. Deletion reuses deleteMalformedTraces (signature match). - Remove empty traces: degenerate geometry only (no points, zero-area closed, zero-length open), removed after a count-stating confirmation. Locked objects are left untouched (the review-list delete path refuses them). Generalizes MalformedContoursDialog with an overridable column/heading spec so PixelDustDialog reuses its selection/navigation/delete/export behaviour. Tests: tests/test_data_cleanup.py exercises each op end-to-end on shapes1.jser with synthetic traces, including threshold edges, locked skipping, the distinct-object false-positive guard, and single-undo restoration across multiple sections. Full suite green (1243 passed).
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.
First attempt at upstream #67's data-cleanup menu (fork-first; NOT submitted upstream — #67 is multi-assignee, coordinate after Dev review). Also the agreed strategy for Copy-to-sections collisions.
New 'Clean up' submenu under Series (folds in the existing Remove duplicate traces):
All three: single-undo via the series-states path, progress bar, locked objects skipped, confirm/review before deleting. Duplicate detection scoped per object name so distinct overlapping objects are never flagged. 11 new tests; full suite 1243 passed, 5 pre-existing xfails.
Open design questions carried to the maintainer's Dev review (see below).
🤖 Generated with Claude Code