Skip to content

HaSchneider/sankertainpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sankertainpy

Visualize uncertainty with sankey diagrams.

This is a python package written for the depart de sentier Sustainability assessment visualization contest to visualize brightway2 Monte Carlo LCA results with plotly sankey diagrams. sankertainpy is using an adjusted version of the bw2analyzer function "recursive_calculation_to_object()" to generate the plotly compatible graph traversal LCA data. With the function generate_sankey(), direct emission impact can be calculated, flows smaller than the cutoff value are bundled to single nodes, and the uncertainty visualisation is generated. It is tested with brightway2 and ecoinvent 3.8 cut-off.

example_image

Getting started:

Clone the repository and start:

import bw2data as bd
from bw_to_plotly import recursive_calculation_to_plotly
import sankertainpy as sc

activity= bd.Database('database name').random()
method= bd.methods.random()

result = recursive_calculation_to_plotly(activity,method)

fig= sp.generate_sankey(result, type=1)

fig.show()

Note: depending on the number of monte carlo iterations and the level depth, the calculation can take some time!

Background:

Inspired by the paper "Visualization approaches for understanding uncertainty in flow diagrams" from Vosough et al (2019): https://doi.org/10.1016/j.cola.2019.03.002

About

Visualize uncertainty with plotly sankey diagrams.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published