PyAutoGalaxy is a Bayesian galaxy morphology fitting library. It depends on autoarray (data structures) and autofit (model-fitting framework).
pip install -e ".[dev]"python -m pytest test_autogalaxy/
python -m pytest test_autogalaxy/galaxy/test_galaxy.py
python -m pytest test_autogalaxy/galaxy/test_galaxy.py::TestGalaxy::test_nameNUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib python -m pytest test_autogalaxy/- Profiles:
LightProfile(lp.*),MassProfile(mp.*),LightProfileLinear(lp_linear.*) - Galaxy (
galaxy/galaxy.py): holds light/mass profiles, pixelizations - Fit classes:
FitImaging,FitInterferometer,FitQuantity,FitEllipse - Analysis classes:
AnalysisImaging,AnalysisInterferometer— implementlog_likelihood_function - Decorator system (from autoarray):
@to_array,@to_grid,@to_vector_yx,@transform - Operate mixins:
OperateImage,OperateDeflections,LensCalc
- The
xpparameter controls NumPy vs JAX:xp=np(default) orxp=jnp - Functions inside
jax.jitmust guard autoarray wrapping withif xp is np: - Decorated functions return raw arrays — the decorator wraps them
- Use
grid.array[:, 0]to access grid coordinates (notgrid[:, 0]) - All files must use Unix line endings (LF)
- Format with
black autogalaxy/
- Read the issue description and any linked plan.
- Identify affected files and write your changes.
- Run the full test suite:
python -m pytest test_autogalaxy/ - Ensure all tests pass before opening a PR.
- If changing public API, note the change in your PR description — downstream packages (PyAutoLens) and workspaces may need updates.