Skip to content

feat: analyses default to setup="auto"; explicit use_jax opts out (R6) - #760

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

Closes #759 together with the PyAutoArray, PyAutoFit, PyAutoLens and autolens_workspace_test PRs on branch feature/likelihood-lifecycle-r6-default-auto. Merge order: Array → Fit → Galaxy → Lens → autolens_workspace_test.

  • setup="auto" is the default for ag.AnalysisImaging / ag.AnalysisInterferometer (via AnalysisDataset). Precedence (setup_util.setup_and_use_jax_from): setup passed → used as given (setup=None is the manual opt-out); else use_jax passed explicitly → manual opt-out (today's behaviour plus the "would choose" banner); else setup="auto". use_jax now defaults to None.
  • The default is a pickle-safe sentinel (SETUP_DEFAULT, a str equal to "auto" told apart by identity), so an explicit setup="auto" and the default behave the same but the guard can tell them apart.
  • If the defaulted "auto" cannot choose a setup, the fit logs a warning and runs with the constructor backend instead of failing (an explicit setup="auto" still raises).
  • Operator attach: already one call, dataset.apply_setup(setup) (the build lives in PyAutoArray), so no further slimming was needed.

API Changes

AnalysisImaging / AnalysisInterferometer: use_jax: Optional[bool] = None, setup defaults to "auto"; explicit use_jax with no setup opts out of auto. New setup_util.SETUP_DEFAULT, setup_util.setup_and_use_jax_from.
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)
  • New tests: default resolves setup="auto" with the "Automatic compute setup" banner; explicit use_jax=False / setup=None opt out; pickling keeps the default; lazy default on numpy pixelized fits
  • 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)

Added

  • autogalaxy.analysis.setup_util.SETUP_DEFAULT, setup_and_use_jax_from(setup, use_jax, default_use_jax).

Changed

  • ag.AnalysisImaging(dataset, use_jax=None, setup="auto", ...), ag.AnalysisInterferometer(...) likewise.
  • AnalysisSetupMixin._init_setup(setup, setup_defaulted=False); resolve_setup falls back to the constructor backend with a warning when the defaulted auto cannot choose.

Migration

  • Keep manual control: ag.AnalysisImaging(dataset=dataset, use_jax=True) (or setup=None).

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

Part of #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.

feat: R6 default flip to setup="auto" and number_of_cores="auto" (likelihood lifecycle)

1 participant