Skip to content

fix: area magnification sub-pixel area follows the generated sub-pixels - #687

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/area-magnification-subpixel-area
Oct 30, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/area-magnification-subpixel-area

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

LensCalc._sub_pixel_magnifications_from (PyAutoGalaxy#685, arc phase 6a) set the sub-pixel area from the requested sub_size, but Grid2D.from_mask(..., over_sample_size=sub_size) is capped to 2 under PYAUTO_SMALL_DATASETS=1 (PyAutoArray over_sample_util.py). source_plane_area_from then came out (2/sub_size)^2 too small (0.27 of the disk area at sub_size 4 in autolens_workspace_test smoke, arc 6b). area_magnification_from was 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

  • New test__source_plane_area__correct_when_over_sampling_is_capped (sets PYAUTO_SMALL_DATASETS=1): fails without the fix (0.588 vs 2.352, exactly 1/4), passes with it
  • PyAutoGalaxy full suite: 1467 passed
  • autolens_workspace_test scripts/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

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>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Oct 30, 2026
@Jammy2211
Jammy2211 merged commit cbe2b4d into main Oct 30, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/area-magnification-subpixel-area branch October 30, 2026 13:25
@pyautolabs-bot pyautolabs-bot Bot removed the pending-release PR queued for the next release build label Nov 1, 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