Skip to content

KIPAC/c2i2o

Repository files navigation

c2i2o: Cosmology to Intermediates to Observables

Tests Documentation PyPI version PyPI pyversions License: MIT Python 3.12+

A modern Python library for cosmological parameter inference and emulation.

Overview

c2i2o provides a unified framework for bidirectional transformations in cosmological analysis:

Cosmological Parameters to/from Intermediate Data Products to/from Observables

Key Features

  • ** Fast Emulation**: Replace expensive simulations with trained emulators
  • ** Flexible Inference**: Multiple inference backends (MCMC, nested sampling, SBI)
  • ** Extensible**: Plugin architecture for custom emulators and observables
  • ** Multi-Framework**: Interfaces to CCL, Astropy, PyTorch, TensorFlow
  • ** Scalable**: Designed for diverse cosmological datasets

Installation

Basic Installation

pip install c2i2o

For PyTorch interfaces

pip install c2i2o[pytorch]

For TensorFlow interfaces

pip install c2i2o[tensorflow]

For CCL cosmology interfaces

pip install c2i2o[cccl]

For astropy cosmology interfaces

pip install c2i2o[astropy]

For database support

pip install c2i2o[db]

Install everything

pip install c2i2o[all]

Developer tools

git clone https://github.com/KIPAC/c2i2o.git
cd c2i2o
pip install -e ".[dev]"

Documentation

Full documentation is available at c2i2o.readthedocs.io.

Build documentation locally:

cd docs
make html
open build/html/index.html  # macOS
# or
xdg-open build/html/index.html  # Linux

About

Cosmologies to Intermediates to Obserables and Back Again

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published