Skip to content

feat: lazy_sparse_operator defaults to auto (R6); fix numba multi-mapper sparse data vector - #715

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/likelihood-lifecycle-r6-default-auto
Nov 26, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/likelihood-lifecycle-r6-default-auto

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Part of PyAutoLabs/PyAutoGalaxy#759 (likelihood-lifecycle ruling R6: flip the defaults after the 2026.11.25.1 opt-in release). Same branch feature/likelihood-lifecycle-r6-default-auto in PyAutoArray, PyAutoFit, PyAutoGalaxy, PyAutoLens and autolens_workspace_test. Merge order: Array → Fit → Galaxy → Lens → autolens_workspace_test.

  • lazy_sparse_operator defaults to "auto" (general.yaml, aa.Settings): a NumPy pixelized fit of a dataset with no attached operator (direct FitImaging/FitInterferometer, aggregator reloads) builds the numba sparse operator (imaging) or the NUFFT w-tilde operator (interferometer) once, caches it and reuses it. Never under JAX or inside a multiprocessing worker. lazy_sparse_operator="off" restores the dense route.
  • Bug fix (exposed by the lazy default): the numba imaging sparse data_vector for several mappers (e.g. two pixelized sources) built its triplets from the wrong mapper fields; it now uses each mapper's unique_mappings (data_to_pix_unique, data_weights, pix_lengths). A PyAutoLens test (two pixelized sources, lazy vs dense) fails without this fix.

API Changes

Default of aa.Settings(lazy_sparse_operator=...) / config inversion.lazy_sparse_operator changes from "off" to "auto". No signatures change.
See full details below.

Test Plan

  • Full suites with JAX (serial): PyAutoArray 2614, PyAutoFit 4391, PyAutoGalaxy 1679, PyAutoLens 1177 passed
  • No-JAX leg reproduced exactly as CI (venv with the [optional] extras, jax family uninstalled): PyAutoArray 2149, PyAutoFit 4064, PyAutoGalaxy 1595, PyAutoLens 1112 passed, 0 failed
  • pyauto-heart smoke --affected-by PyAutoFit against the task worktree: 7/8 workspaces; the one failing script (autolens_workspace_test jax_assertions/fit_interferometer_sparse_operator.py) encodes the old lazy-off default and is fixed by the companion autolens_workspace_test PR (passes against this branch)
  • Heart dev-ship readiness: GREEN (after a fresh tick). Shown, non-blocking: canonical PyAutoFit/PyAutoGalaxy/PyAutoLens checkouts 2 commits behind origin (release Colab-URL bumps; the task branches are rebased on them); manifest drift (1 mismatch).
Full API Changes (for automation & release notes)

Changed

  • autoarray/config/general.yaml lazy_sparse_operator: "auto" (was "off"); aa.Settings.lazy_sparse_operator resolves None to "auto".
  • Imaging.sparse_operator_for / Interferometer.sparse_operator_for build lazily by default.

Fixed

  • Numba imaging sparse data vector for multiple mappers.

Migration

  • To keep the dense mapping-matrix route for a fit without an attached operator: settings=aa.Settings(lazy_sparse_operator="off") (or config lazy_sparse_operator: "off").

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

…per sparse data vector

Part of PyAutoLabs/PyAutoGalaxy#759.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant