Skip to main content

MOCA - Uncertainty Quantification for Life Cycle Assessment

PyPI version DOI License

MOCA is a Python package to perform efficient and parallelised uncertainty quantification for Life Cycle Assessment (LCA). It is built to work with the Brightway2 framework. Currently, MOCA includes a class for high-speed Monte Carlo Simulation. More methodologies for uncertainty quantification are planned to be implemented going forward.

This package has been developed by the German Aerospace Center (DLR e.V.), at the Institute of Maintenance, Repair and Overhaul.

Installation

Simply install this package via pip using:

pip install moca-uncertainty-lca

How to use

You can find a very simple usage example below. For more information regarding customisation options and how MOCA could be integrated into your existing code framework, please feel free to visit our documentation.

import moca_uncertainty_lca as moca
import brightway2 as bw

# setting up Brightway
bw.projects.set_current("your project")

# specify the LCIA method / characterisation model
method = ('EF v3.1','climate change','global warming potential (GWP100)')

# build the demand dictionary for the Monte Carlo LCA
demand = {bw.Database("your_database").get("your_code"): 1}

# initialize and execute the Monte Carlo LCA
mc_lca = moca.MonteCarloLCA(demand, method)
mc_lca.execute_monte_carlo(iterations=100)

# retrieve the results and write them to files
mc_results = mc_lca.mc_results
mc_lca.results_to_json()
mc_lca.stats_to_json()

Documentation

Find more detailed documentation here!

Why use MOCA rather than built-in Brightway2 options?

There are two main reasons:

  1. MOCA is faster! Depending on the complexity and size of your calculation setup, the speed-up can range from twice as fast to more than 40 times as fast.

  2. MOCA is easy to use and comes with built-in functions to make your life easier, such as automatic formatting and exporting.

License

MOCA is licensed with the BSD 3-Clause. For more information, see here.

Contributing

Contributions are very welcome! If you’d like to help, here’s how you can get started:

  • Report bugs or request features: Open an issue and describe the problem or idea as clearly as possible (what you expected, what happened, steps to reproduce, versions, etc.)
  • Improve the code or documentation
    1. Open an issue or find one that you want to work on
    2. Fork the repository, create a feature branch, and write your code
    3. Ideally: Add tests for new features
    4. Format code with Black
    5. Create a pull request and reference any related issues
  • Discussion and questions: If you’re not sure whether your idea fits the project, feel free to open an issue and ask before you start coding

Support

Please feel free to create an issue on Github or to contact Maria Höller (maria.hoeller@dlr.de) for support.

Metadata

Release files for moca-uncertainty-lca 1.0.2

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

Source distribution (sdist)

Source distribution for moca-uncertainty-lca 1.0.2
File Size Uploaded
moca_uncertainty_lca-1.0.2.tar.gz 16.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for moca-uncertainty-lca 1.0.2
File Interpreter ABI Platform
moca_uncertainty_lca-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 30.2 kB

Release files / moca_uncertainty_lca-1.0.2.tar.gz

Download URL moca_uncertainty_lca-1.0.2.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
19f939fcf4354e65cb159ced6931cc8edad36f938facd420833824f2b9cacffd
BLAKE2b-256 checksum
How to use checksums
9abd11b23a01a7ec1d40a614adb640a0cf7886b86015eb7abf97e38dbb875d74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release files / moca_uncertainty_lca-1.0.2-py3-none-any.whl

Download URL moca_uncertainty_lca-1.0.2-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
801e2b339ec08668bfef3dda515581aac8b76bc10f671033a362d2184442084a
BLAKE2b-256 checksum
How to use checksums
0546e4d9695b2c5ad165532e492c76d78d077ae6c4a5a1fa347078c2731d9138
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release history Release notifications | RSS feed

1.0.4

2 release files

1.0.3

2 release files

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

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