Skip to main content

Graph traversal class and utilities

Project description

bw_graph_tools

PyPI Status Python Version [License][license]

Read the documentation at https://bw_graph_tools.readthedocs.io/ Tests Codecov

pre-commit Black

Installation

You can install bw_graph_tools via [pip] from [PyPI]:

$ pip install bw_graph_tools

Packages are also on conda at the channel cmutel.

Usage

bw_graph_tools has three main components: A graph traversal class NewNodeEachVisitGraphTraversal; a function to guess production exchanges using only bw_processing datapackages guess_production_exchanges; and a function to find the path from node A to node B with the largest amount of the reference product of A, get_path_from_matrix and it's sister path_as_brightway_objects.

NewNodeEachVisitGraphTraversal

Normally we construct matrices and solve the resulting set of linear equations to get a life cycle inventory or impact assessment result. The matrix approach is elegant, in that it simultaneously solves all equations and handles cycles in the graph, and much faster than graph traversal. However, in some cases we want to actually traverse the supply chain graph and calculate the individual impact of visiting nodes at that point in the graph. Graph traversal's use cases include:

  • Distinguishing between different paths to the same object

  • Convolving temporal distributions

If we add temporal information using bw_temporalis, then the same node can occur at different times depending on how the temporal dynamics its preceding path. For example:

Contributing

Contributions are very welcome. To learn more, see the [Contributor Guide].

License

Distributed under the terms of the [BSD 3 Clause license][license], bw_graph_tools is free and open source software.

Issues

If you encounter any problems, please [file an issue] along with a detailed description.

Documentation

  1. Install the conda environment from the file .docs/environment.yml
  2. Build the documentation locally by running:
sphinx-autobuild docs _build/html -a -j auto --open-browser

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bw_graph_tools-0.5.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

bw_graph_tools-0.5-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file bw_graph_tools-0.5.tar.gz.

File metadata

  • Download URL: bw_graph_tools-0.5.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.14

File hashes

Hashes for bw_graph_tools-0.5.tar.gz
Algorithm Hash digest
SHA256 38c72f050168a968f25349a9c410c17f2135309cc506c51f5a16b0252b8c5f0a
MD5 851442cb5949e1c9f9fd37637b05f33a
BLAKE2b-256 c9f86bf5a2338a9f9c84573afece4c1ebf5271c4c3c20a155b23a242296550c2

See more details on using hashes here.

File details

Details for the file bw_graph_tools-0.5-py3-none-any.whl.

File metadata

  • Download URL: bw_graph_tools-0.5-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.14

File hashes

Hashes for bw_graph_tools-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f73f3c296be2be87ec3ce2792d63d614a8bb2da409e6a6d4c35fa580f20c4404
MD5 ed1cd1dcf91e3169b586e85acb9f42d6
BLAKE2b-256 87d4201a3b32b168cc0d6a7ccc6fd7777e9b3324f94a6984d9e6298a485a7502

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page