diff --git a/autoarray/operators/over_sampling/over_sample_util.py b/autoarray/operators/over_sampling/over_sample_util.py index 199cfec8b..57cef6b6a 100644 --- a/autoarray/operators/over_sampling/over_sample_util.py +++ b/autoarray/operators/over_sampling/over_sample_util.py @@ -232,6 +232,9 @@ def over_sample_size_via_radial_bins_from( """ Returns an adaptive sub-grid size based on the radial distance of every pixel from the centre of the mask. + When ``PYAUTO_WORKSPACE_SMALL_DATASETS=1`` returns a uniform size-2 array + immediately, skipping the expensive radial-bin computation and numba JIT. + The adaptive sub-grid size is computed as follows: 1) Compute the radial distance of every pixel in the mask from the centre of the mask (or input centres). @@ -264,6 +267,11 @@ def over_sample_size_via_radial_bins_from( the centre of the mask. """ + import os + + if os.environ.get("PYAUTO_WORKSPACE_SMALL_DATASETS") == "1": + return Array2D(values=np.full(grid.shape_slim, 2.0), mask=grid.mask) + if centre_list is None: centre_list = [grid.mask.mask_centre]