Metadata-Version: 2.4
Name: diffstar
Version: 1.0.0
Summary: Differentiable Star Formation Histories
Author-email: Alex Alarcon <alexalarcongonzalez@gmail.com>
License: BSD 3-Clause License
        
        Copyright (c) 2019, Andrew Hearin
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: home, https://github.com/ArgonneCPAC/diffstar
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.rst
Requires-Dist: diffmah>=0.7.1
Requires-Dist: numpy
Requires-Dist: jax
Requires-Dist: h5py
Dynamic: license-file

# diffstar

Code documentation can be found at [diffstar.readthedocs.io](https://diffstar.readthedocs.io/en/latest/).

## Installation
The latest release of diffstar is available for installation with either pip or conda-forge:
```
$ conda install -c conda-forge diffstar
```

Alternatively, to install diffstar into your environment from the source code:

```
$ cd /path/to/root/diffstar
$ pip install .
```

### Environment configuration
For a typical development environment with conda-forge:

```
$ conda create -c conda-forge -n diffit python=3.9 numpy numba flake8 pytest jax ipython jupyter matplotlib scipy h5py diffmah diffstar
```

## Project data
Data for this project can be found [at this URL](https://portal.nersc.gov/project/hacc/aphearin/diffstar_data/).

## Scripts and demo notebooks
The `diffstar_fitter_demo.ipynb` notebook demonstrates how to fit the SFH of a simulated galaxy with a diffstar approximation.

See `history_fitting_script.py` for an example of how to fit the SFHs of a large number of simulated galaxies in parallel with mpi4py.

## Citing diffstar
[The Diffstar paper](https://arxiv.org/abs/2205.04273) has been published in [Monthly Notices of the Royal Astronomical Society](https://academic.oup.com/mnras/article-abstract/518/1/562/6795944?redirectedFrom=fulltext). Citation information for the paper can be found at [this ADS link](https://ui.adsabs.harvard.edu/abs/2023MNRAS.518..562A/abstract), copied below for convenience:

```
@ARTICLE{2023MNRAS.518..562A,
       author = {{Alarcon}, Alex and {Hearin}, Andrew P. and {Becker}, Matthew R. and {Chaves-Montero}, Jon{\'a}s},
        title = "{Diffstar: a fully parametric physical model for galaxy assembly history}",
      journal = {MNRAS},
     keywords = {galaxies: evolution, galaxies: fundamental parameters, galaxies: star formation, Astrophysics - Astrophysics of Galaxies, Astrophysics - Cosmology and Nongalactic Astrophysics},
         year = 2023,
        month = jan,
       volume = {518},
       number = {1},
        pages = {562-584},
          doi = {10.1093/mnras/stac3118},
archivePrefix = {arXiv},
       eprint = {2205.04273},
 primaryClass = {astro-ph.GA},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2023MNRAS.518..562A},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
```
