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

logo

Python 3.10 Python 3.11 Python 3.12 Python 3.13

Brightway 2.4 Brightway 2.5

main status dev status     bw25 status dev25 status

lca_algebraic is a layer above Brightway designed for the definition of parametric inventories with fast computation of LCA impacts, suitable for monte-carlo / global sensitivity analysis

It integrates the magic of Sympy in order to write parametric formulas as regular Python expressions.

lca-algebraic provides a set of helper functions for :

  • compact & human readable definition of activities :
    • search background (tech and biosphere) activities
    • create new foreground activities 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 sensitivity analysis (Sobol indices)
  • Support for automatic check of homogeneity of physical units

⚙ Installation

We support both Brightway 2.4 (legacy) and Brightway 2.5 via two separate branches / libraries :

1) Setup separate environment

First create a python environment, with Python [>=3.10, <3.13] :

With Conda (or mamba)

conda create -n lca python==3.10
conda activate lca

With virtual env

python3.10 -m venv .venv
source .venv/bin/activate

2) Install lca_algebraic

pip install lca_algebraic

Or, for brightway 25 :

pip install lca_algebraic_bw25

3) [Optional] Install Jupyter & Activity Browser

You may also install Jupyter and Activity Browser on the same environment.

Jupyter :

pip install jupyter

Activity Browser can only be installed via conda/mamba. Note that it can also be installed on a separate Python env and will still be able to access and browse the projects created programmatically with lca_algebraic / Brightway.

conda install activity-browser

NOTE While the inventories created in lca_algebraic are stored in the Brightway project, the formulas and parameters are not compatible with Activity Browser Before computing impacts with vanilla Brightway2 or Activity Browser, you may use the function freezeParams() to update the amounts in your database for a given scenario / set of parameter values.

📚 Documentation & resources

Full documentation is hosted on readthedocs

We provide some notebooks :

  • Example notebook : Basic functionalities
  • Handbook : More examples, also showing the usage of the Brightway functions.
  • Workshop : A "real life" exercise used as a short training on lca_algebraic

📧 Mailing list

Please register to this dedicated mailing list to discuss the evolutions of this library and be informed of future releases :

lca_algebraic@groupes.mines-paristech.fr

© Licence & Copyright

This library has been developed by MinesParis - PSL - O.I.E team, for the project INCER-ACV, lead by ADEME.

It is distributed under the BSD License

Logo

Please use the following logo to advertise about this librairy.

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

lca_algebraic-1.4.tar.gz (63.5 kB view details)

Uploaded Source

Built Distribution

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

lca_algebraic-1.4-py3-none-any.whl (64.5 kB view details)

Uploaded Python 3

File details

Details for the file lca_algebraic-1.4.tar.gz.

File metadata

  • Download URL: lca_algebraic-1.4.tar.gz
  • Upload date:
  • Size: 63.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for lca_algebraic-1.4.tar.gz
Algorithm Hash digest
SHA256 ed8224f2c112056b0bdd7ea78e8737ac3e543e12e0aa13e790764c8ce674faf9
MD5 38c5fbe5ea3119957e9627c5b2713dff
BLAKE2b-256 ca2f6a3b3c33e0edaf13967c85628806be68be5820c1ee83a32149a2798ae876

See more details on using hashes here.

File details

Details for the file lca_algebraic-1.4-py3-none-any.whl.

File metadata

  • Download URL: lca_algebraic-1.4-py3-none-any.whl
  • Upload date:
  • Size: 64.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for lca_algebraic-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6f2a047b15fea9c9c088f3da245d3388244e48d125733d5f156daa170c258cf6
MD5 8f17c5ad27fd49ef9f6778cc04173acf
BLAKE2b-256 ee21b1904b6d1b878d5755ec8ce33d4bbf5ad46b051d898e5835cfce6939edf7

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