MOCA - Uncertainty Quantification for Life Cycle Assessment
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:
-
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.
-
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
- Open an issue or find one that you want to work on
- Fork the repository, create a feature branch, and write your code
- Ideally: Add tests for new features
- Format code with Black
- 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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| moca_uncertainty_lca-1.0.4.tar.gz | 16.3 kB | Without provenance | Details for moca_uncertainty_lca-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| moca_uncertainty_lca-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for moca_uncertainty_lca-1.0.4-py3-none-any.whl |
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
|
Security for moca-uncertainty-lca 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.