You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Port multi_galaxy_mge.py from autolens_workspace_test/scripts/model_composition/ to autogalaxy_workspace_test/scripts/model_composition/, stripping it to autogalaxy semantics
(multiple galaxies sharing one plane with MGE light bases — no lens mass, no external shear,
no ray-tracing). This is task 2/9 of the autogalaxy_workspace_test parity epic
(#5).
Plan
Port multi_galaxy_mge.py from autolens_workspace_test, stripping to autogalaxy semantics (multiple galaxies with MGE light bases, no mass / shear / ray-tracing).
Two galaxies sharing one plane — galaxy_0 with gaussian_per_basis=2 (6 priors), galaxy_1 with gaussian_per_basis=1 (4 priors). Full model: 10 priors total.
Keep the structural assertions (within-basis prior identity, cross-basis ell_comps independence, gaussian_per_basis variants, spherical, centre_per_basis, centre_fixed) — they exercise ag.model_util.mge_model_from directly and are profile-only.
Drop autolens-specific keywords (Isothermal, ExternalShear) from the model.info keyword check.
Generate a fresh identifier-stability regression anchor specific to the autogalaxy model.
Wire into smoke_tests.txt so CI exercises it on every push.
Unrelated to this task. The worktree gets a clean checkout, so dirty main does not block.
Suggested branch:feature/autogalaxy-wst-model-composition Worktree root:~/Code/PyAutoLabs-wt/autogalaxy-wst-model-composition/ (created later by /start_workspace)
Append model_composition/multi_galaxy_mge.py to autogalaxy_workspace_test/smoke_tests.txt (placed between aggregator/ellipse.py and jax_likelihood_functions/imaging/lp.py so it runs before the JAX block).
Local verify: PYAUTO_TEST_MODE=2 PYAUTO_WORKSPACE_SMALL_DATASETS=1 python scripts/model_composition/multi_galaxy_mge.py.
Key Files
autogalaxy_workspace_test/scripts/model_composition/__init__.py — new (empty, namespace marker).
autogalaxy_workspace_test/scripts/model_composition/multi_galaxy_mge.py — new port from autolens.
Identifier hash unknown until first run. The autolens identifier 5a3c480de681f6958048b22b3db8ecf9 will not match — the model is structurally different (no mass, no shear, two light-only galaxies sharing a redshift). Emit on first run and lock it in.
The dirty dataset/*/jax_test/galaxies.json files on main are unrelated and not part of this task. The worktree starts from origin/main so they don't follow.
That script exercises PyAutoFit's model-composition machinery on an autolens lens-plus-source
model with MGE bases. Strip it to an autogalaxy equivalent — multiple al.Galaxy objects in a
single plane (no lens/source split, no ray-tracing), each composed from an MGE light basis.
autogalaxy_workspace_test/scripts/model_composition/multi_galaxy_mge.py — ported script. Use ag.Galaxy, ag.Galaxies, ag.ImagingAnalysis (not al. / Tracer). Pick a small dataset
from an existing autogalaxy workspace example and model two galaxies each with an MGE.
Append model_composition/multi_galaxy_mge.py to smoke_tests.txt.
Verify locally with PYAUTOFIT_TEST_MODE=2 PYAUTO_WORKSPACE_SMALL_DATASETS=1 python scripts/model_composition/multi_galaxy_mge.py.
Depends on
Task 1 (CI) must have merged so the new script runs in GitHub Actions. Review failure is cheaper
on CI than locally once CI is wired up.
Umbrella issue
Task 2/9. Track under the epic issue on PyAutoLabs/autogalaxy_workspace_test.
Overview
Port
multi_galaxy_mge.pyfromautolens_workspace_test/scripts/model_composition/toautogalaxy_workspace_test/scripts/model_composition/, stripping it to autogalaxy semantics(multiple galaxies sharing one plane with MGE light bases — no lens mass, no external shear,
no ray-tracing). This is task 2/9 of the autogalaxy_workspace_test parity epic
(#5).
Plan
multi_galaxy_mge.pyfrom autolens_workspace_test, stripping to autogalaxy semantics (multiple galaxies with MGE light bases, no mass / shear / ray-tracing).galaxy_0withgaussian_per_basis=2(6 priors),galaxy_1withgaussian_per_basis=1(4 priors). Full model: 10 priors total.ag.model_util.mge_model_fromdirectly and are profile-only.Isothermal,ExternalShear) from themodel.infokeyword check.smoke_tests.txtso CI exercises it on every push.Detailed implementation plan
Affected Repositories
Work Classification
Workspace
Branch Survey
dataset/*/jax_test/galaxies.json+ untrackedtest_report.md)Suggested branch:
feature/autogalaxy-wst-model-compositionWorktree root:
~/Code/PyAutoLabs-wt/autogalaxy-wst-model-composition/(created later by/start_workspace)Implementation Steps
autogalaxy_workspace_test/scripts/model_composition/__init__.py(empty, mirrors autolens version).autogalaxy_workspace_test/scripts/model_composition/multi_galaxy_mge.py:import autofit as af+import autogalaxy as ag(dropal).bulge_0 = ag.model_util.mge_model_from(..., gaussian_per_basis=2, centre_prior_is_uniform=True)→ assertprior_count == 6.galaxy_0 = af.Model(ag.Galaxy, redshift=0.5, bulge=bulge_0)→ assertprior_count == 6.bulge_1 = ag.model_util.mge_model_from(..., centre_prior_is_uniform=False)→ assertprior_count == 4.galaxy_1 = af.Model(ag.Galaxy, redshift=0.5, bulge=bulge_1)→ assertprior_count == 4.model = af.Collection(galaxies=af.Collection(galaxy_0=galaxy_0, galaxy_1=galaxy_1))→ assertprior_count == 10, 10 unique paths, top-levelgalaxies, second-levelgalaxy_0/galaxy_1.bulge_0.model.infokeywords to["Galaxy", "Basis"](dropIsothermal,ExternalShear).ag.model_util.mge_model_fromonly.model_composition/multi_galaxy_mge.pytoautogalaxy_workspace_test/smoke_tests.txt(placed betweenaggregator/ellipse.pyandjax_likelihood_functions/imaging/lp.pyso it runs before the JAX block).PYAUTO_TEST_MODE=2 PYAUTO_WORKSPACE_SMALL_DATASETS=1 python scripts/model_composition/multi_galaxy_mge.py.Key Files
autogalaxy_workspace_test/scripts/model_composition/__init__.py— new (empty, namespace marker).autogalaxy_workspace_test/scripts/model_composition/multi_galaxy_mge.py— new port from autolens.autogalaxy_workspace_test/smoke_tests.txt— one-line addition.Risks & Notes
5a3c480de681f6958048b22b3db8ecf9will not match — the model is structurally different (no mass, no shear, two light-only galaxies sharing a redshift). Emit on first run and lock it in.dataset/*/jax_test/galaxies.jsonfiles onmainare unrelated and not part of this task. The worktree starts fromorigin/mainso they don't follow.PYAUTOFIT_TEST_MODE→PYAUTO_TEST_MODE. The verify command in the original prompt should be updated accordingly.Original Prompt
Click to expand starting prompt
Create
scripts/model_composition/in @autogalaxy_workspace_test with an autogalaxy version ofthe autolens
multi_galaxy_mge.pyscript.Reference
@autolens_workspace_test/scripts/model_composition/multi_galaxy_mge.py
That script exercises PyAutoFit's model-composition machinery on an autolens lens-plus-source
model with MGE bases. Strip it to an autogalaxy equivalent — multiple
al.Galaxyobjects in asingle plane (no lens/source split, no ray-tracing), each composed from an MGE light basis.
Deliverables
autogalaxy_workspace_test/scripts/model_composition/__init__.pyautogalaxy_workspace_test/scripts/model_composition/multi_galaxy_mge.py— ported script. Useag.Galaxy,ag.Galaxies,ag.ImagingAnalysis(notal./ Tracer). Pick a small datasetfrom an existing autogalaxy workspace example and model two galaxies each with an MGE.
model_composition/multi_galaxy_mge.pytosmoke_tests.txt.PYAUTOFIT_TEST_MODE=2 PYAUTO_WORKSPACE_SMALL_DATASETS=1 python scripts/model_composition/multi_galaxy_mge.py.Depends on
Task 1 (CI) must have merged so the new script runs in GitHub Actions. Review failure is cheaper
on CI than locally once CI is wired up.
Umbrella issue
Task 2/9. Track under the epic issue on
PyAutoLabs/autogalaxy_workspace_test.