Repository navigation
fix: smooth contour spacing reported success when aborted mid-iteration - #419
Merged
paulmueller merged 1 commit intoNov 19, 2026
Merged
Conversation
- pass a flat list of quantiles to `get_contour_lines` (the nested list only worked by chance, the contour levels were nested as well) - check the abort event after iterating over the datasets Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
paulmueller-agent
force-pushed
the
fix/smooth-contour-quantiles
branch
from
November 19, 2026 09:12
a3f39c2 to
9d17956
Compare
paulmueller
approved these changes
Nov 19, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #419 +/- ##
=======================================
Coverage 93.00% 93.00%
=======================================
Files 124 124
Lines 9725 9727 +2
=======================================
+ Hits 9045 9047 +2
Misses 680 680 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Two issues in
dclab.kde.smooth_contour.find_smooth_contour_spacing:Nested quantiles:
get_contour_lineswas called withquantiles=[[np.max(quantiles)]]. This worked by chance:np.nanpercentilereturned a (1, 1) array, iterating over the normalized levels yielded a 1-element array per quantile, andfind_contours_levelaccepted that. The contours were identical to the flat version, but the levels were nested ([[1.42]]instead of[1.42]). Now a flat list is passed. The results are unchanged (all pinned values intest_kde_smooth_contour.pystill pass).Abort during iteration: when
abort_eventwas set while iterating over the datasets, the inner loop was left withbreak, which skipped thefor ... elseblock. With no (or only some) contours checked,max_dphistayed small, so the function returnedsuccess=Truewith reason "target opening angle reached". The abort event is now checked after the loop over the datasets (reason "abort event",success=False). I replaced thefor ... elseconstruct with explicit checks.New test
test_find_smooth_contour_abort_during_iteration(fails without the fix).🤖 Generated with Claude Code