Skip to content

RyoTerasawa/pyclass

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyclass

Another Python binding of the CMB Boltzmann code CLASS, v3, with access to velocity power spectra.

Dependencies

  • numpy
  • cython

The CLASS code will be downloaded and compiled at installation.

Installation

python -m pip install git+https://github.com/adematti/pyclass

Mac OS

If 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=clang

Before 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.

Examples

See the tests of the code in pyclass/tests/ for examples of using each of the main CLASS modules.

Extensions

To implement a CLASS extension extension, just copy-paste base into e.g. extension, and make the changes to the Cython extension/binding.pyx and extension/cclassy.pxd files 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 *

Acknowledgments

This code heavily relies on classylss: http://classylss.readthedocs.io/.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Cython 85.4%
  • Python 9.0%
  • Makefile 5.6%