Skip to main content

An interface between the CBM CFS3, libcbm_py, model and the GOBLIN model.

Project description

🌲 GOBLIN_CBM_runner, a CBM CFS3 interface for the GOBLIN model

license python Code style: black

Based on the GOBLIN (General Overview for a Backcasting approach of Livestock INtensification) LifeCycle Analysis tool, the cbm_runner package generates the data requried for the CBM CFS3 (libcbm_py) tool. It also interfaces with the tool directly, generating results in a single dataframe for all scenarios.

The outputs are related to biomass, and dead organic matter. These are summed into a total ecosystem value.

The estimated volumns are all in t of C.

Installation

Install from git hub.

pip install "cbm_runner@git+https://github.com/GOBLIN-Proj/goblin_cbm_runner.git@main" 

Install from PyPI

pip install goblin_cbm_runner

Usage

The Runner class takes the total afforestation area and divides it evenly across years (calibration year - target year).

from goblin_cbm_runner.default_runner.runner import Runner
import pandas as pd
import os


def main():
    # path to data
    path = "./data/runner_input"
    results_path = "./data/runner_results"

    # afforestation data for each scenario
    afforest_data = pd.read_csv(
        os.path.join(path, "cbm_afforestation.csv"), index_col=0
    )

    # basic configuration file
    config = os.path.join(path, "cbm_factory.yaml")

    # scenario_data
    sc_data = pd.read_csv(os.path.join(path, "scenario_dataframe.csv"))

    # calibration and end point
    calibration_year = 2020

    # instance of the Runner class
    runner = Runner(config, calibration_year, afforest_data, sc_data)

    # generation of data for each of the scenarios
    runner.generate_input_data()

    # generation of aggregated results
    runner.run_aggregate_scenarios().to_csv(os.path.join(results_path, "c_aggregate.csv"))

    # generation of annual flux results
    runner.run_flux_scenarios().to_csv(os.path.join(results_path, "c_flux.csv"))


if __name__ == "__main__":
    main()

License

This project is licensed under the terms of the MIT license.

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

goblin_cbm_runner-0.3.5.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

goblin_cbm_runner-0.3.5-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file goblin_cbm_runner-0.3.5.tar.gz.

File metadata

  • Download URL: goblin_cbm_runner-0.3.5.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.0 Linux/5.15.0-107-generic

File hashes

Hashes for goblin_cbm_runner-0.3.5.tar.gz
Algorithm Hash digest
SHA256 d56aa74faa8642f4c2f8811763431dd8c119e5fede21eefa7966052b050e0b7c
MD5 320dae537ad1788c10274efe30bda4b2
BLAKE2b-256 8c7da5013d8170df6719a9c1f2a09a3095b81eece3825e0b6d2af1b171546e9c

See more details on using hashes here.

File details

Details for the file goblin_cbm_runner-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: goblin_cbm_runner-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.0 Linux/5.15.0-107-generic

File hashes

Hashes for goblin_cbm_runner-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 751a9c92ce1f0d78c8a39c73ba9030dc1c51872fdfd290a9daf1c8b06e6d9253
MD5 78378af1582c0ebef275d033e3fc2688
BLAKE2b-256 3576c4cdeb7e57ddad0fec6d33006cdab5e1d3ff52462fbce87d5b63f45b7d10

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