Repository navigation
fix: adaptive tick significant figures so apply_extent ticks never collapse - #653
Merged
Merged
Conversation
…llapse _round_ticks adds significant figures (up to 10) until distinct ticks stay distinct, so a milli-arcsecond extent far from zero no longer labels every tick with the same value. Part of PyAutoLabs/PyAutoLens#789. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 21, 2026
Merged
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.
Summary
apply_extentrounds its arc-second ticks to 2 significant figures. On a narrow extent far from zero (a few milli-arcseconds at 1.2", as on PyAutoLens's new point-source "Fit Source Plane" panel) every tick rounded to the same value and the labels collapsed to one repeated number (1.2",1.2",1.2")._round_ticksnow adds significant figures (up to 10) until the rounded ticks are as distinct as the input ticks, so they never collapse. Extents that already rounded to distinct values (every existing figure) are unchanged.Part of PyAutoLabs/PyAutoLens#789 (merge this before the PyAutoLens PR).
API Changes
None — internal changes only.
_round_ticks(private) gains an optionalmax_sig=10argument; its rounding only changes when 2 significant figures would make distinct ticks identical.See full details below.
Test Plan
test_autoarray/plot/test_utils.py: default 2-sig-fig rounding unchanged; mas-scale ticks at 1.2" stay distinct ([1.197, 1.2, 1.203]);apply_extenton a narrow far-from-zero extent gives 3 distinct x and y labelstest_autoarray: 2184 passed, 4 xfailedFull API Changes (for automation & release notes)
Changed Behaviour
autoarray.plot.utils._round_ticks(values, sig=2, max_sig=10)— raises the significant figures until distinct ticks stay distinct (affectsapply_extentandyxtick labels only where they previously collapsed).Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code