dscim


Namedscim JSON
Version 0.5.0 PyPI version JSON
download
home_page
SummaryData-Driven Spatial Climate Impact Model core component code
upload_time2023-11-18 06:19:24
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords
VCS
bugtrack_url
requirements xarray pandas numpy matplotlib dask requests statsmodels pytest pytest-cov zarr black ruff netcdf4 h5netcdf impactlab-tools p_tqdm pyarrow
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![DOI](https://zenodo.org/badge/496710628.svg)](https://zenodo.org/badge/latestdoi/496710628)
[![Python package](https://github.com/ClimateImpactLab/dscim/actions/workflows/pythonpackage.yaml/badge.svg)](https://github.com/ClimateImpactLab/dscim/actions/workflows/pythonpackage.yaml)
[![Upload Python Package](https://github.com/ClimateImpactLab/dscim/actions/workflows/python-publish.yaml/badge.svg)](https://github.com/ClimateImpactLab/dscim/actions/workflows/python-publish.yaml)
[![codecov](https://codecov.io/gh/ClimateImpactLab/dscim/graph/badge.svg?token=DQMDSHFEYP)](https://codecov.io/gh/ClimateImpactLab/dscim)

# 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:
```shell
pip install dscim
```

Install the unreleased bleeding-edge version of the package with:
```shell
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](https://github.com/climateimpactlab/dscim/issues).

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.

```mermaid
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.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "dscim",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/17/2b/92aec2136e7fb65858899ffcafbaab98618885e318e9fd09d3ec2fb53b15/dscim-0.5.0.tar.gz",
    "platform": null,
    "description": "[![DOI](https://zenodo.org/badge/496710628.svg)](https://zenodo.org/badge/latestdoi/496710628)\n[![Python package](https://github.com/ClimateImpactLab/dscim/actions/workflows/pythonpackage.yaml/badge.svg)](https://github.com/ClimateImpactLab/dscim/actions/workflows/pythonpackage.yaml)\n[![Upload Python Package](https://github.com/ClimateImpactLab/dscim/actions/workflows/python-publish.yaml/badge.svg)](https://github.com/ClimateImpactLab/dscim/actions/workflows/python-publish.yaml)\n[![codecov](https://codecov.io/gh/ClimateImpactLab/dscim/graph/badge.svg?token=DQMDSHFEYP)](https://codecov.io/gh/ClimateImpactLab/dscim)\n\n# DSCIM: The Data-driven Spatial Climate Impact Model\n\nThis 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\nlibrary is to parse the monetized spatial damages from different sectors and integrate them\nusing different options (\"menu options\") that encompass different decisions, such as\ndiscount levels, discount strategies, and different considerations related to\neconomic and climate uncertainty. \n\n## Installation\n\nInstall with `pip` using:\n```shell\npip install dscim\n```\n\nInstall the unreleased bleeding-edge version of the package with:\n```shell\npip install git+https://github.com/climateimpactlab/dscim\n```\n\n### Dependencies\n\n`dscim` requires Python > 3.8. Additional compiled packages are required so we recommend installing `dscim` into a `conda` environment along with its dependencies.\n\n- numpy\n- pandas\n- xarray\n- matplotlib\n- dask\n- distributed\n- requests\n- statsmodels\n- zarr\n- netcdf4\n- h5netcdf\n- impactlab-tools\n- p_tqdm\n\n## Support\nSource code is available online at https://github.com/climateimpactlab/dscim. Please file bugs in the [bug tracker](https://github.com/climateimpactlab/dscim/issues).\n\nThis software is Open Source and available under the Apache License, Version 2.0.\n\n## Structure and logic\n\nThe library is split into several components that implement the hierarchy\ndefined by the menu options. These are the main elements of the library and\nserve as the main classes to call different menu options.\n\n```mermaid\ngraph TD\n\nSubGraph1Flow(Storage and I/O)\n  subgraph \"Storage utilities\"\n  SubGraph1Flow --> A[Stacked_damages]\n  SubGraph1Flow -- Climate Data --> Climate\n  SubGraph1Flow -- Economic Data --> EconData\n  end\n\n  subgraph \"Recipe Book\"\n  A[StackedDamages] --> B[MainMenu]\n  B[MainMenu] --> C[AddingUpRecipe];\n  B[MainMenu] --> D[RiskAversionRecipe];\n  B[MainMenu] --> E[EquityRecipe]\nend\n```\n\n`StackedDamages` takes care of parsing all monetized damage data from several\nsectors and read the data using a `dask.distributed.Client`. At the same time,\nthis class takes care of ingesting FaIR GMST and GMSL data needed to draw damage\nfunctions and calculate FaIR marginal damages to an additional emission of\ncarbon. The data can be read using the following components: \n\nClass            | Function                                                                                                                                                                                                                                                                                                                                                                                           |\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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. |\n| `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                                                                                                                                                                                                             |\n| `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.                      |\n\n\nand these elements can be used for the menu options: \n - `AddingUpRecipe`: Adding up all damages and collapse them to calculate a general SCC without valuing uncertainty.\n - `RiskAversionRecipe`: Add risk aversion certainty equivalent to consumption calculations - Value uncertainty over econometric and climate draws.\n - `EquityRecipe`: Add risk aversion and equity to the consumption calculations. Equity includes taking a certainty equivalent over spatial impact regions.\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Data-Driven Spatial Climate Impact Model core component code",
    "version": "0.5.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/ClimateImpactLab/dscim/issues",
        "Documentation": "https://github.com/ClimateImpactLab/dscim",
        "Homepage": "https://github.com/ClimateImpactLab/dscim",
        "Source": "https://github.com/ClimateImpactLab/dscim"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20549426d3da801cf4a466e6f5e68d2efc44cf691cbee24a1bc1014fd7556ec8",
                "md5": "057de3e5d830cdc015e94a2b44c26e17",
                "sha256": "3bd18755b241758f7e81a86cc4ced6232bdad7bce4ed5c42368f45977ea73e42"
            },
            "downloads": -1,
            "filename": "dscim-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "057de3e5d830cdc015e94a2b44c26e17",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 66735,
            "upload_time": "2023-11-18T06:19:23",
            "upload_time_iso_8601": "2023-11-18T06:19:23.176034Z",
            "url": "https://files.pythonhosted.org/packages/20/54/9426d3da801cf4a466e6f5e68d2efc44cf691cbee24a1bc1014fd7556ec8/dscim-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "172b92aec2136e7fb65858899ffcafbaab98618885e318e9fd09d3ec2fb53b15",
                "md5": "7c274b907e6d3ae149b39cc58de1754e",
                "sha256": "2fab402e7c4bd7ded3659d2ee3f8cfeb30ace6e58aab06c07d07e6b3060e5e53"
            },
            "downloads": -1,
            "filename": "dscim-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7c274b907e6d3ae149b39cc58de1754e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 58179,
            "upload_time": "2023-11-18T06:19:24",
            "upload_time_iso_8601": "2023-11-18T06:19:24.641420Z",
            "url": "https://files.pythonhosted.org/packages/17/2b/92aec2136e7fb65858899ffcafbaab98618885e318e9fd09d3ec2fb53b15/dscim-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-18 06:19:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ClimateImpactLab",
    "github_project": "dscim",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "xarray",
            "specs": [
                [
                    "==",
                    "2023.10.1"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "2.1.3"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "1.26.1"
                ]
            ]
        },
        {
            "name": "matplotlib",
            "specs": [
                [
                    "==",
                    "3.8.0"
                ]
            ]
        },
        {
            "name": "dask",
            "specs": [
                [
                    "==",
                    "2023.11.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.31.0"
                ]
            ]
        },
        {
            "name": "statsmodels",
            "specs": [
                [
                    "==",
                    "0.14.0"
                ]
            ]
        },
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "7.4.3"
                ]
            ]
        },
        {
            "name": "pytest-cov",
            "specs": [
                [
                    "==",
                    "4.1.0"
                ]
            ]
        },
        {
            "name": "zarr",
            "specs": [
                [
                    "==",
                    "2.16.1"
                ]
            ]
        },
        {
            "name": "black",
            "specs": [
                [
                    "==",
                    "23.10.1"
                ]
            ]
        },
        {
            "name": "ruff",
            "specs": [
                [
                    "==",
                    "0.1.5"
                ]
            ]
        },
        {
            "name": "netcdf4",
            "specs": [
                [
                    "==",
                    "1.6.5"
                ]
            ]
        },
        {
            "name": "h5netcdf",
            "specs": [
                [
                    "==",
                    "1.2.0"
                ]
            ]
        },
        {
            "name": "impactlab-tools",
            "specs": [
                [
                    "==",
                    "0.5.0"
                ]
            ]
        },
        {
            "name": "p_tqdm",
            "specs": [
                [
                    "==",
                    "1.4.0"
                ]
            ]
        },
        {
            "name": "pyarrow",
            "specs": [
                [
                    "==",
                    "13.0.0"
                ]
            ]
        }
    ],
    "lcname": "dscim"
}
        
Elapsed time: 0.13675s