https://github.com/a11to1n3/climapan-lab

Climate-Pandemic Economic Modeling Laboratory

https://github.com/a11to1n3/climapan-lab

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.5%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Climate-Pandemic Economic Modeling Laboratory

Basic Info
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 2
  • Releases: 3
Created about 1 year ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

CliMaPan-Lab: Climate-Pandemic Economic Modeling Laboratory

Python 3.8+ License: MIT Tests

CliMaPan-Lab is an agent-based economic modeling framework for studying interactions between climate change, pandemic dynamics, and economic systems.

Installation

```bash

Install from source

git clone https://github.com/a11to1n3/CliMaPan-Lab.git cd CliMaPan-Lab pip install -e .

Or install directly from GitHub

pip install git+https://github.com/a11to1n3/CliMaPan-Lab.git ```

Quick Start

```python from climapanlab.model import EconModel from climapanlab.baseparams import economicparams

Create model with default parameters

params = economic_params.copy() params['steps'] = 120 # 10 years (monthly steps)

Run simulation

model = EconModel(params) results = model.run()

Access results

df = results.variables.EconModel print(f"Final GDP: {df['GDP'].iloc[-1]}") ```

Example Script

bash python climapan_lab/examples/simple_example.py

Command Line Interface

Basic Usage

```bash

Basic simulation

climapan-run --settings BAU

With carbon tax

climapan-run --settings CT --plot

Multiple runs

climapan-run --noOfRuns 5

Help

climapan-run --help ```

Complete Command Line Arguments

The run_sim script supports the following arguments:

| Argument | Short | Type | Default | Description | |----------|-------|------|---------|-------------| | --noOfRuns | -n | int | 1 | Number of simulation runs to execute | | --settings | -s | str | "BAU" | Economic scenario: BAU, CT, CTRa, CTRb, CTRc, CTRd | | --covidSettings | -c | str | None | COVID scenario: BAU, DIST, LOCK, VAX | | --climateDamage | -d | str | "AggPop" | Climate damage type: AggPop, Idiosyncratic, or None | | --extractedVarListPathNpy | -l | str | None | Path to text file with variables to extract as numpy files | | --extractedVarListPathCsv | -v | str | None | Path to text file with variables to extract as CSV files | | --plot | -p | flag | False | Generate plots of simulation results |

Advanced Examples

```bash

Single run with carbon tax and plotting

climapan-run -s CT -p

Multiple runs with COVID lockdown scenario

climapan-run -n 10 -s BAU -c LOCK

Full scenario with climate damage and plotting

climapan-run -s CTRa -c VAX -d AggPop -p

Extract specific variables to separate files

climapan-run -s CT -l variableslist.txt -v outputvars.txt -p

Complex multi-parameter scenario

climapan-run -n 5 -s CTRb -c DIST -d Idiosyncratic -p

Scenario without climate damage

climapan-run -s CT -c BAU -d None -p ```

Scenario Descriptions

Economic Settings (--settings): - BAU: Business as usual (baseline scenario) - CT: Carbon tax implementation - CTRa: Carbon tax with revenue recycling option A - CTRb: Carbon tax with revenue recycling option B
- CTRc: Carbon tax with revenue recycling option C - CTRd: Carbon tax with revenue recycling option D

COVID Settings (--covidSettings): - BAU: COVID baseline scenario - DIST: Social distancing measures - LOCK: Lockdown implementation - VAX: Vaccination rollout scenario

Climate Damage Settings (--climateDamage): - AggPop: Aggregate population-level climate damage - Idiosyncratic: Individual-level climate damage variation - None: No climate damage effects

Variable Extraction

To extract specific model variables to separate files, create a text file with variable names (one per line):

```bash

variables_list.txt

GDP UnemploymentRate InflationRate Consumption Wage TotalTaxes BankDataWriter ```

Then use: bash climapan-run -s CT -l variables_list.txt -v variables_list.txt -p

Key Parameters

  • Economic Settings: 'BAU', 'CT', 'CTRa', 'CTRb', 'CTRc', 'CTRd'
  • COVID Settings: None, 'BAU', 'DIST', 'LOCK', 'VAX'
  • Climate Module: Enable/disable with climateModuleFlag
  • Simulation Length: Set steps (monthly time steps)

Model Features

  • Agents: Consumers, firms, banks, government with comprehensive lifecycle documentation
  • Climate Integration: Climate shocks and economic impacts with detailed step-by-step dynamics
  • Pandemic Dynamics: COVID-19 effects on economic activity with SEIR-like progression
  • Policy Analysis: Carbon taxes, fiscal policies with clear implementation details
  • Flexible Scenarios: Various economic and environmental conditions
  • Well-Documented Codebase: Extensive inline documentation explaining agent behavior, simulation flow, and component interactions

Example Scenarios

```python

Carbon tax scenario

params['settings'] = 'CT' params['co2_tax'] = 0.05 params['climateModuleFlag'] = True

Pandemic lockdown scenario

params['covidsettings'] = 'LOCK' params['lockdownscale'] = 0.7

Business as usual

params['settings'] = 'BAU' params['covid_settings'] = None ```

Testing

CliMaPan-Lab includes a comprehensive test suite with 60+ tests across 5 categories:

```bash

Run all tests

cd tests python runalltests.py

Run fast tests (excludes performance tests)

python runalltests.py --fast

Run specific test categories

python -m pytest testbasicfunctionality.py -v python -m pytest testmodelcomponents.py -v python -m pytest testintegration.py -v python -m pytest testexamples.py -v python -m pytest test_performance.py -v ```

Test Categories

  • Basic Functionality: Model creation, parameter validation
  • Model Components: Agent behavior, climate/COVID scenarios
  • Integration: End-to-end workflows, multi-scenario analysis
  • Examples: Script validation, import testing
  • Performance: Benchmarking, memory efficiency, scaling

CI/CD

The project uses GitHub Actions for automated testing and quality assurance:

  • CI: Quick checks on every commit (syntax, formatting, basic tests)
  • Tests: Comprehensive testing on Python 3.8-3.11
  • Security: Weekly security and dependency audits
  • Release: Automated releases on version tags

For more details, see .github/README.md.

License

MIT License - see LICENSE file for details.

Citation

bibtex @software{climapan_lab, title={CliMaPan-Lab: Climate-Pandemic Economic Modeling Laboratory}, author={D'Orazio, Paola and Pham, Anh-Duy and Nguyen, Hong Son}, year={2025}, url={https://github.com/a11to1n3/CliMaPan-Lab} }

Owner

  • Name: Anh-Duy Pham
  • Login: a11to1n3
  • Kind: user

GitHub Events

Total
  • Release event: 2
  • Delete event: 4
  • Push event: 30
  • Pull request event: 8
  • Create event: 8
Last Year
  • Release event: 2
  • Delete event: 4
  • Push event: 30
  • Pull request event: 8
  • Create event: 8

Dependencies

.github/workflows/ci.yml actions
  • actions/cache v4 composite
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
.github/workflows/release.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
.github/workflows/security-and-deps.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v4 composite
.github/workflows/test.yml actions
  • actions/cache v4 composite
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
  • codecov/codecov-action v4 composite
pyproject.toml pypi
  • agentpy >=0.1.5
  • dill >=0.3.4
  • h5py >=3.7.0
  • joblib >=1.1.0
  • matplotlib >=3.5.0
  • networkx >=2.6.0
  • numpy >=1.21.0
  • pandas >=1.3.0
  • pathos >=0.2.8
  • salib >=1.4.0
  • scikit-learn >=1.0.0
  • scipy >=1.7.0
requirements-dev.txt pypi
  • black >=22.0 development
  • flake8 >=5.0 development
  • ipykernel >=6.0 development
  • isort >=5.0 development
  • jupyter >=1.0 development
  • plotly >=5.0 development
  • pre-commit >=2.20 development
  • pytest >=7.0 development
  • pytest-cov >=4.0 development
  • pytest-mock >=3.10 development
  • seaborn >=0.11 development
  • sphinx >=5.0 development
  • sphinx-rtd-theme >=1.2 development
requirements.txt pypi
  • agentpy >=0.1.5
  • dill >=0.3.4
  • h5py >=3.7.0
  • joblib >=1.1.0
  • matplotlib >=3.5.0
  • networkx >=2.6.0
  • numpy >=1.21.0
  • pandas >=1.3.0
  • pathos >=0.2.8
  • salib >=1.4.0
  • scikit-learn >=1.0.0
  • scipy >=1.7.0
setup.py pypi
  • agentpy >=0.1.5
  • joblib >=1.1.0
  • matplotlib >=3.5.0
  • numpy >=1.21.0
  • pandas >=1.3.0
  • salib >=1.4.0
  • scikit-learn >=1.0.0
  • scipy >=1.7.0