Add optional arcsecond double-prime tick labels#350
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in plotting configuration to render arcsecond tick labels using a double-prime glyph placed over the decimal point, while preserving the existing trailing-quote formatting by default. This fits into autoarray.plot’s config-driven plotting utilities used across the PyAuto ecosystem.
Changes:
- Add
visualize.general.ticks.symbol_over_decimalconfig flag (defaultfalse) in packaged defaults. - Extend
_arcsec_labels(...)to emit labels like3.″8/3″when the flag is enabled, otherwise keep3.8"/3". - Add unit tests covering both the default and opt-in formatting paths.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
autoarray/plot/utils.py |
Adds a config-backed boolean flag reader and updates _arcsec_labels to support symbol-over-decimal formatting. |
autoarray/config/visualize/general.yaml |
Introduces the new ticks.symbol_over_decimal default configuration key. |
test_autoarray/plot/test_utils.py |
Adds tests validating default suffix labels and the opt-in double-prime formatting. |
Comment on lines
+6
to
+10
| def test_arcsec_labels_default_suffix_format(): | ||
| conf.instance["visualize"]["general"]["ticks"]["symbol_over_decimal"] = False | ||
|
|
||
| assert _arcsec_labels([-1.0, 0.0, 1.0]) == ['-1"', '0"', '1"'] | ||
| assert _arcsec_labels([3.8]) == ['3.8"'] |
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
Adds an optional plotting config toggle for arcsecond tick labels that places the arcsecond symbol over the decimal point using the Style Guide double-prime glyph. The default remains off, preserving existing downstream plot labels unless a caller or workspace explicitly opts in.
API Changes
Adds one optional config key,
visualize.general.ticks.symbol_over_decimal, defaulting tofalse.When enabled, 2D arcsecond tick labels use the double-prime symbol over the decimal point, e.g.
3.″8; when disabled, labels remain unchanged, e.g.3.8".See full details below.
Test Plan
NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib python -m pytest test_autoarray/plot/test_utils.py test_autoarray/plot/test_output.pyNUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib python -m pytest test_autoarray/ -xFull API Changes (for automation & release notes)
Added
visualize.general.ticks.symbol_over_decimal— optional plotting config key, defaultfalse, for placing arcsecond symbols over decimal points in 2D plot tick labels.Changed Behaviour
_arcsec_labels(...)keeps the existing ASCII trailing-quote output whensymbol_over_decimalis false._arcsec_labels(...)emits double-prime arcsecond labels such as3.″8,-1.″69, and3″whensymbol_over_decimalis true.Migration
conf.instance["visualize"]["general"]["ticks"]["symbol_over_decimal"] = Trueor provide the equivalent config override.🤖 Generated with Claude Code