Repository navigation
refactor: migrate live developer scripts to flat fields #142
Copy link
Copy link
Closed
Description
Overview
Migrate the live autolens developer workspace scripts to the released flat fields= API. The user approved the live-code scope on 2026-09-19. Preserve committed science snapshots and frozen or separately owned debug scripts.
Plan
- Inventory live galaxy-attached shear AST sites and their model/tracer/result consumers.
- Migrate direct model builders and simulators to top-level
MassField. - Migrate the three staged SLaM pipelines with an explicit
fieldsroute through every stage, using the new chaining helper where mass priors are carried. - Re-measure both pinned likelihoods; record before and after and update pins only from measured values.
- Verify zero legacy AST sites in the live scope and run representative scripts in each tree.
Detailed implementation plan
Affected Repositories
- autolens_workspace_developer
Branch Survey
| Repository | Current branch | Dirty? | Claims |
|---|---|---|---|
| autolens_workspace_developer | main | clean | none |
Suggested branch: feature/mass-field-developer
Implementation Steps
- Enumerate AST
Galaxy(..., shear=...)andaf.Model(Galaxy, shear=...)sites outsidesource_science/results/**,legacy/quantity/**, andeuclid_bug/{likelihood_comparison,run_initial_lens_model_pix_cpu}.py. - Move shear to
al.MassFieldat the lens redshift in livejax_profiling/**,searches_minimal/**,plotting_alignment/**,los/**, and source-science helpers; update tracer/model containers and posterior references. - Update
slam_pipeline/{dspl,light_dark_mge,mgl_slam_batch}.pystage-by-stage, preserving fields at each stage through explicit prior/fixed field choices. Useal.util.chaining.mass_and_fields_fromfor mass chaining. This part is release-gated by PyAutoGalaxy#625 / PyAutoLens#745. - Run the two pinned likelihood scripts after migration; record measured values and any pin changes. Preserve
source_science/results/{1..4}_*/byte-for-byte. - Compile all changed files; run AST audit, representative end-to-end scripts per live tree, and available tests. Document unavailable dataset or hardware gates.
Key Files
jax_profiling/jit/imaging/mge.py,jax_profiling/jit/point_source/source_plane.py— pinned likelihoodsslam_pipeline/{dspl,light_dark_mge,mgl_slam_batch}.py— staged chainssearches_minimal/_setup.py,source_science/{fit_helpers,sim_helpers}.py— shared builders- live scripts under
jax_profiling/,plotting_alignment/,los/
Original Prompt
Click to expand starting prompt
We have been doing work which updates workspaces and lots more to a fields API, can we review where the updating te API for everything got too (E.g. I dont think we have done HowToLens) and continue all of that until its done?
yes do all that, note that autolens_jax_joss is deleted more recently. But lets go
Metadata
Metadata
Assignees
Labels
No labels
Activity
Jammy2211 commentedon Sep 19, 2026
Scope finding: source_science/run_all_tests.py imports the shared fit_helpers.py and sim_helpers.py and reuses cached fit identifiers for committed measurement rows. This migration will preserve source_science/** as one measurement tree, including those helpers, to keep archived results reproducible. The live AST witness will exclude that tree alongside legacy/quantity/** and the two Euclid-owned debug scripts.
Jammy2211 commentedon Sep 19, 2026
Pin remeasurement: migrated jax_profiling/jit/imaging/mge.py (HST) produced 27373.152646517723, which passes its existing 27373.152646517716 pin. The second named pin, jax_profiling/jit/point_source/source_plane.py, has no galaxy-attached shear and is untouched by this migration. Running it as requested produced -3598.9674932334997 versus the existing -294.1401881258811 pin, so it failed before any source edit to that file. I am preserving the pin and treating that drift as a separate profiling issue rather than re-pinning it from an unrelated run.
Jammy2211 commentedon Sep 19, 2026
Compatibility finding: slam_pipeline/dspl.py and light_dark_mge.py import the local slam_pipeline namespace, which contains only these scripts and no source_lp/source_pix modules. Their shear= calls target that absent legacy pipeline API. I am preserving those two non-runnable examples and migrating the standalone mgl_slam_batch.py stage builder; converting the absent pipeline call signature would be speculative and untestable.
Jammy2211 commentedon Sep 19, 2026
Source gate cleared
PyAutoGalaxy#625 and PyAutoLens#745 are merged on current source
main; this developer workspace does not require a packaged release. PR #143 is ready for review. Current-source validation confirmed the helper and all five MGL field handoffs, andpytest los/test_los.py -qpassed all 32 tests.Jammy2211 commentedon Sep 19, 2026
Shipped — 2026-09-19
PRs
Upstream PRs
Summary
Migrated the live developer JAX, search, plotting, LOS, and standalone MGL builders to top-level
MassFieldvalues throughfields=. Historical measurement archives, frozen legacy examples, Euclid-owned debug scripts, and two scripts tied to an unavailable legacy SLaM namespace remain intentionally unchanged. The migrated code was validated against current PyAutoGalaxy/PyAutoLens source with the AST contract, 32 LOS tests, re-measured likelihood witnesses, and representative end-to-end scripts.Session Notes
The repository has no configured GitHub checks, so PR #143 was merged through the human-invoked
/prmafter local validation. The current-source helper API was sufficient; no packaged release was required.