lca-algebraic-dev


Namelca-algebraic-dev JSON
Version 1.0.5.1681181.dev0 PyPI version JSON
download
home_pagehttps://github.com/oie-mines-paristech/lca_algebraic/
SummaryThis library provides a layer above brightway2 for defining parametric models and running super fast LCA for monte carlo analysis.
upload_time2024-03-13 10:41:42
maintainer
docs_urlNone
authorOIE - Mines ParisTech
requires_python
licenseBSD
keywords lca brightway2 monte-carlo parametric
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Introduction

This library is a small layer above [**brightway2**](https://brightway.dev/), 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](https://github.com/oie-mines-paristech/lca_algebraic/releases/download/1.0.0/incer-acv-model-installer.exe). It will setup a full anaconda environment with **Jupyter**, 
**Brightway2** and **LCA Algebraic**.

# Usage & documentation 

Please refer to the [sample notebook (Markdown)](./example-notebook.md) [(or here as ipynb)](./example-notebook.ipynb). 

The full API is [documented here](https://oie-mines-paristech.github.io/lca_algebraic/doc/).

# Licence & Copyright

This library has been developed by [OIE - MinesParistech](http://www.oie.mines-paristech.fr), for the project *INCER-ACV*, 
lead by [ADEME](https://www.ademe.fr/). 

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](https://www.sympy.org/en/index.html).

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.

![](https://oie-mines-paristech.github.io/lca_algebraic/doc/lca-algebraic.png)

# 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](https://2.docs.brightway.dev/intro.html#parameterized-datasets) for computing LCAs, even if much more slower than the method explain here.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/oie-mines-paristech/lca_algebraic/",
    "name": "lca-algebraic-dev",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "LCA brightway2 monte-carlo parametric",
    "author": "OIE - Mines ParisTech",
    "author_email": "raphael.jolivet@mines-paristech.fr",
    "download_url": "https://files.pythonhosted.org/packages/d0/62/2caa7ae9b5702181b5777b7c3cd995d30d5b060b6dd280b3f9814e64b0af/lca_algebraic_dev-1.0.5.1681181.dev0.tar.gz",
    "platform": null,
    "description": "# Introduction\n\nThis library is a small layer above [**brightway2**](https://brightway.dev/), designed for the definition of **parametric inventories** \nwith fast computation of LCA impacts, suitable for **monte-carlo** analyis.\n\n**lca-algebraic** provides a set of  **helper functions** for : \n* **compact** & **human readable** definition of activites :  \n    * search background (tech and biosphere) activities \n    * create new foreground activites with parametrized amounts\n    * parametrize / update existing background activities (extending the class **Activity**)\n* Definition of parameters\n* Fast computation of LCAs\n* Computation of monte carlo method and global sensivity analysis (Sobol indices) \n\n# Installation \n\nIf you already have Anaconda & Jupyter installed, you can install the library with either **pip** or **conda** :\n\n## Conda\n\n> conda install -c oie-minesparistech lca_algebraic\n\n## PIP\n\n> pip install lca_algebraic\n\n## Pre-packaged installer for Windows\n\nAlternatively, you can download and execute [this installer](https://github.com/oie-mines-paristech/lca_algebraic/releases/download/1.0.0/incer-acv-model-installer.exe). It will setup a full anaconda environment with **Jupyter**, \n**Brightway2** and **LCA Algebraic**.\n\n# Usage & documentation \n\nPlease refer to the [sample notebook (Markdown)](./example-notebook.md) [(or here as ipynb)](./example-notebook.ipynb). \n\nThe full API is [documented here](https://oie-mines-paristech.github.io/lca_algebraic/doc/).\n\n# Licence & Copyright\n\nThis library has been developed by [OIE - MinesParistech](http://www.oie.mines-paristech.fr), for the project *INCER-ACV*, \nlead by [ADEME](https://www.ademe.fr/). \n\nIt is distributed under the **BSD licence**.\n\n  \n# Principles \n\nThe 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**). \n\nThis enables **fast computation of LCA impacts**. \nWe leverage the **power of symbolic calculus** provided by the great libary [SymPy](https://www.sympy.org/en/index.html).\n\nWe define our model in a **separate DB**, as a nested combination of : \n* other foreground activities\n* background activities :\n    * Technical, refering **ecoinvent DB**\n    * Biopshere, refering **brightway2** biosphere activities\n    \nThe **amounts** in exchanges are expressed either as **static amounts**, or **symbolic expressions** of pre-defined **parameters**.\n\nEach activity of our **root model** is defined as a **parametrized combination** of the **foreground activities**, which can themselves be expressed by the **background activities**.\n\nWhen 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**.\n\nBy providing **large vectors** of **parameter values** to those numpy functions, we can compute LCA for **thousands of values** at a time.\n\n![](https://oie-mines-paristech.github.io/lca_algebraic/doc/lca-algebraic.png)\n\n# Compatibility with brightway2 \n\nUnder the hood, the activities we define with **lca-algebraic** are standard **brightway2** activities. \nThe amounts of exchanges are stored as **float values** or **serialized as string** in the property **formula**.\n\nParameters are also stored in the **brightay2** projets, making it fully compatible with **brightway**.\n\nThus, a model defined with **lca-algebraic** is stored as a regular **bw2** projet. We can use **bw2** native support for [parametrized dataset](https://2.docs.brightway.dev/intro.html#parameterized-datasets) for computing LCAs, even if much more slower than the method explain here.\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "This library provides a layer above brightway2 for defining parametric models and running super fast LCA for monte carlo analysis.",
    "version": "1.0.5.1681181.dev0",
    "project_urls": {
        "Homepage": "https://github.com/oie-mines-paristech/lca_algebraic/"
    },
    "split_keywords": [
        "lca",
        "brightway2",
        "monte-carlo",
        "parametric"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5d79fc8f0a52f7c3dba9479f7a1536f8932e15fcdaad7eb29b73f9c83d121d86",
                "md5": "c851ff0ca06f9b886940a62eb2c0f586",
                "sha256": "bc3c8cb2e5d99f7d3b6cdf16793792d5b58e950efde7b1b32f90d721aaaad9a9"
            },
            "downloads": -1,
            "filename": "lca_algebraic_dev-1.0.5.1681181.dev0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c851ff0ca06f9b886940a62eb2c0f586",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 56337,
            "upload_time": "2024-03-13T10:41:40",
            "upload_time_iso_8601": "2024-03-13T10:41:40.140437Z",
            "url": "https://files.pythonhosted.org/packages/5d/79/fc8f0a52f7c3dba9479f7a1536f8932e15fcdaad7eb29b73f9c83d121d86/lca_algebraic_dev-1.0.5.1681181.dev0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d0622caa7ae9b5702181b5777b7c3cd995d30d5b060b6dd280b3f9814e64b0af",
                "md5": "72d5137edc99a237b20259b5b6d1425e",
                "sha256": "192a388cbf899e58d3a4688504a4a0454da486381f957ae17615407e03d19613"
            },
            "downloads": -1,
            "filename": "lca_algebraic_dev-1.0.5.1681181.dev0.tar.gz",
            "has_sig": false,
            "md5_digest": "72d5137edc99a237b20259b5b6d1425e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 845284,
            "upload_time": "2024-03-13T10:41:42",
            "upload_time_iso_8601": "2024-03-13T10:41:42.228525Z",
            "url": "https://files.pythonhosted.org/packages/d0/62/2caa7ae9b5702181b5777b7c3cd995d30d5b060b6dd280b3f9814e64b0af/lca_algebraic_dev-1.0.5.1681181.dev0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-13 10:41:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "oie-mines-paristech",
    "github_project": "lca_algebraic",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "lca-algebraic-dev"
}
        
Elapsed time: 0.21075s