Skip to main content

This library provides a layer above brightway2 for defining parametric models and running super fast LCA for monte carlo analysis.

Project description

Introduction

This library is a small layer above brightway2, designed for the definition of parametric inventories with fast computation of LCA impacts, suitable for monte-carlo analyis.

lca-algebraic provides a set of helper functions for :

  • compact & human readable definition of activites :
    • search background (tech and biosphere) activities
    • create new foreground activites with parametrized amounts
    • parametrize / update existing background activities (extending the class Activity)
  • Definition of parameters
  • Fast computation of LCAs
  • Computation of monte carlo method and global sensivity analysis (Sobol indices)

Installation

If you already have Anaconda & Jupyter installed, you can install the library with either pip or conda :

Conda

conda install -c oie-minesparistech lca_algebraic

PIP

pip install lca_algebraic

Pre-packaged installer for Windows

Alternatively, you can download and execute this installer. It will setup a full anaconda environment with Jupyter, Brightway2 and LCA Algebraic.

Usage & documentation

Please refer to the sample notebook (Markdown) (or here as ipynb).

The full API is documented here.

Licence & Copyright

This library has been developed by OIE - MinesParistech, for the project INCER-ACV, lead by ADEME.

It is distributed under the BSD licence.

Principles

The main idea of this libray is to move from procedural definition of models (slow and prone to errors) to a declarative / purely functionnal definition of parametric models (models as pure functions).

This enables fast computation of LCA impacts. We leverage the power of symbolic calculus provided by the great libary SymPy.

We define our model in a separate DB, as a nested combination of :

  • other foreground activities
  • background activities :
    • Technical, refering ecoinvent DB
    • Biopshere, refering brightway2 biosphere activities

The amounts in exchanges are expressed either as static amounts, or symbolic expressions of pre-defined parameters.

Each activity of our root model is defined as a parametrized combination of the foreground activities, which can themselves be expressed by the background activities.

When computing LCA for foreground models, the library develops the model as a combination of only background activities. It computes once for all the impact of background activities and compiles a fast numpy (vectorial) function for each impact, replacing each background activity by the static value of the corresponding impact.

By providing large vectors of parameter values to those numpy functions, we can compute LCA for thousands of values at a time.

Compatibility with brightway2

Under the hood, the activities we define with lca-algebraic are standard brightway2 activities. The amounts of exchanges are stored as float values or serialized as string in the property formula.

Parameters are also stored in the brightay2 projets, making it fully compatible with brightway.

Thus, a model defined with lca-algebraic is stored as a regular bw2 projet. We can use bw2 native support for parametrized dataset for computing LCAs, even if much more slower than the method explain here.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lca_algebraic_dev-1.0.4.836062.dev0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

lca_algebraic_dev-1.0.4.836062.dev0-py2.py3-none-any.whl (41.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file lca_algebraic_dev-1.0.4.836062.dev0.tar.gz.

File metadata

  • Download URL: lca_algebraic_dev-1.0.4.836062.dev0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.4

File hashes

Hashes for lca_algebraic_dev-1.0.4.836062.dev0.tar.gz
Algorithm Hash digest
SHA256 6fec8d99b4e6cf8d4e5c7e2fb69afb8a7496464842407525ec20c8a82e0f5197
MD5 385500d7806c55f5cb15d7bcfbaab8d9
BLAKE2b-256 e6dd2b5370cdec3967b6148f579b1edd8a12c45c08514006c35ee0161473e718

See more details on using hashes here.

File details

Details for the file lca_algebraic_dev-1.0.4.836062.dev0-py2.py3-none-any.whl.

File metadata

  • Download URL: lca_algebraic_dev-1.0.4.836062.dev0-py2.py3-none-any.whl
  • Upload date:
  • Size: 41.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.4

File hashes

Hashes for lca_algebraic_dev-1.0.4.836062.dev0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6e1f0530501788cdfd0f0d2f4940019834a5f54b5b7539412492e1213d1d09e3
MD5 c5bc1c1027686f933f0921348f91cd7d
BLAKE2b-256 69241d06faf8ddb7f5b56f60c3e90393d8d05ddff77ec9afa0dd8fa08de5a2a3

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