Methodology
Transparent carbon accounting methodology with provenance tracking and reproducible calculations.
Data Pipeline
CSV Inputs (data/)
↓
Pydantic Schemas (calc/schema.py)
↓
Derivation Engine (calc/derive.py)
↓
Figure Generation (calc/figures.py)
↓
Manifest Creation (calc/figures_manifest.py)
↓
Hashed Artifacts (dist/artifacts/<hash>/)Manifest-First Architecture
Every data artifact is accompanied by a manifest containing:
- Byte Hash (SHA256): Cryptographic hash of the figure for integrity verification
- Generation Timestamp: ISO 8601 timestamp of when the artifact was created
- Citation Keys: References to source data and methodology
- Provenance Chain: Complete lineage from raw data to final artifact
- Numeric Invariance: Test results ensuring calculations remain consistent
Data Sources
Emission Factors
Source: data/emission_factors.csv
Validated emission factors from authoritative sources including IPCC, EPA, and GHG Protocol.
Grid Intensity
Source: data/grid_intensity.csv
Regional electricity grid carbon intensity values updated quarterly.
Activities
Source: data/activities.csv
Standardized activity definitions mapped to emission factors.
Verification
All artifacts can be independently verified:
- Retrieve manifest from
/api/manifests/[id] - Download referenced figure file
- Compute SHA256 hash of figure
- Compare computed hash with manifest.figure_sha256
- Verify numeric invariance tests passed
Reproducibility
The entire build process is reproducible:
# Clone repository
git clone https://github.com/chrislyons/carbon-acx.git
# Install dependencies
poetry install
# Run derivation pipeline
make build
# Verify artifacts match manifests
pytest tests/test_manifests.py