Repository navigation
fix: area magnification sub-pixel area follows the generated sub-pixels - #687
Merged
Merged
Conversation
Grid2D.from_mask caps over-sampling (e.g. to 2 under PYAUTO_SMALL_DATASETS=1), so deriving the sub-pixel area from the requested sub_size made source_plane_area_from (2/sub_size)^2 too small. area_magnification_from was unaffected (the factor cancels). Closes #686 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 30, 2026
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
LensCalc._sub_pixel_magnifications_from(PyAutoGalaxy#685, arc phase 6a) set the sub-pixel area from the requestedsub_size, butGrid2D.from_mask(..., over_sample_size=sub_size)is capped to 2 underPYAUTO_SMALL_DATASETS=1(PyAutoArrayover_sample_util.py).source_plane_area_fromthen came out(2/sub_size)^2too small (0.27 of the disk area at sub_size 4 in autolens_workspace_test smoke, arc 6b).area_magnification_fromwas unaffected (the factor cancels). The area now follows the sub-pixels actually generated: pixel area × unmasked pixels / sub-pixels.Found by arc phase 6b (autolens_workspace_test#351), whose smoke leg needs this.
API Changes
None — internal changes only.
Test Plan
test__source_plane_area__correct_when_over_sampling_is_capped(setsPYAUTO_SMALL_DATASETS=1): fails without the fix (0.588 vs 2.352, exactly 1/4), passes with itscripts/imaging/area_magnification.py(6b) passes in smoke and full modes against this branch; the two agree to 0.1%Heart at ship: STALE (release validation stale: source moved since rehearsal) — human authorized shipping 6b "when tests pass" 2026-10-30.
Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code