Skip to content

fix(lens_calc): preserve evaluation_grid extent under PYAUTO_SMALL_DATASETS=1 - #431

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

Jammy2211 merged 1 commit into
mainfrom
feature/grid-respect-small-datasets

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Threads respect_small_datasets=False into the internal Grid2D.uniform call inside the evaluation_grid decorator (autogalaxy/operate/lens_calc.py:86). Restores correct behaviour of all LensCalc critical-curve / caustic / area methods under PYAUTO_SMALL_DATASETS=1 smoke mode.

Without this fix, tangential_critical_curve_list_from (and siblings) silently return [] in smoke mode for any lens whose critical curve falls outside a ~8" extent — including all cluster-scale lenses, plus any galaxy-scale model whose user grid is centred away from the origin. The decorator's job is to preserve user-requested spatial extent at finer resolution; the autoarray shrink defeated that universally.

Depends on the companion PyAutoArray PR (adds the respect_small_datasets kwarg this PR uses). Merge the PyAutoArray PR first; CI here will fail until that lands.

API Changes

None — internal change only. Public LensCalc.tangential_critical_curve_list_from, radial_critical_curve_list_from, caustic and area variants now correctly return curves under PYAUTO_SMALL_DATASETS=1 (previously returned []).
See full details below.

Test Plan

  • pytest test_autogalaxy/operate/test_deflections.py — all tests pass, including new test__tangential_critical_curve_list_from__small_datasets_env__evaluation_grid_keeps_extent.
  • Manual end-to-end: scripts/cluster/visualization.py in autolens_workspace_test under PYAUTO_SMALL_DATASETS=1 recovers tangential_curves recovered: 1 OK.
Full API Changes (for automation & release notes)

Changed Behaviour

  • LensCalc.tangential_critical_curve_list_from, radial_critical_curve_list_from, tangential_caustic_list_from, radial_caustic_list_from, tangential_critical_curve_area_list_from, radial_critical_curve_area_list_from — under PYAUTO_SMALL_DATASETS=1, the evaluation grid is no longer silently shrunk to 15x15 @ 0.6". Methods now correctly return curves when the user's requested grid extent demands them. Behaviour outside smoke mode is unchanged.

Internal

  • evaluation_grid decorator in autogalaxy/operate/lens_calc.py now passes respect_small_datasets=False to its internal Grid2D.uniform call.

🤖 Generated with Claude Code

…TASETS=1

The @evaluation_grid decorator builds its own internal Grid2D.uniform for
contour scanning. Under PYAUTO_SMALL_DATASETS=1 the autoarray helper used
to silently shrink any grid >15x15 to (15, 15) @ 0.6", which placed the
evaluation grid well inside cluster-scale critical curves and caused
tangential_critical_curve_list_from / radial_critical_curve_list_from /
caustic / area methods to return [] in smoke mode. Pass the new
respect_small_datasets=False kwarg to the internal call so the evaluation
grid honours the requested resolution.

Depends on PyAutoArray feature/grid-respect-small-datasets.
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 20, 2026
@Jammy2211
Jammy2211 merged commit cb370a4 into main May 20, 2026
6 of 8 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