Skip to main content

Pulpo package for optimization in LCI databases

Project description

Python-based User-defined Lifecycle Production Optimization

Jupyter Python Markdown

License Last Commit Commit Activity

PyPI - Version GitHub Stars launch - renku


📍 Overview

PULPO is a Python package for Life Cycle Optimization (LCO) based on life cycle inventories. It is designed to serve as a platform for optimization tasks of varying complexity.

The package builds on top of the Brightway LCA framework and the Pyomo optimization modeling framework.


✨ Capabilities

Applying optimization is recommended when the system of study has (1) many degrees of freedom that would otherwise prompt the manual assessment of a large number of scenarios, or (2) any of the following capabilities is relevant to the goal and scope of the study:

  • Specify technology and regional choices throughout the entire supply chain (fore- and background), such as the production technology of electricity or the origin of metal resources. Consistently accounting for background changes in large-scale decisions can be significant.
  • Specify constraints on any activity in the life cycle inventories, interpreted as tangible limitations such as raw material availability, production capacity, or environmental regulations.
  • Optimize for or constrain any impact category for which characterization factors are available.
  • Specify supply values instead of final demands, which is relevant when only production volumes are known (e.g. here).
  • Optimize under uncertainty via a dedicated pipeline: import and filter uncertain LCI parameters, apply uncertainty strategies, run Global Sensitivity Analysis (Sobol), perform Monte Carlo sampling, or solve Chance-Constrained programs to obtain Pareto-optimal solutions at user-defined probability levels.

Features recently completed:

  • [X] ℹ️ Optimization under uncertainty [chance-constraints, Monte Carlo, global sensitivity analysis]
  • [X] ℹ️ Development of a GUI for simple optimization tasks Link
  • [X] ℹ️ Enable PULPO to work on both bw2 and bw25 projects
  • [X] ℹ️ Thorough documentation hosted on flechtenberg.github.io/pulpo/

Features currently under development:

  • [ ] ℹ️ Multi-objective optimization [bi-objective epsilon constrained, goal programming ...]
  • [ ] ℹ️ Integration of economic and social indicators in the optimization problem formulation

Feature requests are more than welcome!


🔧 Installation

PULPO is available on PyPI. Depending on the version of Brightway you want to work with, install either the bw2 or bw25 variant:

pip install "pulpo-dev[bw2]"

or

pip install "pulpo-dev[bw25]"

🤖 Running PULPO

Use this link to start a cloud session and test PULPO right away:

launch - renku

The main reference is the PULPO showcase notebook, which revolves around methanol production and covers both the core optimization features (Sections 1–9) and the full advanced uncertainty workflow of the pulpo_unc module (Section 10): uncertainty data import and filtering, gap-filling strategies, Monte Carlo from prepared distributions, Chance-Constrained optimization, and Global Sensitivity Analysis.

Additional example notebooks are available for a hydrogen case, an electricity case, and a plastic case.

There is also a workshop repository (here) created for the Brightcon 2024 conference, with guided notebooks and exercises.

🧪 Tests

Run from the package folder:

python -m unittest discover -s tests

What's new in 1.5.0?

This release integrates the full uncertainty analysis pipeline into PULPO via the new pulpo.pulpo_unc module, turning the long-running development effort into a first-class feature:

  • PulpoOptimizerUnc — A subclass of PulpoOptimizer that exposes the entire uncertainty workflow through a single worker object.
  • Uncertainty data import and filtering — Import uncertain parameters directly from Brightway databases via import_and_filter_uncertainty_data(), with configurable cutoff-based filtering.
  • Uncertainty strategies — Fill missing or incomplete uncertainty specifications using apply_uncertainty_strategies(), with built-in strategies (e.g. triangular bound interpolation) and support for custom expert-knowledge distributions.
  • Monte Carlo from prepared distributions — Run MC on the curated uncertainty data (without re-sampling the full Brightway matrices) via run_mc_from_uncertainty().
  • Chance-Constrained (CC) optimization — Formulate and solve chance-constrained programs with create_CC_formulation() and solve_CC_problem(), yielding a Pareto front of optimal solutions at varying probability (risk) levels.
  • Global Sensitivity Analysis (GSA) — Identify the uncertain parameters that drive optimization outcomes using Sobol sensitivity indices via run_gsa().
  • End-to-end showcase — Section 10 of the PULPO showcase notebook walks through the complete pulpo_unc workflow on the methanol system.
  • Note: The uncertainty features in this release have been implemented and tested with Brightway bw2 only; users working with bw25 should validate workflows and may need to adapt configuration.
  • Minor bugfixes and code cleanup.

What's new in 1.4.3?

  • Allow users to pass lower inventory flow and lower impact limits via lower_inv_limit and lower_imp_limit dicts.
  • Provide new showcase notebook.
  • Enable users to pass custom default upper limits on elements, given that Gurobi identified 1e20 (and 1e24) as infinite in some cases. See section 8 of the showcase for usage. Setting them lower may also improve convergence speed.
  • Enable dependent constraint definition. See section 9 of the showcase for usage.

What's new in 1.4.2?

  • Enable the use of Gurobi solver.

What's new in 1.4.0?

  • Enable the use of NEOS solver (commercial solvers without a local license).
  • Enable Monte Carlo sampling feature.
  • Retrieve uncertainty information to lci_data for future use.

What's new in 1.3.0?

  • Switch packaging logic from setup.py to pyproject.toml and align PyPI with GitHub versioning.

🤝 Contributing

Contributions are very welcome. To request a feature or report a bug, please open an Issue. If you are confident in your coding skills, feel free to implement your suggestions and send a Pull Request.


📄 License

This project is licensed under the ℹ️ BSD 3-Clause License. See the LICENSE file for additional info.
Copyright (c) 2026, Fabian Lechtenberg. All rights reserved.


👏 Acknowledgments

We would like to express our gratitude to the authors and contributors of the following packages that PULPO builds upon:

We also acknowledge the pioneering ideas and contributions from the following works:

The development of PULPO culminated in the following publication, which details the approach and outlines its implementation:

Fabian Lechtenberg, Robert Istrate, Victor Tulus, Antonio Espuña, Moisès Graells, and Gonzalo Guillén‐Gosálbez.
“PULPO: A Framework for Efficient Integration of Life Cycle Inventory Models into Life Cycle Product Optimization.”
Journal of Industrial Ecology, October 10, 2024.
https://doi.org/10.1111/jiec.13561

Please cite this article if PULPO is used to produce results for a publication or project.


Authors


↑ Return

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

pulpo_dev-1.5.0.tar.gz (76.3 kB view details)

Uploaded Source

Built Distribution

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

pulpo_dev-1.5.0-py3-none-any.whl (78.2 kB view details)

Uploaded Python 3

File details

Details for the file pulpo_dev-1.5.0.tar.gz.

File metadata

  • Download URL: pulpo_dev-1.5.0.tar.gz
  • Upload date:
  • Size: 76.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for pulpo_dev-1.5.0.tar.gz
Algorithm Hash digest
SHA256 9c418f69ca7d4572e2579982c076884c4db5f734fb539c266dff7bc49139445d
MD5 38a28b63cab7fc3a4af2bfb7c61b3d9d
BLAKE2b-256 b04c3b2296dc3811e2de2698e8df21b8db296aaf99b8beccc8cd970ba3979156

See more details on using hashes here.

File details

Details for the file pulpo_dev-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: pulpo_dev-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 78.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for pulpo_dev-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec199bf8a7f13711d389a112e3e1b6d942ce95cbd7f69c461bcb71a6a9d6ee2c
MD5 a4ee84eda27b2de53e539eab2d124229
BLAKE2b-256 b94cb35359af448d69b53dcc9c67ccfd6d13de1012803ef6a77f99a0b261b844

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