API ReferenceΒΆ

The CLASS engine can be initialized from a dictionary of parameters using:

ClassEngine([pars]) The default CLASS engine class, which initializes CLASS from an input set of parameters.

We provide wrappers for the main modules in the CLASS code:

Background(ClassEngine engine) A wrapper of the background module in CLASS.
Perturbs(ClassEngine engine) A wrapper of the perturbs module in CLASS.
Primordial(ClassEngine engine) A wrapper of the primordial module in CLASS.
Spectra(ClassEngine engine) A wrapper of the spectra module in CLASS.
Thermo(ClassEngine engine) A wrapper of the thermo module in CLASS.

There is also a wrapper object that provides compatibility with the syntax used by the astropy cosmology objects:

AstropyCompat(engine) A cosmology wrapper object that provides compatibility with the syntax from astropy.

And we provide two functions for loading parameters from file into a dictionary (which can be passed to ClassEngine):

classylss.load_ini(filename) Read a CLASS .ini file, returning a dictionary of parameters
classylss.load_precision(filename) Load a CLASS precision file into a dictionary.