fix: prevent axis flipping in plot_h12_calibration by adding bounds#1018
Merged
jonbrenas merged 6 commits intomalariagen:masterfrom Mar 20, 2026
Merged
Conversation
jonbrenas
approved these changes
Mar 20, 2026
Contributor
Author
|
Hi @jonbrenas, Thanks again for reviewing and accepting the PR. All 8 checks have now passed successfully. It should be ready to merge whenever you have time. Please let me know if there’s anything else I should address. Thanks! |
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.
What problem does this solve:
In
plot_h12_calibration, the X axis could flip right-to-left when zooming out aggressively becauseRange1dhad no bounds. Also, usingwindow_sizes[0]andwindow_sizes[-1]assumed a sorted list, which could cause incorrect axis ranges if the list was unsorted.How does it solve it:
Replaced
window_sizes[0] / [-1]withmin(window_sizes)andmax(window_sizes)to handle unsorted input.Added
bounds=(x_start, x_end)toRange1dto prevent axis inversion during pan or zoom.Relevant issue numbers:
Fixes #648
Testing done:
Ran all tests in
tests/anoph/ locally— all passedRan
pre-commit run --all-files— all checks passedVerified manually in a Bokeh plot that the X axis no longer flips
Breaking changes or migration notes:
No.