Metadata-Version: 2.5
Name: mosfit
Version: 2.0.0
Summary: Modular software for fitting semi-analytical model predictions to observed astronomical transient data.
Project-URL: Homepage, https://github.com/guillochon/mosfit
Project-URL: Documentation, https://mosfit.readthedocs.io/
Project-URL: Changelog, https://github.com/guillochon/MOSFiT/blob/master/CHANGELOG.md
Project-URL: Download, https://github.com/guillochon/mosfit/tarball/2.0.0
Project-URL: conda-forge, https://anaconda.org/conda-forge/mosfit
Author: Matt Nicholl
Author-email: James Guillochon <guillochon@gmail.com>
License: MIT
License-File: LICENSE
Keywords: astronomy,fitting,modeling,monte carlo
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.11
Requires-Dist: astrocats>=0.5.0
Requires-Dist: astropy>=7.1
Requires-Dist: dynesty>=3.1
Requires-Dist: emcee>=3.0.2
Requires-Dist: extinction>=0.2.2
Requires-Dist: h5py>=3.8.0
Requires-Dist: inflect>=1.0.0
Requires-Dist: matplotlib>=3.0.0
Requires-Dist: nbstripout>=0.2.9
Requires-Dist: numba>=0.67.0
Requires-Dist: numexpr>=2.6.1
Requires-Dist: numpy>=2.3
Requires-Dist: palettable>=2.1.1
Requires-Dist: pandas>=2.2
Requires-Dist: schwimmbad>=0.4.2
Requires-Dist: scipy>=1.2
Requires-Dist: seaborn>=0.7.1
Requires-Dist: six>=1.0.0
Provides-Extra: docs
Requires-Dist: numpydoc; extra == 'docs'
Requires-Dist: sphinx-automodapi; extra == 'docs'
Requires-Dist: sphinx-rtd-theme>=2.0; extra == 'docs'
Requires-Dist: sphinx<8,>=7.0; extra == 'docs'
Requires-Dist: sphinxcontrib-autoprogram; extra == 'docs'
Requires-Dist: tqdm; extra == 'docs'
Provides-Extra: mpi
Requires-Dist: mpi4py>=3.1.6; extra == 'mpi'
Provides-Extra: sedona
Requires-Dist: torch; extra == 'sedona'
Description-Content-Type: text/markdown

<p align="center"><img src="logo.png" align="left" alt="MOSFiT" width="300"/></p>
<a href="https://www.python.org"><img src="https://img.shields.io/badge/python-3.11+-blue.svg" alt="Python Version"></a>
<a href="https://badge.fury.io/py/mosfit"><img src="https://badge.fury.io/py/mosfit.svg" alt="PyPI version"></a>
<a href="https://mosfit.readthedocs.io/en/latest/?badge=latest"><img src="https://readthedocs.org/projects/mosfit/badge/?version=latest" alt="Documentation Status"></a>
<a href="https://ascl.net/1710.006"><img src="https://img.shields.io/badge/ascl-1710.006-blue.svg?colorB=262255" alt="ascl:1710.006" /></a>

`MOSFiT` (**M**odular **O**pen-**S**ource **Fi**tter for **T**ransients) is a Python 3.11+ package for fitting, sharing, and estimating the parameters of transients via user-contributed transient models. This is **MOSFiT 2.0**. Data for a transient can be provided by the user in a wide range of formats (JSON, ASCII tables, CDS, LaTeX).<br clear="all">

See [CHANGELOG.md](CHANGELOG.md) for unreleased work and versioned notes.

## Installation

Development installs use [uv](https://docs.astral.sh/uv/) and Python 3.11+:

```bash
git clone https://github.com/guillochon/MOSFiT.git
cd MOSFiT
uv sync
```

Then run MOSFiT with `uv run mosfit ...`, or activate `.venv`.

Published installs are also available via `conda` and `pip`. conda-forge will
ship 2.0 after a feedstock update (see `recipe/`); `astrocats >= 0.5.0` must
land on conda-forge first:

```bash
conda install -c conda-forge mosfit
```

or:

```bash
pip install mosfit
```

MPI support (`mpi4py`) is optional and needs a system MPI library:

```bash
uv sync --extra mpi
```

The SESN SEDONA emulator (`sesn_sedona`) needs PyTorch. Install that extra with:

```bash
uv sync --extra sedona
```

or, for a published install, `pip install 'mosfit[sedona]'`. Default models do not require it.


## Using MOSFiT

The default sampler is nested sampling with dynesty. Pass local catalog JSON (or ASCII) with `-e`. Use `--max-cores` for local process-pool parallelism (no MPI required):

```bash
mosfit -e ./my_transient.json -m slsn --max-cores 10
mosfit -e mosfit/tests/PS1-10jh.json -m tde --max-cores 10 -R
```

Switch to ensemble MCMC with `-D ensembler`, or UltraNest with `-D ultranest`. Fits write products under `products/` (including `walkers.h5`, and optionally `chain.h5` if run with `-c`). For detailed instructions, see the documentation on RTD: <https://mosfit.readthedocs.io/>
