Skip to main content

This is a Python package designed to import external input-output databases to brightway, such as EXIOBASE. In addition, it can assist you to model different types of uncertainty analysis or scenario analysis with datapackage matrix data.

Project description

BAMBOO

Python Jupyter License

This is a Python package designed to import external input-output databases to brightway, such as EXIOBASE. In addition, it can assist you to model different types of uncertainty analysis or scenario analysis with datapackage matrix data.

This library is developed based on Brightway2.5 and EXIOBASE3 dataset.

📖 Background Knowledge

EXIOBASE

EXIOBASE is a global, detailed Multi-Regional Environmentally Extended Supply-Use Table (MR-SUT) and Input-Output Table (MR-IOT). It can be used to do Life Cycle Assessment(LCA) analysis. The inventory data and emission data is stored in txt files.

EXIOBASE3 is one of the most extensive EE-MRIO systems available worldwide. EXIOBASE 3 builds upon the previous versions of EXIOBASE by using rectangular supply‐use tables (SUT) in a 163 industry by 200 products classification as the main building blocks.

Formula

$g = B (I-A)^{-1} f$.

Where:

  • B: Biosphere matrix
  • A: Technospere matrix
  • I: Identity matrix
  • $f$: Functional unit
  • g: Inventory

✨ Features

  • Perform LCA based on input-output databases (such as EXIOBASE), using Brightway.

    • Perform LCA using only EXIOBASE as background system, or using EXIOBASE combined with a customizable foreground system.
      • The corresponding matrices are arranged like this:
        The foreground system is constructed from four matrices: fgbg, fgfg, bgfg, and bifg. These matrices are named to reflect their row and column positions. Specifically:
        • fgfg: This is the square matrix representing the foreground system. It includes exchanges from foreground (fg) to foreground (fg).
        • fgbg: This is the matrix representing all exchanges from the foreground (fg) system to the background (bg) system. Normally, this matrix is empty because the background system (database) is pre-defined and thus does not have inputs form the user-defined foreground system. So, by default this matrix is all zeros.
        • bgfg: This is the matrix representing all exchanges from the background (bg) to the foreground (fg) system. For example, this could be the input of “EU28-Energy” to an activity in the foreground system.
        • bifg: This is the matrix representing all the biosphere (bi) exchanges in the foreground (fg) system.
          matrices figure
  • Uncertainty Analysis for input-output databases.

    1. uniformly
      • This strategy assumes that all exchanges have the same uncertainty(that is type of distribution, location, and scale). It adds this uncertainty information to all exchanges to both biosphere and technosphere matrices or the user can specify to add uncertainty only to one of them.
    2. columnwise
      • This strategy adds the same uncertainty information to each exchange of a specific column of a matrix, but different uncertainty information to each column of a matrix. Different columns can thus have different uncertainty(that is type of distribution, location, and scale). To use this strategy, the uncertainty information should be defined in the user input file (uncertainty_file.csv).
    3. itemwise
      • This strategy adds different uncertainty(that is type of distribution, location, and scale) to different exchanges. To use this strategy, the uncertainty information should be defined in the user input file (uncertainty_file.csv).

    NOTICE:

    • Supported uncertainty type: 0, 1, 2, 3, 4 (Check here to select your uncertainty type.)
    • For strategy 2 and 3, only technosphere and biosphere matrices are supported.
    • itemwise recommends apply only to the foreground system, considering the amount of data that introduces uncertainty for both systems. The library does not specifically handle this situation.

👩‍💻 Getting Started

Requirements

  • This library was developed using Python 3.12.9.

Dependencies

  • You need to have Brightway2.5 installed. (click here to see how to install Brightway).
  • If you need to find the characterization factors through Brightway, then you need to have ecoinvent imported, otherwise, it is not necessary. (click here to see how to import ecoinvent.)

Installation

  1. Open your local terminal.
    (For windows, search for "Terminal/Prompt/PowerShell"; for macOS, search for "Terminal")

  2. Install the library.

    pip install bamboo_lca
    

Required files

(The examples of those file is in data folder.)

  1. External database file

    • This is the file of your background database. For EXIOBASE, it's the A.txt and S.txt.
  2. Foreground system file

    • Reference example: foreground_system.csv
    • This is the file for your foreground database, you need to prepare yourself.
    • Below shows the purpose of each column. You only need to change the data instead of the column names and order.
      • Activity name: includes all activity names of foreground.
      • Exchange name: includes all exchange names of foreground.
      • Exchange type: indicate the exchange is belongs to technosphere, biosphere or production.
      • Exchange amount: indicate the amount of exchange required.
  3. Uncertainty file

    • Reference example: uncertainty_file.csv
    • It's essentially the same as foreground system file, just add uncertainty information to the same file. You can also add it in foreground system file.
    • You only need to change the data instead of the column names and order. Except the columns required in foreground system file, you also need:
      • Exchange uncertainty type: indicate the type of uncertainty you are gonna experiment. (Check uncertainty types here).
      • GSD: short for "Geometric Standard Deviation", used for uncertainty distribution definition.
      • Exchange negative: indicate uncertainty distribution is negative or positive.
  4. Characterization factor file

    • Reference example: cf_mapping_file.csv
    • Below shows the purpose of some columns.
      • brightway code: This is the code of activity in Brightway.
      • CFs: The characterization factor value.

Notebooks

Figures

There are some figures in the assets folder to help you understand the structure of the library.

💬 Contact

If you encounter any issues or would like to contribute to the library, please contact:

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

bamboo_lca-0.1.1.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

bamboo_lca-0.1.1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file bamboo_lca-0.1.1.tar.gz.

File metadata

  • Download URL: bamboo_lca-0.1.1.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bamboo_lca-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b9afa03f41921fd5db2989a6b477f021aa631c997ee70eff415b765213caf859
MD5 04b3d7eaeda72fe65d33f71521e4a145
BLAKE2b-256 5dce3a5f69f1c9704c87aedae189cf01a26e91fc6ce330ddf93fbb4f94bf36a8

See more details on using hashes here.

File details

Details for the file bamboo_lca-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bamboo_lca-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bamboo_lca-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 068a1311c07cd635ef6ae36adfeea5791c02c8a354b524000eaca68003b9cb97
MD5 353bdab66d8b410d0e355ae1afb2960d
BLAKE2b-256 93b1f6150adbf01d22c9fb94dd816addead0302238e8d8da7bc5cf0099320bc1

See more details on using hashes here.

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