Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brightway-lca/bw_hestia_bridge
Consume the HESTIA API in Brightway
https://github.com/brightway-lca/bw_hestia_bridge
agriculture brightway hestia
Last synced: 4 days ago
JSON representation
Consume the HESTIA API in Brightway
- Host: GitHub
- URL: https://github.com/brightway-lca/bw_hestia_bridge
- Owner: brightway-lca
- License: mit
- Created: 2023-09-16T09:24:08.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-04T03:06:18.000Z (7 months ago)
- Last Synced: 2024-08-08T21:32:41.697Z (3 months ago)
- Topics: agriculture, brightway, hestia
- Language: Python
- Homepage: https://docs.brightway.dev/projects/hestiabridge/
- Size: 397 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Brightway-Hestia bridge
[![PyPI](https://img.shields.io/pypi/v/bw_hestia_bridge.svg)][pypi status]
[![Status](https://img.shields.io/pypi/status/bw_hestia_bridge.svg)][pypi status]
[![Python Version](https://img.shields.io/pypi/pyversions/bw_hestia_bridge)][pypi status]
[![License](https://img.shields.io/pypi/l/bw_hestia_bridge)][license][![Documentation Status](https://readthedocs.org/projects/bw-hestia-bridge/badge/?version=latest)][read the docs]
[![Tests](https://github.com/brightway-lca/bw_hestia_bridge/workflows/Tests/badge.svg)][tests]
[![Codecov](https://codecov.io/gh/brightway-lca/bw_hestia_bridge/branch/main/graph/badge.svg)][codecov][![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit]
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black][pypi status]: https://pypi.org/project/bw_hestia_bridge/
[read the docs]: https://docs.brightway.dev/projects/hestiabridge
[tests]: https://github.com/brightway-lca/bw_hestia_bridge/actions?workflow=Tests
[codecov]: https://app.codecov.io/gh/brightway-lca/bw_hestia_bridge
[pre-commit]: https://github.com/pre-commit/pre-commit
[black]: https://github.com/psf/black``bw_hestia_bridge`` is a library to interact with [Hestia] and create [brightway] databases from its data.
[Hestia]: https://hestia.earth
[brightway]: https://brightway.dev## Installation
You can install ``bw_hestia_bridge`` via [pip] from [PyPI]:
```console
$ pip install bw_hestia_bridge
```[pip]: https://pypi.org/project/pip
[PyPi]: https://pypi.org/project/bw-hestia-bridge## Mapping `Hestia` cycles to the Brightway mental model
Hestia is not a linked network of unit processes, but detailed data on specific production systems. As they are agricultural, almost all of these systems have multiple outputs, and many of these outputs require further treatment. For example, in the [pig system](https://www-staging.hestia.earth/cycle/5-qkgrlriqqm?dataState=recalculated), there are three types of excreta produced, which go to deep bedding, which go to composting. Hestia doesn't seem to have a waste treatment for the final processed excreta.
Because these follow-on activities (Hestia calls them [Transformations](https://www-staging.hestia.earth/schema/Transformation)) are multi-input *and* multi-output, and because there is no guarantee that the respective ratios of these outputs align with the next stage inputs, we will do the following:
For each `transformation`, we create a new unit process. The *reference product* of this process will be the output with the highest mass.
For the other outputs, we will create proxy treatment activities. These proxies will handle any potential stoichiometric disparities.
If a `transformation` is a leaf node, i.e. it has inputs but no consumers for each outputs, we will create proxy consumers for each output other than the reference product.
We then go back to the original unit process, and add proxy consumers for each output which is not the reference product (i.e. marked `"primary": true`) or the reference product of a waste treatment.
## Contributing
Contributions are very welcome.
To learn more, see the [Contributor Guide].## License
Distributed under the terms of the [MIT license][license],
_bw_hestia_bridge_ is free and open source software.## Issues
If you encounter any problems,
please [file an issue] along with a detailed description.[license]: https://github.com/brightway-lca/bw_hestia_bridge/blob/main/LICENSE
[command-line reference]: https://bw_hestia_bridge.readthedocs.io/en/latest/usage.html
[contributor guide]: https://github.com/brightway-lca/bw_hestia_bridge/blob/main/CONTRIBUTING.md## Documentation
1. Install the conda environment from the file `.docs/environment.yml`
2. Build the documentation locally by running:```bash
sphinx-autobuild docs _build/html -a -j auto --open-browser
```