Skip to main content

Effort Sharing

DOI

Compute fair national emissions allocations using transparent, reproducible workflows. Designed by researchers for researchers.

Introduction

This package combines a variety of data sources to compute fair national emissions allocations, study variability, and compare results with NDC estimates and cost-optimal scenario projections.

  • Gather country-level data (population, GDP, historical emissions, etc.)
  • Compute global future emission pathways based on configurable scenarios
  • Calculate allocations for countries/regions using various effort-sharing rules
  • Compare allocations, NDCs, and cost-optimal scenarios
  • Conduct variance decomposition (Sobol analysis)

Installation Instructions

If you want to use some of the existing functionality, simply install from PyPI:

pip install effort-sharing

If you plan to develop the code or modify notebooks/scripts, install from source (see Developer Instructions).

Obtaining Input Data

We're working to provide input data directly or via original sources. For now, contact mailto:mark.dekker@pbl.nl for quick access.

Usage Overview

Command Line Interface (CLI)

Run step-by-step workflows using the CLI:

effortsharing --help
effortsharing generate-config
effortsharing get-input-data
effortsharing global-pathways
effortsharing policy-scenarios
effortsharing allocate NLD
effortsharing aggregate 2040
# You can also overwrite defaults 
effortsharing allocate NLD --config config.yml --log-level WARNING --gas CO2 --lulucf excl

# Or ask for help to see all options:
effortsharing aggregate --help

The CLI lets you quickly run complete workflows or focus on specific countries/years.

Scripts

Automate workflows using scripts in the scripts folder.
Example: scripts/cabe_export.py loads data, calculates pathways/allocations, aggregates results, and exports everything.
Edit parameters at the top of the script, then run with:

python scripts/cabe_export.py

Scripts are not included in the PyPI package.

Interactive Notebooks & API

Import high-level and low-level functions in Python or Jupyter notebooks for custom analysis and visualization.

The internal structure of the effortsharing package is documented in apidocs.md. While unpolished, it may serve as a starting point when diving into the internals of the code.

See the notebooks folder for examples.
Note: Notebooks may be outdated as the package evolves, but dedicated releases ensure reproducibility for published results.

Configuration File

Many commands require a configuration file.
Generate a default config:

effortsharing generate-config

The config file controls:

  • Data paths
  • Whether to load/save intermediate results
  • Experiment parameters
  • Dimension ranges for pathway parameters (shorter ranges = faster runs, but less variability)

See comments in the generated config for details.

Developer Instructions

If you plan to contribute, please follow these guidelines and respect the code of conduct.

Source Installation

Clone the repo and set up a (conda) environment:

git clone https://github.com/imagepbl/effort-sharing
cd effort-sharing
conda env create --file environment.yml
conda activate effortsharing_env
conda env update -f environment.yml

For reproducibility, use the conda-lock file:

conda-lock lock
conda-lock install --name effortsharing_env
pip install -e .[dev]  # conda-lock doesn't install local libraries

Code Style / Formatting

We use ruff for linting and formatting.
Configuration is in pyproject.toml.

ruff check src
ruff check --fix src
ruff format src

VS Code users: install the ruff plugin for in-editor feedback.

Documentation

API docs are generated from docstrings using pydoc-markdown:

uvx pydoc-markdown -I src --render-toc > apidocs.md

Testing

A test script is included to quickly check if / how the results have been affected since a previous run. Use it as such:

pytest -v --confcutdir=$PWD/scripts/compare_dirs \
    scripts/compare_dirs/test.py \
    --reference-dir data/reference \
    --current-dir data/current \
    --atol 1e-9 --rtol 1e-5

where you replace the paths to reference and current with actual folders you want to compare.

Making a Release

We release at least when publishing new results (e.g. journal, Carbon Budget Explorer). To generate a new release, open a new issue using the release template and follow the steps in the checklist.

Referencing this Repository

Cite the code: ...

Output data is publicly available on Zenodo:

DOI

Metadata

Release files for effort-sharing 2025.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for effort-sharing 2025.8.1
File Size Uploaded
effort_sharing-2025.8.1.tar.gz 53.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for effort-sharing 2025.8.1
File Interpreter ABI Platform
effort_sharing-2025.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 123.2 kB

Release files / effort_sharing-2025.8.1.tar.gz

Download URL effort_sharing-2025.8.1.tar.gz
Size 53.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e0a9e09c88e105e8cd6be02965ecaad105667e91be72e7d0f3b69c52dfdfd46c
BLAKE2b-256 checksum
How to use checksums
219cacd199e51d88ecc9b4776645bb4c1137d6a1ad0dcf3e012087caac62d752
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2025.

Transparency log

Release files / effort_sharing-2025.8.1-py3-none-any.whl

Download URL effort_sharing-2025.8.1-py3-none-any.whl
Size 69.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea20a0d8975db6d6dfa5cb2ed83b7850960d76927ac2b45176fafaf7af9f69e2
BLAKE2b-256 checksum
How to use checksums
9f9fb2183edcc4e3af649d38568be13a6c08bdfe64444021b0e943ec82985319
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2025.8.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page