Skip to main content

Data-Driven Spatial Climate Impact Model core component code

Project description

DOI Python package Upload Python Package codecov

DSCIM: The Data-driven Spatial Climate Impact Model

This Python library enables the calculation of sector-specific partial social cost of greenhouse gases (SC-GHG) and SCGHGs that are combined across sectors using a variety of valuation methods and assumptions. The main purpose of this library is to parse the monetized spatial damages from different sectors and integrate them using different options ("menu options") that encompass different decisions, such as discount levels, discount strategies, and different considerations related to economic and climate uncertainty.

Installation

Install with pip using:

pip install dscim

Install the unreleased bleeding-edge version of the package with:

pip install git+https://github.com/climateimpactlab/dscim

Dependencies

dscim requires Python > 3.8. Additional compiled packages are required so we recommend installing dscim into a conda environment along with its dependencies.

  • numpy
  • pandas
  • xarray
  • matplotlib
  • dask
  • distributed
  • requests
  • statsmodels
  • zarr
  • netcdf4
  • h5netcdf
  • impactlab-tools
  • p_tqdm

Support

Source code is available online at https://github.com/climateimpactlab/dscim. Please file bugs in the bug tracker.

This software is Open Source and available under the Apache License, Version 2.0.

Structure and logic

The library is split into several components that implement the hierarchy defined by the menu options. These are the main elements of the library and serve as the main classes to call different menu options.

graph TD

SubGraph1Flow(Storage and I/O)
  subgraph "Storage utilities"
  SubGraph1Flow --> A[Stacked_damages]
  SubGraph1Flow -- Climate Data --> Climate
  SubGraph1Flow -- Economic Data --> EconData
  end

  subgraph "Recipe Book"
  A[StackedDamages] --> B[MainMenu]
  B[MainMenu] --> C[AddingUpRecipe];
  B[MainMenu] --> D[RiskAversionRecipe];
  B[MainMenu] --> E[EquityRecipe]
end

StackedDamages takes care of parsing all monetized damage data from several sectors and read the data using a dask.distributed.Client. At the same time, this class takes care of ingesting FaIR GMST and GMSL data needed to draw damage functions and calculate FaIR marginal damages to an additional emission of carbon. The data can be read using the following components:

Class Function
Climate Wrapper class to read all things climate, including GMST and GMSL. You can pass a fair_path with a NetCDF with FaIR control and pulse simulations and median FaIR runs. You can use gmst_path to input a CSV file with model and year anomaly data, for fitting the damage functions.
EconVars Class to ingest sector path related data, this includes GDP and population data. Some intermediate variables are also included in this class, check the documentation for more details
StackedDamages Damages wrapper class. This class contains all the elements above and additionally reads all the computed monetized damages. A single path is needed to read all damages, and sectors must be separated by folders. If necessary, the class will save data in .zarr format to make chunking operations more efficient. Check documentation of the class for more details.

and these elements can be used for the menu options:

  • AddingUpRecipe: Adding up all damages and collapse them to calculate a general SCC without valuing uncertainty.
  • RiskAversionRecipe: Add risk aversion certainty equivalent to consumption calculations - Value uncertainty over econometric and climate draws.
  • EquityRecipe: Add risk aversion and equity to the consumption calculations. Equity includes taking a certainty equivalent over spatial impact regions.

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

dscim-0.6.0.tar.gz (58.5 kB view details)

Uploaded Source

Built Distribution

dscim-0.6.0-py3-none-any.whl (66.9 kB view details)

Uploaded Python 3

File details

Details for the file dscim-0.6.0.tar.gz.

File metadata

  • Download URL: dscim-0.6.0.tar.gz
  • Upload date:
  • Size: 58.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for dscim-0.6.0.tar.gz
Algorithm Hash digest
SHA256 d7135be2663c45385d134405ba929562a46c901cad7cc953ee493b36fd95be4a
MD5 3d31de7a0e45c0d4095054a8518750ea
BLAKE2b-256 3c461220552b773eb0327bd188c89ef4a24a8981322e2297a991fab71966b372

See more details on using hashes here.

File details

Details for the file dscim-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: dscim-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 66.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for dscim-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8112e8d6f98321635760c2680105a8675e9bfb87c34496014e385183fba4422c
MD5 c4aad12178bbd110e413410ace1a5b91
BLAKE2b-256 2b24c4f76aaac79806c646542a09ec8a7d29890893dcb8616e081ab6abb5e3d1

See more details on using hashes here.

Supported by

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