Skip to content

fix: adaptive tick significant figures so apply_extent ticks never collapse - #653

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/point-fit-source-plane-panel
Oct 21, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/point-fit-source-plane-panel

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

apply_extent rounds 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_ticks now 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 optional max_sig=10 argument; 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_extent on a narrow far-from-zero extent gives 3 distinct x and y labels
  • full test_autoarray: 2184 passed, 4 xfailed
Full 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 (affects apply_extent and yx tick labels only where they previously collapsed).

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

…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>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Oct 21, 2026
@Jammy2211
Jammy2211 merged commit d99ec2b into main Oct 21, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/point-fit-source-plane-panel branch October 21, 2026 17:07
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Oct 23, 2026
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.

1 participant