Skip to content

feat(grids): add respect_small_datasets kwarg to Grid2D.uniform - #327

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/grid-respect-small-datasets
May 20, 2026
Merged

feat(grids): add respect_small_datasets kwarg to Grid2D.uniform#327
Jammy2211 merged 1 commit into
mainfrom
feature/grid-respect-small-datasets

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Adds respect_small_datasets: bool = True kwarg to Grid2D.uniform. When PYAUTO_SMALL_DATASETS=1 is active, the existing logic silently rewrites any shape larger than 15x15 to (15, 15) at pixel_scales=0.6. Passing respect_small_datasets=False opts out of that shrink for the call.

Motivation: a downstream PyAutoGalaxy fix (and an autolens_workspace_test cluster visualization assertion) needs to keep a 100"x100" grid extent in smoke mode to detect a cluster-scale tangential critical curve. The existing shrink defeats every such assertion without changing any of the physics the assertion is meant to detect.

Default behaviour is unchanged — only the explicit opt-out is new.

API Changes

Adds one optional kwarg respect_small_datasets: bool = True to aa.Grid2D.uniform. No removed or renamed symbols; existing callers continue to work without change.
See full details below.

Test Plan

  • pytest test_autoarray/structures/grids/test_uniform_2d.py — all tests pass including the new test__uniform__small_datasets_env__respect_flag_false__shape_unchanged.
  • Manual end-to-end: cluster visualization in autolens_workspace_test under PYAUTO_SMALL_DATASETS=1 recovers the expected critical curve (combined with downstream PyAutoGalaxy fix).
Full API Changes (for automation & release notes)

Added

  • Grid2D.uniform(..., respect_small_datasets: bool = True) — opt-out flag for the PYAUTO_SMALL_DATASETS=1 shape-shrink. Default preserves existing behaviour.

🤖 Generated with Claude Code

Lets callers opt out of the PYAUTO_SMALL_DATASETS=1 shape-shrink for grids
whose spatial extent is load-bearing (e.g. critical-curve visualizations on
cluster-scale lenses). Default `True` preserves existing behaviour.
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 20, 2026
@Jammy2211
Jammy2211 merged commit 7f530c6 into main May 20, 2026
6 checks passed
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Workspace PR: PyAutoLabs/autolens_workspace_test#109

@Jammy2211
Jammy2211 deleted the feature/grid-respect-small-datasets branch May 20, 2026 18:43
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 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