PyAutoFit is a Python probabilistic programming language for model fitting and Bayesian inference.
- Authors: James Nightingale, Richard Hayes
- Requires Python >= 3.9
- Package name:
autofit
PyAutoFit depends on autoconf (shared configuration and utilities).
PyAutoFit does NOT depend on PyAutoArray, PyAutoGalaxy, or PyAutoLens.
Never import from autoarray, autogalaxy, or autolens in this repo.
Shared utilities (e.g. test_mode, jax_wrapper) belong in autoconf.
autofit/- Main packagenon_linear/- Non-linear search algorithmssearch/mcmc/- MCMC (emcee, zeus)search/mle/- Maximum likelihood (LBFGS, BFGS, drawer)search/nest/- Nested sampling (dynesty, nautilus)samples/- Posterior samples handlingpaths/- Output path managementanalysis/- Analysis base classes
mapper/- Model and prior machineryprior/- Prior distributionsprior_model/- Prior model compositionmodel.py- Core model class
graphical/- Graphical models and expectation propagationaggregator/- Results aggregation across runsdatabase/- SQLAlchemy-based results databaseinterpolator/- Model interpolationconfig/- Default config files packaged with library
test_autofit/- Test suite (pytest)docs/- Sphinx documentation
dynesty==2.1.5- Nested samplingemcee>=3.1.6- MCMCscipy<=1.14.0- OptimisationSQLAlchemy==2.0.32- Database backendanesthetic==2.8.14- Posterior analysis/plotting- Optional:
nautilus-sampler,zeus-mcmc,getdist
pytest test_autofit
pytest test_autofit/non_linear
pytest test_autofit/mapper
When running Python from Codex or any restricted environment, set writable cache directories so numba and matplotlib do not fail on unwritable home or source-tree paths:
NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib pytest test_autofitThis workspace is often imported from /mnt/c/... and Codex may not be able to write to module __pycache__ directories or /home/jammy/.cache, which can cause import-time numba caching failures without this override.
- Prefer simple shell commands
- Avoid chaining with
&&or pipes; run commands separately
- autofit_workspace (tutorials/examples):
../autofit_workspace