Skip to main content

MOCA - Uncertainty Quantification for Life Cycle Assessment

PyPI version DOI License GitHub Repo

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.4

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.4
File Size Uploaded
moca_uncertainty_lca-1.0.4.tar.gz 16.3 kB Details

Built distribution (wheel)

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

Total release size: 30.4 kB

Release files / moca_uncertainty_lca-1.0.4.tar.gz

Download URL moca_uncertainty_lca-1.0.4.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cda751b7db1ad9e2a1c527cc7035cdce04a819bf86e19f6418d937c146bf661f
BLAKE2b-256 checksum
How to use checksums
65f6d62cf61b5bf88db7ea138a84daec313f6ede78960b4277b2cb852e4a8ee0
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.4-py3-none-any.whl

Download URL moca_uncertainty_lca-1.0.4-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6840b3d0a6bc135fb0130b46a5cf3daae5f7455acd97f1f5d72176aa4cd861e
BLAKE2b-256 checksum
How to use checksums
2c3dad4e24ae3c1f44d055edc45ea7800f94d4c78c13af7f02ee5525371a7583
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

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

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