Skip to content

fix: prevent axis flipping in plot_h12_calibration by adding bounds#1018

Merged
jonbrenas merged 6 commits intomalariagen:masterfrom
joshitha1808:GH648-fix-h12-calibration-axis-flip
Mar 20, 2026
Merged

fix: prevent axis flipping in plot_h12_calibration by adding bounds#1018
jonbrenas merged 6 commits intomalariagen:masterfrom
joshitha1808:GH648-fix-h12-calibration-axis-flip

Conversation

@joshitha1808
Copy link
Copy Markdown
Contributor

What problem does this solve:

In plot_h12_calibration, the X axis could flip right-to-left when zooming out aggressively because Range1d had no bounds. Also, using window_sizes[0] and window_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] with min(window_sizes) and max(window_sizes) to handle unsorted input.

Added bounds=(x_start, x_end) to Range1d to prevent axis inversion during pan or zoom.

Relevant issue numbers:

Fixes #648

Testing done:

Ran all tests in tests/anoph/ locally — all passed

Ran pre-commit run --all-files — all checks passed

Verified manually in a Bokeh plot that the X axis no longer flips

Breaking changes or migration notes:

No.

@joshitha1808
Copy link
Copy Markdown
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!

@jonbrenas jonbrenas merged commit 51acce9 into malariagen:master Mar 20, 2026
8 checks passed
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.

Bokeh genome plots flip direction of X axis

2 participants