Tutorial: Create Interactive Visualizations and Applications for Energy Models with pure Python

Proposal for
Tutorial
Session Title
Create Interactive Visualizations and Applications for Energy Models with pure Python (no javascript)
Session Description
Scientists increasingly use interactive visualizations and simple analytical web applications (dashboards) to support publications and discussions, e.g. public debates, informed panel discussions or decision theatres. They allow analysts or decision makers to easily present, share and explore visualizations of model input or output data from anywhere (no installation requirements). As such applications increase the accessibility of model results or input data, they are a further step towards better transparency.

Examples of simple analytical web applications that already support publications and discussions:
model.energy, pypsa-eur-30-animation, possibility-for-electricity-autarky-map, wind power potential, renewables.ninja, hotmaps, riskmeter, idea-dash, energy charts, kombikraftwerk-2-animation

This will be a tutorial on how to create simple applications with pure python - no javascript required - using plotly.express and dash. Plotly.express is to plotly.py what seaborn is to matplotlib. It is a new productive visualization package, part of plotly since version 4.0. It provides a high-level interface for complex graphs (Medium announcement article). Dash is a python framework for building web applications, built on top of flask, react.js and fully compatible with plotly.py. For simple applications, you can create a user interface around your python code in a few hours and then share the app with others.

Proposed structure of the tutorial:

  • What is plotly.express and dash?
  • Demo of plotly.express and dash for energy data exploration
  • Pros and cons of using dash for applications
  • Create your own application in 30 minutes

Preparation:
–Placeholder–
It is recommended to have a look at the plotly with python tutorial by Bryn Pickering in advance.

Follow-up action could be a do-a-thon (1) for the discussion of use-case specific requirements for apps/dashboards for energy system analysis/exploration or (2) for conceptualizing a wrapper around dash for an even more productive development of simple analytical web applications for energy system analysis.

Would you like to be responsible for this Session?
Yes (Lukas Nacken, Uni Kassel)
Do you need any special infrastructure for this Session?
Projector, BYOD (bring your own device), eduroam/wifi
Do you have any recommendations who could be part of this Session?
Everyone who is interested in creating simple web apps for analyzing energy model data with a few lines of pure python code.

5 Likes

hi lukas, thanks for this post, it sounds really interrsting. i’m a bit new to this forum; how can i join this workshop?

Hello @arjun   Let me jump in. This particular workshop is part of the upcoming Berlin 2020 workshop (note the term “workshop” is used in two contexts) with further details on the openmod wiki. Registrations have officially closed but you could try emailing the organizers at openmod(at)wip.tu‑berlin.de if you want to just attend one session (although I cannot speak for them). There was a program on the wiki but it’s been taken down, no doubt to be reworked. HTH.

Hello together,

thanks for jumping in @robbie.morrison.
I can add that I will also upload tutorial scripts to github and link them here.

Dear Robbie and Lukas - thank you very much!! Sadly I won’t be able to make arrangements to travel so soon, but would indeed grateful if you upload the material and very keen to join upcoming similar events. Hopefully see you at one of them. All the best for this event!

1 Like

Hello together,

please “git clone https://github.com/lukasnacken/openmod-berlin2020-plotly-and-dash” and install the requirements (“pip install -r requirements.txt” before the session.

Slides: https://docs.google.com/presentation/d/1RPWt2V5g1BsZxQdx9h_a6j5keLTmkkt8w5Ocl6z7Eik/edit?usp=sharing