skip to main content

@tonyfast s notebooks

site navigation
notebook summary
title
cleaner integration of pidgy & voila
description
pidgy works great with widgets, so it should rock with voila. the default display for pidgy does NOT use widgets by default, the author would have to opt into widgets in development. however, if we detect that voila is driving our notebook then we should use the pidgy.displays.IPyWidgetsHtml display.
cells
7 total
4 code
state
executed in order
kernel
Python [conda env:root] *
language
python
name
conda-root-py
lines of code
19
outputs
5
table of contents
{"kernelspec": {"display_name": "Python [conda env:root] *", "language": "python", "name": "conda-root-py"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13"}, "widgets": {"application/vnd.jupyter.widget-state+json": {"state": {"71a814a3ccf14578bf9f988b9a194bf0": {"model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "IntSliderModel", "state": {"behavior": "drag-tap", "description": "cookies", "layout": "IPY_MODEL_bd5ea24fcfbf4ff8bf25ccf5d94a4a5c", "style": "IPY_MODEL_e8fa9d41856d496d8a3f8178c2129e1e", "value": 3}}, "bd5ea24fcfbf4ff8bf25ccf5d94a4a5c": {"model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {}}, "e8fa9d41856d496d8a3f8178c2129e1e": {"model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "SliderStyleModel", "state": {"description_width": ""}}}, "version_major": 2, "version_minor": 0}}, "title": "cleaner integration of pidgy & voila", "description": "pidgy works great with widgets, so it should rock with voila.\nthe default display for pidgy does NOT use widgets by default, the author would have to opt into widgets in development.\nhowever, if we detect that voila is driving our notebook then we should use the pidgy.displays.IPyWidgetsHtml display."}
notebook toolbar
Activate
cell ordering
1

cleaner integration of &

pidgy works great with widgets, so it should rock with voila . the default display for pidgy does NOT use widgets by default, the author would have to opt into widgets in development. however, if we detect that voila is driving our notebook then we should use the pidgy.displays.IPyWidgetsHtml display.

image.png

2
  • activate pidgy
3 1 outputs.
%reload_ext pidgy
4 1 outputs.

the cookies demo

the cookies demo is inspired by the original tanglejs .

5
  • run the demo
6 2 outputs.

when you eat 3 cookies you consume 225 calories.


7 1 outputs.

state information

the display class in this verison is <class 'pidgy.displays.IPythonMarkdown'> because voila is not running.