Project: Implement a ValuePlayer widget
Goal: make it easier to instrument code for tracing data evolution over the execution of an algorithm, with rich visualization Participants: @erwan.cornic, @nicolas.hainak
In practice: implement a class ValuePlayerWidget
enabling the following scenario:
# The user constructs a value widget for visualizing the core data of the algorithm
visualization = ...
# Updating the visualization is achieved by assigning to its value:
visualization.value = data
# The user wraps the visualization as a player:
player = ValuePlayerWidget(visualization)
# The user instruments the code:
def mon_algo(...):
for ...
...
player.value = data
...
# The user runs the algorithm:
mon_algo(...)
# The user displays the player (with the usual play/forward/backward/... UI), and explores the history of the data:
player
# Whenever the player needs to update the visualization, it sets the visualization's `value` attribute.
Status: laby-jupyter contains a basic implementation in C++
Steps:
-
Proof of concept implementation for Python. It could use ipywidget's Player widget. -
Put the implementation in a Python file value_player_widget.py
that others can reuse -
Devise a very simple example for the above scenario -
Write a demo Jupyter notebook value_player_widget_demo.ipynb
-
Create a standalone repository for this project -
Distribute as a simple pip package -
Proof of concept implementation for C++ (extracting it from laby-jupyter; and generalizing it if needed) -
Distribute them, either in ipywidget, or as separate pip-installable package -
Update laby-jupyter to use it -
Multilanguage support with a JavaScript frontend and bindings/backends for several languages? -
player = ValuePlayerWidget(visualization)
-
Optional argument to the constructor to initialize the history from a list of values. -
Group together the two sliders; in a Flow Layout? -
Use a Layout instead of a VBox to join together the view and the controls -
player.value = ...
au lieu deplayer.set_value(...)
? Does it makes sense? -
Alternative syntax for the common (?) use case of grabbing all local variables.
Modification effectuée par Nicolas M. Thiéry