From b1a8e5c886de6bf1d82a9bdc0a680a4dac07fc63 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Tue, 7 Apr 2026 13:42:33 +0100 Subject: [PATCH] perf: force over_sample_size=2 when PYAUTO_WORKSPACE_SMALL_DATASETS=1 On small test grids (15x15), adaptive oversampling with 32x32 sub-grids wastes computation. Force over_sample_size=2 in Grid2D.__init__ when the env var is set. Uses 2 instead of 1 to avoid Sersic singularities at pixel centres. Co-Authored-By: Claude Opus 4.6 (1M context) --- autoarray/structures/grids/uniform_2d.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoarray/structures/grids/uniform_2d.py b/autoarray/structures/grids/uniform_2d.py index 80bccfe7..d755951d 100644 --- a/autoarray/structures/grids/uniform_2d.py +++ b/autoarray/structures/grids/uniform_2d.py @@ -171,6 +171,9 @@ def __init__( grid_2d_util.check_grid_2d(grid_2d=values) + if os.environ.get("PYAUTO_WORKSPACE_SMALL_DATASETS") == "1": + over_sample_size = 2 + self._over_sample_size = over_sample_size self._over_sampler = over_sampler