Code Monkey home page Code Monkey logo

sankertainpy's Introduction

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

sankertainpy's People

Contributors

haschneider avatar

Stargazers

Damien Ringeisen avatar

Watchers

 avatar

sankertainpy's Issues

Sankertainpy integration

Hi @HaSchneider ,

I'm using your code to build a visualization library for Brightway. I may have some issues with understanding parts of your code and I want to keep the conversation with you until I'm confident that your code is properly integrated in our library if you'll have the time for that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.