refactor: delegate norm_from to the shared autoarray helper - #587
Merged
Conversation
…ray#488) `norm_from` was added by #586 as a faithful copy of the colour-norm block in autoarray's plot_array. PyAutoArray#488 makes that block one shared helper (autoarray.plot.utils.norm_from), so this becomes a thin delegate rather than a third copy: autogalaxy may import autoarray, and the name stays autogalaxy's so the Clicker/Scribbler callers added in #586 keep working unchanged. Behaviour is unchanged here — the autoarray helper's log10-floor path is the one this function already implemented. test_autogalaxy/gui/test_plot_norm.py, which pins that behaviour, is green untouched (9 passed); full suite 1119 passed, 1 skipped against the PyAutoArray#488 branch. Library-first: PyAutoArray#488 merges before this. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DamasCoRrENvgiRkU5WHHW
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
Companion to PyAutoLabs/PyAutoArray#489 (issue PyAutoLabs/PyAutoArray#488).
norm_fromwas added by #586 as a faithful copy of the colour-norm block in autoarray'splot_array— the third copy of logic that had already diverged across the three sites. PyAutoArray#489 makes that block one shared helper, so this becomes a thin delegate rather than a third copy.autogalaxy may import autoarray (the dependency direction is fine; the reverse is not), and the name stays autogalaxy's so the
Clicker/Scribblercallers added in #586 keep working unchanged.Library-first: PyAutoArray#489 must merge before this. This PR's tests pass against
maintoo — the helper it delegates to is behaviour-identical to what this function already implemented — but the import target only exists once #489 lands.API Changes
None.
autogalaxy.util.plot_utils.norm_from(array, use_log10=False, vmin=None, vmax=None)keeps its name, signature and return contract; only its body changes, from a copy of the logic to a call intoautoarray.plot.utils.norm_from.Behaviour here is unchanged: the log10-floor path this function already implemented is the one the autoarray helper implements. The two deliberate behaviour changes in #489 both land on
plot_inversion_reconstruction, which this repo does not call.Test Plan
test_autogalaxy/gui/test_plot_norm.py— 9 passed, file untouched. This is the test fix: make the GUI helpers' colour scale constructible through the public API #586 added to pin the behaviour, so its staying green unmodified is the evidence that the delegation is faithful.test_autogalaxyfull suite against the PyAutoArray#489 branch — 1119 passed, 1 skippedClicker/Scribblercall sites unchanged and covered by the suiteRan on Python 3.12 only — the authoring session had no 3.13 environment. CI covers 3.13.
Full API Changes (for automation & release notes)
Removed
Added
Migration
autogalaxy.util.plot_utils.norm_from; the docstring now points atautoarray.plot.utils.norm_fromfor the behaviour and for which of the three divergences was resolved which way.Generated by the PyAutoLabs agent workflow.
Generated by Claude Code