Another Python binding of the CMB Boltzmann code CLASS, v3, with access to velocity power spectra.
- numpy
- cython
The CLASS code will be downloaded and compiled at installation.
python -m pip install git+https://github.com/adematti/pyclassIf you wish to use clang compiler (instead of gcc), you may encounter an error related to -fopenmp flag.
In this case, you can try to export:
export CC=clangBefore installing pyclass. This will set clang OpenMP flags for compilation (see lesgourg/class_public#405). Note that with Mac OS gcc can point to clang.
See the tests of the code in pyclass/tests/ for examples of using each of the main CLASS modules.
To implement a CLASS extension extension:
- copy-paste
baseinto e.g.extension - update the version and url in
extension/_version.py - if necessary, make the changes to the Cython
extension/binding.pyxandextension/cclassy.pxdfiles for the specific extension
That's it! Upon installation (pip install --user .), the extension is automatically compiled (together with base), and can be imported as:
from pyclass.extension import *This code heavily relies on classylss: http://classylss.readthedocs.io/.