Skip to content

Commit

Permalink
- Rearranged structure to be more pythonic
Browse files Browse the repository at this point in the history
- New python functions for reading parameters from .ini files, and command-line camb.py.
- Planck 2018 parameter .ini files (in inifiles directory)
- Doc updates.
  • Loading branch information
cmbant committed Jan 17, 2019
1 parent 5259496 commit fa9bcd2
Show file tree
Hide file tree
Showing 124 changed files with 17,733 additions and 17,150 deletions.
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.mod
*.a
*.o
*.so
*.sm
*~*
.metadata
Expand All @@ -10,6 +11,7 @@ x64/
Debug/
Release/
Releaselib/
WinDLL/
*.suo
*.d
*.bat
Expand All @@ -20,12 +22,14 @@ Releaselib/
*.save
*.log
.idea
.DS_Storegit sta
.DS_Store
*egg*
test*dat
build
testfiles
inspectionProfiles
camb
!camb/
fortran/camb
Advisor/
Inspector/
.ipynb_checkpoints
camb/HighLExtrapTemplate_lenspotentialCls.dat
23 changes: 11 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: python

git:
depth: false

dist: trusty

sudo: false
Expand Down Expand Up @@ -34,14 +34,14 @@ matrix:
- GCC_VERSION="8"
- CHANNEL="conda-forge"
python: "3.6"


#before_install:
# - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# - sudo apt-get update -qq
# - sudo apt-get install -qq gfortran-6
# - sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-6 90

install:
- mkdir -p gfortran-symlinks
- ln -s /usr/bin/gfortran-$GCC_VERSION gfortran-symlinks/gfortran
Expand All @@ -62,17 +62,16 @@ install:
- conda info -a
- conda create -q -n test-environment -c $CHANNEL numpy scipy sympy six;
- source activate test-environment
- chmod +x tests/run_tests.sh
script: tests/run_tests.sh
- chmod +x fortran/tests/run_tests.sh

script: fortran/tests/run_tests.sh

after_failure:
- test $TRAVIS_PULL_REQUEST == "false" && test $CHANNEL == "defaults" && test $TRAVIS_REPO_SLUG == "cmbant/CAMB" && [ -d testfiles ] && bash tests/upload_tests.sh
- test $TRAVIS_PULL_REQUEST == "false" && test $CHANNEL == "defaults" && test $TRAVIS_REPO_SLUG == "cmbant/CAMB" && [ -d testfiles ] && bash fortran/tests/upload_tests.sh

before_deploy:
- make clean delete
- cd pycamb

- pushd fortran; make clean delete; popd

deploy:
- provider: pypi
skip_cleanup: true
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Dockerfile for running pycamb notebooks with binder
#https://mybinder.org/v2/gh/cmbant/camb/master?filepath=pycamb%2Fdocs%2FCAMBdemo.ipynb
#https://mybinder.org/v2/gh/cmbant/camb/master?filepath=docs%2FCAMBdemo.ipynb

FROM cmbant/cosmobox:python3

Expand All @@ -11,13 +11,13 @@ RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}

COPY . ${HOME}
USER root
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}

WORKDIR ${HOME}/pycamb
WORKDIR ${HOME}
RUN python setup.py build

WORKDIR ${HOME}
Expand Down
2 changes: 1 addition & 1 deletion pycamb/MANIFEST.in → MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include *.rst *.txt
recursive-include camb *.py
recursive-include camb_tests *.py
recursive-include dlls *.dll
include camb/cambdll.dll
include camb/PArthENoPE_880.2_marcucci.dat
include camb/PArthENoPE_880.2_standard.dat
51 changes: 35 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
===================
CAMB
===================
:CAMB: Code for Anisotropies in the Microwave Background, Fortran 95 code and python module
:CAMB: Code for Anisotropies in the Microwave Background
:Author: Antony Lewis and Anthony Challinor
:Homepage: https://camb.info/

.. image:: https://img.shields.io/pypi/v/camb.svg?style=flat
.. image:: http://img.shields.io/pypi/v/camb.svg?style=flat
:target: https://pypi.python.org/pypi/camb/

.. image:: https://readthedocs.org/projects/camb/badge/?version=latest
:target: https://camb.readthedocs.org/en/latest


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

For full details of the Fortran code see the `ReadMe <https://camb.info/readme.html>`_.
CAMB is a cosmology code for calculating cosmlogical observables, including
CMB, lensing, source count and 21cm angular power spectra, matter power spectra, transfer functions
and background evolution. The code is in Python and modern Fortran.

To install the CAMB python package on your computer run::

pip install camb

or from the source

python setup.py install

You will need gfortran 6 or higher installed to compile. Binary library builds for python on
Windows are also provided, so these are used instead if no gfortran installation
is found on Windows machines.

The python wrapper provides a module called "camb", source in the "pycamb" folder and documented in the `Python CAMB documentation <https://camb.readthedocs.io/en/latest/>`_.
See the `CAMB python example notebook <https://camb.readthedocs.org/en/latest/CAMBdemo.html>`_ for a
quick introduction to how to use the CAMB Python package.

The python wrapper provides a module called "camb" documented in the `Python CAMB documentation <https://camb.readthedocs.io/en/latest/>`_.

.. image:: https://readthedocs.org/projects/camb/badge/?version=latest
:target: https://camb.readthedocs.org/en/latest

The master and devel branches have an integrated test suite, which runs automatically on `Travis <http://travis-ci.org>`_ for new commits and pull requests.
Reference results and test outputs are stored in the `test outputs repository <https://github.com/cmbant/CAMB_test_outputs/>`_. Tests can also be run locally.
To compile the Fortran command-line code run "Make" in the fortran directory. For full details
see the `ReadMe <https://camb.info/readme.html>`_.

Branches
=============================
Expand All @@ -27,19 +48,17 @@ The master branch contains latest changes to the main release version.

.. image:: https://secure.travis-ci.org/cmbant/CAMB.png?branch=master
:target: https://secure.travis-ci.org/cmbant/CAMB/builds
.. image:: https://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/cmbant/camb/master?filepath=pycamb%2Fdocs%2FCAMBdemo.ipynb

The devel branch is a development version, which integrates CAMB and CAMB sources, and uses Fortran 2008 (and hence requires ifort 14+ or gfortran 6+). It also allows runtime switching of the dark energy and halofit model,
general numerically-interpolated primordial power spectra and source window functions, and easy access to lower-level accuracy parameters.

.. image:: https://secure.travis-ci.org/cmbant/CAMB.png?branch=devel
:target: https://secure.travis-ci.org/cmbant/CAMB/builds
.. image:: https://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/cmbant/camb/devel?filepath=pycamb%2Fdocs%2FCAMBdemo.ipynb
:target: https://mybinder.org/v2/gh/cmbant/camb/master?filepath=docs%2FCAMBdemo.ipynb

The devel branch contains latest less-stable things in development.
The master and devel branches have an integrated test suite, which runs automatically on `Travis <http://travis-ci.org>`_ for new commits and pull requests.
Reference results and test outputs are stored in the `test outputs repository <https://github.com/cmbant/CAMB_test_outputs/>`_. Tests can also be run locally.

To reproduce legacy results, see these branches:

CAMB_sources is the old public `CAMB Sources <http://camb.info/sources/>`_ code.
CAMB_v1 is the old Fortran-oriented (gfortran 4.8-compatible) version as used by the Planck 2018 analysis.

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

Expand Down
19 changes: 0 additions & 19 deletions base_planck_lowl_lowLike.ini

This file was deleted.

22 changes: 0 additions & 22 deletions base_plikHM_TT_lowTEB_lensing.ini

This file was deleted.

Loading

0 comments on commit fa9bcd2

Please sign in to comment.