Skip to content

feat: forward arcsec_after_decimal through plot_array - #612

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/arcsec-after-decimal
Sep 10, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/arcsec-after-decimal

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Downstream leg of PyAutoLabs/PyAutoArray#546 — see PyAutoLabs/PyAutoArray#547.

⚠️ Library-first merge gate

Merge PyAutoLabs/PyAutoArray#547 first. This PR forwards a keyword that only exists on autoarray.plot.plot_array once that PR lands; against an older autoarray it raises TypeError: plot_array() got an unexpected keyword argument — but only when a caller actually passes arcsec_after_decimal, since the default is None and it is forwarded unconditionally.

Summary

autogalaxy.util.plot_utils.plot_array wraps autoarray.plot.plot_array with an explicit keyword signature and no **kwargs, so it has to name a parameter in order to pass it on. This adds arcsec_after_decimal and forwards it.

That wrapper is also what autolens.plot re-exports (autolens/plot/__init__.py:12 imports plot_array from autogalaxy.util.plot_utils), so this one-line forward is what makes the originating request's acceptance criterion — aplt.plot_array(array=array, arcsec_after_decimal=True) — work for both galaxy and lens users. PyAutoLens itself needs no change.

API Changes

autogalaxy.util.plot_utils.plot_array gains one optional trailing keyword, arcsec_after_decimal=None, forwarded verbatim to autoarray.plot.plot_array. True places the arcsecond ″ over the decimal point (3.″8), False forces the suffix form (3.8"), None (the default) reads the ticks.symbol_over_decimal config flag.

Purely additive and appended last, so no positional call site is affected and default behaviour is unchanged.

See full details below.

Test Plan

  • Related plot tests (test_plot_array_mask.py, test_plot_norm.py, mat_wrap/test_visuals.py) → 22 passed, run against the branch checkout of PyAutoArray
  • End-to-end through this wrapper on a 10×10 Array2D, reading tick labels back off the axes: True → ['-1.″9', '0.″0', '1.″9']; None and False → ['-1.9"', '0.0"', '1.9"']; the PNG is written in all three cases
  • Re-export reachability confirmed: aplt.plot_array is plot_utils.plot_array → True, and the signature carries arcsec_after_decimal → True

Heart gate: pyauto-heart is not reachable from this remote session, so the documented fallback (per-repo pytest as the gate) was used — see the counts above.

Full API Changes (for automation & release notes)

Added

  • autogalaxy.util.plot_utils.plot_array(..., arcsec_after_decimal=None) — forwards the per-call arcsecond tick-label override to autoarray.plot.plot_array. Also reaches lens users unchanged via the autolens.plot re-export.

Removed

  • Nothing.

Migration

  • None required — every existing call site keeps its current behaviour.
  • Before (per-figure override): mutate conf.instance[...]["ticks"]["symbol_over_decimal"], then restore it
  • After: aplt.plot_array(array=array, arcsec_after_decimal=True)

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_019mofs7R3chP12wzoCPjnaw


Generated by Claude Code

`autogalaxy.util.plot_utils.plot_array` has an explicit keyword
signature and no `**kwargs`, so it has to name the new autoarray
parameter to pass it on. Adding it here is what makes the option
reachable as `aplt.plot_array(..., arcsec_after_decimal=True)` from
both `autogalaxy.plot` and `autolens.plot`, which re-export this exact
function.

Requires the matching PyAutoArray change (PyAutoArray#546).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019mofs7R3chP12wzoCPjnaw
@Jammy2211
Jammy2211 merged commit f395d05 into main Sep 10, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/arcsec-after-decimal branch September 10, 2026 00:08
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Sep 10, 2026 — with Claude
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 26, 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