Skip to main content

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.

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.

Metadata

Release files for lca-algebraic 0.0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lca-algebraic 0.0.12
File Size Uploaded Provenance Actions
lca_algebraic-0.0.12.tar.gz 26.9 kB Without provenance Details for lca_algebraic-0.0.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lca-algebraic 0.0.12
File Interpreter ABI Platform Actions
lca_algebraic-0.0.12-py2.py3-none-any.whl Python 3, Python 2 none any Details for lca_algebraic-0.0.12-py2.py3-none-any.whl

Total release size: 56.2 kB

Release files / lca_algebraic-0.0.12.tar.gz

Download URL lca_algebraic-0.0.12.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2b12f7e55c9684f76166195975cd4cfd6822f1d4f2ea5cf7d80cf71b1a87d6f5
BLAKE2b-256 checksum
How to use checksums
6930c88b1e66caa3e6626c67e8a1e42c3f6858cc7d738a3e034f9863a61599e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200102 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

Release files / lca_algebraic-0.0.12-py2.py3-none-any.whl

Download URL lca_algebraic-0.0.12-py2.py3-none-any.whl
Size 29.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1f5e00dac385ca5edc553a4825c694cfae126a9610217babc9c1a6e54b121de1
BLAKE2b-256 checksum
How to use checksums
64c849621d68da9691d98bd1f872c481928bfa512702d8e84f058e015e642fcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200102 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

Security for lca-algebraic 0.0.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.12 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page