Name | bw-interface-schemas JSON |
Version |
0.2
JSON |
| download |
home_page | None |
Summary | Interface schemas for data transfer in Brightway |
upload_time | 2024-12-07 10:16:32 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# bw_interface_schemas
[![PyPI](https://img.shields.io/pypi/v/bw_interface_schemas.svg)][pypi status]
[![Status](https://img.shields.io/pypi/status/bw_interface_schemas.svg)][pypi status]
[![Python Version](https://img.shields.io/pypi/pyversions/bw_interface_schemas)][pypi status]
[![License](https://img.shields.io/pypi/l/bw_interface_schemas)][license]
## About
`bw_interface_schemas` defines a set of [pydantic](https://docs.pydantic.dev/2.0/) classes which will be the fundamental data schema for Brightway Cloud, the next iteration of the Brightway LCA software ecosystem. These schemas provide clear and consistent graph-based interfaces between Brightway software libraries, and simplify and harmonize the way data was modeled and stored in Brightway.
We have chosen to model all data in a graph, as a list of nodes and edges. This includes inventory data, which models how processes consume and produce products to form supply chains. It also includes impact assessment, where elementary flows are linked to impact categories via characterization edges, and data organization. Now both projects and databases are also in the graph, and process and product nodes are linked to databases via `belongs_to` relationship edges.
## Example
Here is our standard bicycle production example in the new paradigm:
<img src="example.png">
You can see two ways of building this graph in code in `tests/conftest.py`.
## Comparison with Brightway2
These new interfaces break backwards compatibility. We do not take such steps lightly; these changes were necessary to include database, projects, and methods in the same data store as other nodes and edges, and to add sanity checks and simpler code paths to building correct supply chain models.
Our approach has the following advantages:
* Edge `source` and `target` attributes now correctly indicate direction. Previously production edges had the product being produced as an input. Similarly, elementary flows being emitted were still modeled as inputs.
* Removal of implicit production edges. These seemed like a convenience but ultimately led to many hacks and difficult to diagnose incorrect behaviour for users.
* Removal of edge `type` labels which were at best confusing and sometimes incorrect. Edges now have a small set of possible types which only indicates the matrix they can be used in, and explicit instead of implicit direction.
* Clear separation of processes and products. Processes can only consume and produce products, and vice-versa. The previous allowance of chimaera processes which acted as products made modelling of multifunctional processes difficult and error-prone.
* The single graph format with LCI and LCIA nodes can sensibly model impact assessment data. Previously impact assessment data had to pretend to be inventory databases in `bw2io`.
* A unified data format which is identical in Python and JSON. This makes serialization, database storage, and exchange across systems and languages much easier.
* Pydantic validation provides usable feedback and prevents data errors entering the database.
## Installation
You can install _bw_interface_schemas_ via [pip] from [PyPI]:
```console
$ pip install bw_interface_schemas
```
## Contributing
Contributions are very welcome.
To learn more, see the [Contributor Guide][Contributor Guide].
## License
Distributed under the terms of the [MIT license][License],
_bw_interface_schemas_ is free and open source software.
## Issues
If you encounter any problems,
please [file an issue][Issue Tracker] along with a detailed description.
<!-- github-only -->
[command-line reference]: https://bw_interface_schemas.readthedocs.io/en/latest/usage.html
[License]: https://github.com/brightway-lca/bw_interface_schemas/blob/main/LICENSE
[Contributor Guide]: https://github.com/brightway-lca/bw_interface_schemas/blob/main/CONTRIBUTING.md
[Issue Tracker]: https://github.com/brightway-lca/bw_interface_schemas/issues
Raw data
{
"_id": null,
"home_page": null,
"name": "bw-interface-schemas",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "Chris Mutel <cmutel@gmail.com>",
"keywords": null,
"author": null,
"author_email": "Chris Mutel <cmutel@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/ef/3c/aac4fb91eadc23cc9b3215ba0f4fc0e5be69b245491943207c6b52318fb0/bw_interface_schemas-0.2.tar.gz",
"platform": null,
"description": "# bw_interface_schemas\n\n[![PyPI](https://img.shields.io/pypi/v/bw_interface_schemas.svg)][pypi status]\n[![Status](https://img.shields.io/pypi/status/bw_interface_schemas.svg)][pypi status]\n[![Python Version](https://img.shields.io/pypi/pyversions/bw_interface_schemas)][pypi status]\n[![License](https://img.shields.io/pypi/l/bw_interface_schemas)][license]\n\n## About\n\n`bw_interface_schemas` defines a set of [pydantic](https://docs.pydantic.dev/2.0/) classes which will be the fundamental data schema for Brightway Cloud, the next iteration of the Brightway LCA software ecosystem. These schemas provide clear and consistent graph-based interfaces between Brightway software libraries, and simplify and harmonize the way data was modeled and stored in Brightway.\n\nWe have chosen to model all data in a graph, as a list of nodes and edges. This includes inventory data, which models how processes consume and produce products to form supply chains. It also includes impact assessment, where elementary flows are linked to impact categories via characterization edges, and data organization. Now both projects and databases are also in the graph, and process and product nodes are linked to databases via `belongs_to` relationship edges.\n\n## Example\n\nHere is our standard bicycle production example in the new paradigm:\n\n<img src=\"example.png\">\n\nYou can see two ways of building this graph in code in `tests/conftest.py`.\n\n## Comparison with Brightway2\n\nThese new interfaces break backwards compatibility. We do not take such steps lightly; these changes were necessary to include database, projects, and methods in the same data store as other nodes and edges, and to add sanity checks and simpler code paths to building correct supply chain models.\n\nOur approach has the following advantages:\n\n* Edge `source` and `target` attributes now correctly indicate direction. Previously production edges had the product being produced as an input. Similarly, elementary flows being emitted were still modeled as inputs.\n* Removal of implicit production edges. These seemed like a convenience but ultimately led to many hacks and difficult to diagnose incorrect behaviour for users.\n* Removal of edge `type` labels which were at best confusing and sometimes incorrect. Edges now have a small set of possible types which only indicates the matrix they can be used in, and explicit instead of implicit direction.\n* Clear separation of processes and products. Processes can only consume and produce products, and vice-versa. The previous allowance of chimaera processes which acted as products made modelling of multifunctional processes difficult and error-prone.\n* The single graph format with LCI and LCIA nodes can sensibly model impact assessment data. Previously impact assessment data had to pretend to be inventory databases in `bw2io`.\n* A unified data format which is identical in Python and JSON. This makes serialization, database storage, and exchange across systems and languages much easier.\n* Pydantic validation provides usable feedback and prevents data errors entering the database.\n\n## Installation\n\nYou can install _bw_interface_schemas_ via [pip] from [PyPI]:\n\n```console\n$ pip install bw_interface_schemas\n```\n\n## Contributing\n\nContributions are very welcome.\nTo learn more, see the [Contributor Guide][Contributor Guide].\n\n## License\n\nDistributed under the terms of the [MIT license][License],\n_bw_interface_schemas_ is free and open source software.\n\n## Issues\n\nIf you encounter any problems,\nplease [file an issue][Issue Tracker] along with a detailed description.\n\n\n<!-- github-only -->\n\n[command-line reference]: https://bw_interface_schemas.readthedocs.io/en/latest/usage.html\n[License]: https://github.com/brightway-lca/bw_interface_schemas/blob/main/LICENSE\n[Contributor Guide]: https://github.com/brightway-lca/bw_interface_schemas/blob/main/CONTRIBUTING.md\n[Issue Tracker]: https://github.com/brightway-lca/bw_interface_schemas/issues\n",
"bugtrack_url": null,
"license": null,
"summary": "Interface schemas for data transfer in Brightway",
"version": "0.2",
"project_urls": {
"homepage": "https://github.com/brightway-lca/bw_interface_schemas",
"source": "https://github.com/brightway-lca/bw_interface_schemas",
"tracker": "https://github.com/brightway-lca/bw_interface_schemas/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3570d4813835993643e78005c2e6a0aa1dc1b8056e37fd1c159e95ee1b22288b",
"md5": "1cf9f06bf5ea3b9a3e45e0dc7d8093b6",
"sha256": "0722606137b7e3089545c39ada3c43309812153454766c9d5e29ac08dfa21ce8"
},
"downloads": -1,
"filename": "bw_interface_schemas-0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1cf9f06bf5ea3b9a3e45e0dc7d8093b6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 26251,
"upload_time": "2024-12-07T10:16:30",
"upload_time_iso_8601": "2024-12-07T10:16:30.448149Z",
"url": "https://files.pythonhosted.org/packages/35/70/d4813835993643e78005c2e6a0aa1dc1b8056e37fd1c159e95ee1b22288b/bw_interface_schemas-0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ef3caac4fb91eadc23cc9b3215ba0f4fc0e5be69b245491943207c6b52318fb0",
"md5": "9f0ce57234af3442ace7e247f1206598",
"sha256": "50b8368cd5cae6e82b5596557bc22763d492d42bbdd63ed0e8252174d2efa5cd"
},
"downloads": -1,
"filename": "bw_interface_schemas-0.2.tar.gz",
"has_sig": false,
"md5_digest": "9f0ce57234af3442ace7e247f1206598",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 14463,
"upload_time": "2024-12-07T10:16:32",
"upload_time_iso_8601": "2024-12-07T10:16:32.261122Z",
"url": "https://files.pythonhosted.org/packages/ef/3c/aac4fb91eadc23cc9b3215ba0f4fc0e5be69b245491943207c6b52318fb0/bw_interface_schemas-0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-07 10:16:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "brightway-lca",
"github_project": "bw_interface_schemas",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "bw-interface-schemas"
}