Skip to content

Commit

Permalink
update CAMB and getdist, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbant committed Jun 8, 2021
1 parent 682e3ba commit 9d4dec4
Show file tree
Hide file tree
Showing 41 changed files with 17,265 additions and 15,593 deletions.
15 changes: 6 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
CosmoMC
===================
:CosmoMC: Fortran 2008 parallelized MCMC sampler (general and cosmology)
:Homepage: http://cosmologist.info/cosmomc/
:Homepage: https://cosmologist.info/cosmomc/

Description and installation
=============================

For full details see the `ReadMe <http://cosmologist.info/cosmomc/readme.html>`_.
The new Python `Cobaya <https://github.com/CobayaSampler/cobaya>`_ sampling package incorporates a
version of CosmoMC's sampler and most other CosmoMC features, but has more general speed optimization and
general support of multiple inter-dependent theory and likelihood codes. New users should probably use that.

For full CosmoMC install details see the `ReadMe <http://cosmologist.info/cosmomc/readme.html>`_.

Algorithm details
==================
Expand All @@ -20,13 +24,6 @@ GetDist
CosmoMC includes the GetDist python sample analysis and plotting package, which is
also `available separately <http://getdist.readthedocs.org/en/latest/>`_.

Related code
==================

The new Python `Cobaya <https://github.com/CobayaSampler/cobaya>`_ sampling package incorporates a
version of CosmoMC's sampler and most other CosmoMC features, but has more general speed optimization and
general support of multiple inter-dependent theory and likelihood codes.


Branches
=============================
Expand Down
12 changes: 9 additions & 3 deletions python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#Dockerfile for running getdist notebooks with binder

FROM cmbant/cosmobox:python3
FROM cmbant/cosmobox:gcc9


RUN pip install --no-cache --upgrade pip && \
pip install --no-cache notebook

ARG NB_USER
ARG NB_UID
ENV NB_USER jovyan
ENV NB_UID 1000
ENV USER ${NB_USER}
ENV HOME /home/${NB_USER}

RUN adduser --disabled-password \
Expand All @@ -17,6 +24,5 @@ RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}

WORKDIR ${HOME}
RUN pip install --no-cache-dir notebook==5.*
RUN python setup.py build


92 changes: 59 additions & 33 deletions python/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ GetDist
===================
:GetDist: MCMC sample analysis, plotting and GUI
:Author: Antony Lewis
:Homepage: https://github.com/cmbant/getdist
:Homepage: https://getdist.readthedocs.io
:Source: https://github.com/cmbant/getdist
:Reference: https://arxiv.org/abs/1910.13970

.. image:: https://secure.travis-ci.org/cmbant/getdist.png?branch=master
:target: https://secure.travis-ci.org/cmbant/getdist
.. image:: https://travis-ci.org/cmbant/getdist.svg?branch=master
:target: https://travis-ci.org/cmbant/getdist
.. image:: https://img.shields.io/pypi/v/GetDist.svg?style=flat
:target: https://pypi.python.org/pypi/GetDist/
:target: https://pypi.python.org/pypi/GetDist/
.. image:: https://readthedocs.org/projects/getdist/badge/?version=latest
:target: https://getdist.readthedocs.org/en/latest
.. image:: https://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/cmbant/getdist/master?filepath=docs%2Fplot_gallery.ipynb
.. image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/cmbant/getdist/master?filepath=docs%2Fplot_gallery.ipynb
.. image:: https://img.shields.io/badge/arXiv-1910.13970-b31b1b.svg?color=0B6523
:target: https://arxiv.org/abs/1910.13970

Description
============
Expand Down Expand Up @@ -43,9 +47,13 @@ or from source files using::

$ python setup.py install

or::

$ pip install -e /path/to/source/

You can test if things are working using the unit test by running::

$ python setup.py test
$ python -m unittest getdist.tests.getdist_test

Check the dependencies listed in the next section are installed. You can then use the getdist module from your scripts, or
use the GetDist GUI (*getdist-gui* command).
Expand All @@ -55,22 +63,22 @@ the `Plot Gallery and tutorial <http://getdist.readthedocs.org/en/latest/plot_ga

Dependencies
=============
* Python 2.7+ or 3.6+
* matplotlib
* Python 3.6+
* matplotlib 2.2+ (3.1+ recommended)
* scipy
* PySide (Python 2) or PySide2 (Python 3) - optional, only needed for GUI
* PySide2 - optional, only needed for GUI
* Working LaTeX installation (not essential, only for some plotting/table functions)

Python distributions like Anaconda have most of what you need (except for LaTeX).

To use the `GUI <https://getdist.readthedocs.io/en/latest/gui.html>`_ you need PySide or PySide2.
To use the `GUI <https://getdist.readthedocs.io/en/latest/gui.html>`_ you need PySide2.
See the `GUI docs <https://getdist.readthedocs.io/en/latest/gui.html#installation>`_ for suggestions on how to install.

Algorithm details
==================

Details of kernel density estimation (KDE) algorithms and references are give in the
`GetDist Notes <https://cosmologist.info/notes/GetDist.pdf>`_.
Details of kernel density estimation (KDE) algorithms and references are give in the GetDist notes
`arXiv:1910.13970 <https://arxiv.org/pdf/1910.13970>`_.

Samples file format
===================
Expand Down Expand Up @@ -114,8 +122,8 @@ Loading samples

To load an MCSamples object from text files do::

from getdist import loadMCSamples
samples = loadMCSamples('/path/to/xxx', settings={'ignore_rows':0.3})
from getdist import loadMCSamples
samples = loadMCSamples('/path/to/xxx', settings={'ignore_rows':0.3})

Here *settings* gives optional parameter settings for the analysis. *ignore_rows* is useful for MCMC chains where you want to
discard some fraction from the start of each chain as burn in (use a number >1 to discard a fixed number of sample lines rather than a fraction).
Expand All @@ -130,9 +138,9 @@ When you have many different chain files in the same directory,
plotting can work directly with the root file names. For example to compare *x* and *y* constraints
from two chains with root names *xxx* and *yyy*::

from getdist import plots
g = plots.get_single_plotter(chain_dir='/path/to/', analysis_settings={'ignore_rows':0.3})
g.plot_2d(['xxx','yyy'], ['x', 'y'])
from getdist import plots
g = plots.get_single_plotter(chain_dir='/path/to/', analysis_settings={'ignore_rows':0.3})
g.plot_2d(['xxx','yyy'], ['x', 'y'])


MCSamples objects can also be constructed directly from numpy arrays in memory, see the example
Expand All @@ -143,25 +151,25 @@ GetDist script

If you have chain files on on disk, you can also quickly calculate convergence and marginalized statistics using the *getdist* script:

usage: getdist [-h] [--ignore_rows IGNORE_ROWS] [-V] [ini_file] [chain_root]
usage: getdist [-h] [--ignore_rows IGNORE_ROWS] [-V] [ini_file] [chain_root]

GetDist sample analyser
GetDist sample analyser

positional arguments:
*ini_file* .ini file with analysis settings (optional, if omitted uses defaults
positional arguments:
*ini_file* .ini file with analysis settings (optional, if omitted uses defaults

*chain_root* Root name of chain to analyse (e.g. chains/test), required unless file_root specified in ini_file
*chain_root* Root name of chain to analyse (e.g. chains/test), required unless file_root specified in ini_file

optional arguments:
-h, --help show this help message and exit
--ignore_rows IGNORE_ROWS
set initial fraction of chains to cut as burn in
(fraction of total rows, or >1 number of rows);
overrides any value in ini_file if set
--make_param_file MAKE_PARAM_FILE
optional arguments:
-h, --help show this help message and exit
--ignore_rows IGNORE_ROWS
set initial fraction of chains to cut as burn in
(fraction of total rows, or >1 number of rows);
overrides any value in ini_file if set
--make_param_file MAKE_PARAM_FILE
Produce a sample distparams.ini file that you can edit
and use when running GetDist
-V, --version show program's version number and exit
-V, --version show program's version number and exit

where *ini_file* is optionally a .ini file listing *key=value* parameter option values, and chain_root is the root file name of the chains.
For example::
Expand All @@ -181,7 +189,7 @@ to produce the setting file distparams.ini, edit it, then run with your custom s
GetDist GUI
===================

Run *getdist-gui* to run the graphical user interface. This requires PySide, but will run on Windows, Linux and Mac.
Run *getdist-gui* to run the graphical user interface. This requires PySide2, but will run on Windows, Linux and Mac.
It allows you to open a folder of chain files, then easily select, open, plot and compare, as well as viewing standard GetDist outputs and tables.
See the `GUI Readme <http://getdist.readthedocs.org/en/latest/gui.html>`_.

Expand All @@ -195,10 +203,28 @@ No need to install this package separately if you have a full CosmoMC installati
Detailed help is available for plotting Planck chains
and using CosmoMC parameter grids in the `Readme <https://cosmologist.info/cosmomc/readme_python.html>`_.

Citation
===================
You can refer to the notes::

@article{Lewis:2019xzd,
author = "Lewis, Antony",
title = "{GetDist: a Python package for analysing Monte Carlo
samples}",
year = "2019",
eprint = "1910.13970",
archivePrefix = "arXiv",
primaryClass = "astro-ph.IM",
SLACcitation = "%%CITATION = ARXIV:1910.13970;%%",
url = "https://getdist.readthedocs.io"
}


and references therein as appropriate.

===================

.. raw:: html

<a href="http://www.sussex.ac.uk/astronomy/"><img src="https://cdn.cosmologist.info/antony/Sussex.png" style="height:170px" height="170px"></a>
<a href="http://erc.europa.eu/"><img src="https://erc.europa.eu/sites/default/files/content/erc_banner-vertical.jpg" style="height:200px" height="200px"></a>

Loading

0 comments on commit 9d4dec4

Please sign in to comment.