This is an updated version of the Chempy software, including yield table scoring as described in Philcox, Rybizki & Gutke (2018, ApJ, arXiv), and multi-star Bayesian inference as described in Philcox & Rybizki (2019, submitted to ApJ, arXiv). This replaces the ChempyScoring package.
Chempy is a flexible one-zone open-box chemical evolution model, incorporating abundance fitting and stellar feedback calculations. We provide routines for parameter optimization for simulations and observational data and yield table scoring.
We provide the following tutorials on basic Chempy usage as well as yield table scoring and multi-parameter inference:
- Inferring Galactic Parameters using Chemical Abundances from Multiple Stars. This includes description of the new Chempy routines to compute the ISM abundances at any given simulation time, as well as a detailed guide to running Hamiltonian Monte Carlo inference using Chempy, neural networks and PyMC3 for mock or observational data. Analysis is based on the Philcox & Rybizki (2019, submitted to ApJ, arXiv) paper.
- Scoring Yield Tables and Choosing Parameters for Hydrodynamical Simulations using Proto-solar Abundances. This describes how to score yield tables based on the MCMC methods of Philcox, Rybizki & Gutke (2018, ApJ, arXiv), including discussion of the neural network implementation and adding new yield tables to Chempy.
- General Chempy Tutorials. These describe the basic functionality of Chempy including running the simulation, performing inference using MCMC and producing SSP enrichment tables for hydrodynamical simulations. This is based on the Rybizki et al. (2017, A&A, arXiv) paper.
pip install git+https://github.com/oliverphilcox/ChempyMulti.git
Chempy should run with the latest python 2 and python 3 versions. Its dependencies are: Numpy, SciPy, matplotlib, multiprocessing, corner (for MCMC plots) and tqdm (for timing multiprocessing). For yield table scoring we additionally require emcee (for the Ensemble MCMC inference), PyTorch (for Neural Networks) and scikit-monaco (for Monte Carlo integration). For multi-star inference we instead require scikit-learn (for Neural Networks) and PyMC3 (for HMC inference).
These are all pip installable and you can also get part of it with Anaconda.
You can install ChempyMulti into a folder where you have write access:
pip install --install-option='--prefix=~/extra_package/' git+https://github.com/oliverphilcox/ChempyMulti.git
Then you have to add the site-packages/
folder which will be one of the newly created subfolders in extra_package/
into the PYTHONPATH
variable, e.g.:
export PYTHONPATH=~/extra_package/lib/python3.6/site-packages/:$PYTHONPATH
If you want this to be permanent, you can add the last line to your .bashrc
.
- Jan Rybizki (MPIA, rybizki@mpia.de) - Original Chempy
- Oliver Philcox (Princeton, ohep2@alumni.cam.ac.uk) - Yield table scoring + Multi-Star Inference
- Hans-Walter Rix (MPIA)
- Andreas Just (ZAH)
- Morgan Fouesneau (MPIA)
- Nathan Sandford (UC Berkeley)
- Philcox & Rybizki (2019, submitted to ApJ, arXiv) - Multi-Star Inference
- Philcox, Rybizki & Gutcke (2018, ApJ, arXiv, Zenodo) - Yield Table Scoring
- Rybizki, Just & Rix (A&A, arXiv, ASCL) - The Chempy model
- An early version of Chempy is presented in chapter 4 of Jan's phd thesis.
To run tutorials interactively first clone the repository with
git clone https://github.com/oliverphilcox/ChempyScoring.git
Then you can jupyter notebook
from within the tutorial folder (it will run if you have installed ChempyMulti).
If you did not install ChempyScoring you can still run the tutorial but need to point to the files in the Chempy folder. Basically you have to cd ../ChempyScoring/
and then replace each from Chempy import ...
with from . import ...
.
You can also have a look at the preliminary Chempy documentation which gives an overview over the Chempy classes and functions, although this does not yet provide support for the Scoring, Neural Network or Multi-Star implementations.
Please cite the initial Chempy paper, the scoring table and neural network paper and the multi-star paper when using the code in your research.