Python API Reference

This page documents the public Python API of the Psi-Continuum v2 package. The API provides low-level access to background cosmological models, data loaders, and χ² likelihood functions used internally by the analysis pipeline.

⚠️ API status:
This API corresponds to the final archived release v0.2.3 and is frozen. No further extensions or changes are planned for Psi-Continuum v2.


Background Expansion Models

The package provides background-level ΛCDM and ΨCDM expansion functions.

from psi_continuum_v2.cosmology.background.lcdm import E_lcdm, H_lcdm
from psi_continuum_v2.cosmology.background.psicdm import E_psicdm, H_psicdm

These functions compute:

for ΛCDM and ΨCDM background cosmologies.


Likelihood Functions

Low-level χ² likelihoods are exposed for direct use and testing.

from psi_continuum_v2.cosmology.likelihoods.sn_likelihood import chi2_sn_full_cov
from psi_continuum_v2.cosmology.likelihoods.hz_likelihood import chi2_hz
from psi_continuum_v2.cosmology.likelihoods.bao_likelihood import chi2_bao
from psi_continuum_v2.cosmology.likelihoods.joint_likelihood import build_joint_chi2

These functions implement:

They are primarily intended for reproducibility and validation purposes.


Data Loaders

Dataset loader utilities are provided to read and validate observational data.

from psi_continuum_v2.cosmology.data_loaders.pantheonplus_loader import load_pantheonplus_hf

Loaders return structured NumPy arrays and covariance matrices used internally by the likelihood pipeline.


For most users, direct interaction with the Python API is not required.

The recommended entry point is the command-line interface:

psi-cli

which ensures consistent data handling, validation, and reproducible execution of the full analysis pipeline.


Notes

The API is intentionally minimal and background-only.