Skip to main content

Integrated Assessment Model, based on FRIDA, written in python using sostrades

Project description

fridapy

A coupled climate–economy–society system-dynamics model, based on the WorldTrans FRIDA v2.1 integrated assesment model and re-implemented in Python as a set of SoSTrades disciplines solved by an MDA (multidisciplinary analysis) coupling. This version replicates the original FRIDA model v2.1 results, using a simplified (tuned) ocean carbon model.

Installation

fridapy depends on sostrades-core, which is not published on PyPI, so it must be installed first from GitHub (this is not our package — see os-climate/sostrades-core):

pip install git+https://github.com/os-climate/sostrades-core.git@v5.3.4
pip install fridapy            # or, from a checkout:  pip install -e .

Equivalently, install the pinned runtime in one step:

pip install -r requirements.txt
pip install -e .

For the diagnostic / ensemble / plotting scripts under diagnostics/, install the extra:

pip install -e ".[diagnostics]"     # adds matplotlib, scipy

Quickstart

Run the full model for a single climate case:

import numpy as np
from sostrades_core.execution_engine.execution_engine import ExecutionEngine

DISCIPLINES = [
    'Demographics', 'Economy', 'Energy', 'Emissions', 'Climate', 'LandUse',
    'GovernmentRegulations', 'BehavioralChoices', 'BehavioralChange',
    'Resources', 'SeaLevel', 'SeaLevelRiseImpacts', 'PlanetaryBoundaries',
]
time = np.arange(1980, 2150 + 1e-9, 1.0)

study = 'fridapy'
ee = ExecutionEngine(study)
ee.select_root_process(repo='fridapy', mod_id='process')
ee.configure()

values = {f'{study}.{study}.{d}.time': time for d in DISCIPLINES}
values[f'{study}.{study}.Climate.climate_case'] = 50          # 1–100
ee.load_study_from_input_dict(values)
ee.dm.set_values_from_dict({
    f'{study}.{study}.max_mda_iter': 300,
    f'{study}.{study}.tolerance': 1e-3,
    f'{study}.{study}.inner_mda_name': 'MDAGaussSeidel',
})
ee.execute()

gdp = ee.dm.get_value(f'{study}.Real_GDP')

See diagnostics/usecase.py for a complete 9-panel example, and diagnostics/run_ensemble.py for ensemble runs (local or Modal).

Repository structure

Path Contents
fridapy/disciplines/ the 13 SoSTrades disciplines
fridapy/process/ the MDA process builder
fridapy/data/ packaged runtime reference data (forcing series, climate cases)
diagnostics/ ensemble runners, calibration, validation, plotting
docs/ design notes for each major mechanism
data/ full development dataset (Stella FRIDA.isdb source, calibration inputs)

Data sources

The packaged fridapy/data/ files (frida_input_data.csv, climate_cases.json) are derived from the FRIDA v2.1 model. The FRIDA reference uncertainty envelopes used by some diagnostics come from Schoenberg, W. (2025), FRIDA v2.1 Endogenous Model Behavior (EMB) 100000 member ensemble, Zenodo, 10.5281/zenodo.15396799 (CC-BY-4.0); that ~270 MB archive is not bundled — see diagnostics/analyze_ensemble.py for how to obtain it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fridapy-0.1.0.tar.gz (168.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fridapy-0.1.0-py3-none-any.whl (178.0 kB view details)

Uploaded Python 3

File details

Details for the file fridapy-0.1.0.tar.gz.

File metadata

  • Download URL: fridapy-0.1.0.tar.gz
  • Upload date:
  • Size: 168.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fridapy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a100e185916098ef0200bc632e24ca8685e06f5c01f099cd3118684fe7869d89
MD5 23187641b6292798f974eff9ecee884e
BLAKE2b-256 0dc897dbfdd8ec46fd0586cf7729d61248b60f1cf58fb5b14cf6c38f8627c680

See more details on using hashes here.

Provenance

The following attestation bundles were made for fridapy-0.1.0.tar.gz:

Publisher: pypi-release.yml on SallyDa/fridapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fridapy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fridapy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 178.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fridapy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7dba504650accc877a04726b3efa71ee23cb77c132df63b586e0bc70a7a50478
MD5 dd25e2b3e03c13c48ef84f18c1006047
BLAKE2b-256 87c7e406c3b1d8de6dd0600b4fc8d88b60ee9601f5c46a18608835283ccbbf14

See more details on using hashes here.

Provenance

The following attestation bundles were made for fridapy-0.1.0-py3-none-any.whl:

Publisher: pypi-release.yml on SallyDa/fridapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page