Skip to content

Commit

Permalink
deploy: 7fbf42b
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 19, 2024
0 parents commit 92781d5
Show file tree
Hide file tree
Showing 26 changed files with 8,112 additions and 0 deletions.
Empty file added .nojekyll
Empty file.
641 changes: 641 additions & 0 deletions comm.html

Large diffs are not rendered by default.

605 changes: 605 additions & 0 deletions index.html

Large diffs are not rendered by default.

640 changes: 640 additions & 0 deletions ipywatch.html

Large diffs are not rendered by default.

635 changes: 635 additions & 0 deletions reacton.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sitemap: https://itepifanio.github.io/ipywatch/sitemap.xml
82 changes: 82 additions & 0 deletions search.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
[
{
"objectID": "ipywatch.html",
"href": "ipywatch.html",
"title": "Ipywatch",
"section": "",
"text": "Widget to watch comm events\n\nsource\n\nWidgetStateHistoryListener\n\n WidgetStateHistoryListener (history_size:int=5, on_state_change:Callable[\n [ipywidgets.widgets.widget.Widget,Any],NoneTy\n pe]=None)\n\nInitialize self. See help(type(self)) for accurate signature.\n/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/fastcore/docscrape.py:225: UserWarning: Unknown section Examples\n else: warn(msg)\n\nsource\n\n\nIpywatch\n\n Ipywatch (width:str='100%', height:str='400px', history_size:int=5,\n **kwargs)\n\nDisplays multiple widgets horizontally using the flexible box model.\n\nipywatch = Ipywatch(width='100%', height='200px')\nslider = ipywidgets.IntSlider(value=7, min=0, max=10, step=1, description='Test Slider:')\nHBox([slider, ipywatch])",
"crumbs": [
"Ipywatch"
]
},
{
"objectID": "comm.html",
"href": "comm.html",
"title": "Comm",
"section": "",
"text": "Ipykernel employs the Comm class for facilitating communication between the front-end and back-end. It builds on a base Comm implementation, which includes a send function for messaging the front-end. Monkey-patching this send function presents a direct approach to intercept Comm communications.\n_original_send = Comm.send\n\ndef _patched_send(self, data=None, metadata=None, buffers=None):\n widget = widgets.Widget.widgets.get(self.comm_id)\n widget_type = type(widget).__name__ if widget else \"Unknown\"\n print(f\"Comm message sent by {widget_type} ({self.comm_id}): {data}\")\n\n _original_send(self, data, metadata, buffers)\n\nComm.send = _patched_send",
"crumbs": [
"Comm"
]
},
{
"objectID": "comm.html#testing",
"href": "comm.html#testing",
"title": "Comm",
"section": "Testing",
"text": "Testing\nThe following cells displays ipywidgets and solara example of monitoring state changes. Interact with the following widgets to intercept its state changes.\n\nslider = widgets.IntSlider(value=7, min=0, max=10, step=1, description='Test Slider:')\ndisplay(slider)\n\n\nint_value = solara.reactive(42)\nsolara.SliderInt(\"Another Test Slider:\", value=int_value, min=-10, max=120)",
"crumbs": [
"Comm"
]
},
{
"objectID": "widget_history.html",
"href": "widget_history.html",
"title": "Widget history",
"section": "",
"text": "Store a fixed number of stored states in-memory\n\nsource\n\nWidgetStateHistory\n\n WidgetStateHistory (history_size:int=5)\n\nInitialize self. See help(type(self)) for accurate signature.\n\nwidget_states = WidgetStateHistory(history_size=5)\n\nwidget_states[\"widget_1\"] = {\"value\": 10}\nwidget_states[\"widget_1\"] = {\"value\": 20}\nassert len(widget_states) == 1\nassert widget_states['widget_1'] == {\"value\": 20}\n\ndel widget_states[\"widget_1\"] \nassert len(widget_states) == 0",
"crumbs": [
"Widget history"
]
},
{
"objectID": "index.html",
"href": "index.html",
"title": "Debugbar",
"section": "",
"text": "Welcome to the Debugbar project, a proof of concept (POC) aimed at exploring various strategies to develop a debugging tool for IPyWidgets, Reacton, and Solara components. This project serves as an investigative stage, focusing on identifying effective methods to debug and track the state and interactions within these frameworks.\nThe Debugbar project represents the first step towards a sophisticated debugging solution for developers working with IPyWidgets, Reacton, and Solara. By methodically exploring and refining the strategies outlined, we aim to enhance the development experience and enable more efficient debugging workflows for complex applications.",
"crumbs": [
"Debugbar"
]
},
{
"objectID": "index.html#strategies",
"href": "index.html#strategies",
"title": "Debugbar",
"section": "Strategies",
"text": "Strategies\nBelow are the strategies currently under exploration, each offering a unique angle to approach debugging within the Jupyter ecosystem and Reacton/Solara components.\n\nComm\n\nDescription: The Comm API, part of the Jupyter notebook’s infrastructure, facilitates communication between the front-end and back-end by sending JSON-able blobs. This API is used by widgets for maintaining state synchronization.\nApproach: By monkey-patching the comm.create_comm function, we can intercept and log all messages exchanged between widgets. This allows the Debugbar to track and modify states dynamically, providing a tool-agnostic method for debugging that doesn’t rely directly on the internal state management of Reacton.\n\n\n\nReacton\n\nDescription: Reacton’s RenderContext object plays a crucial role in state management, especially with its state_get method, which is pivotal during state restoration post-hot reloads (1, 2).\nApproach:\n\nState Tracking: Implementing tracking for the state_get call within RenderContext offers insight into state restoration processes.\nPre-Render Event: Introducing a pre_render event in Reacton could allow for state_get invocations before each rendering phase, enhancing visibility into state changes.\nIntegration with Chrome Tracing: Exploring the potential of Reacton’s tracer, previously developed by the Widgetti team, to generate trace data compatible with chrome://tracing for a detailed analysis of rendering and state management performance.",
"crumbs": [
"Debugbar"
]
},
{
"objectID": "reacton.html",
"href": "reacton.html",
"title": "Reacton",
"section": "",
"text": "Adding a pre_render hook to reacton codebase we’re able to track each state change at component level.\n_original_render = _RenderContext.render\n\ndef pre_render(self, element: Element, container: widgets.Widget = None):\n print(f'state::{self.state_get()}\\n')\n print(f'element: {element.component} --- {element.component.name}, {element.component.value_name}, {element.component.widget}\\n')\n if container is not None:\n print(f'model_id::{container.model_id}')\n\ndef _patched_render(self, element: Element, container: widgets.Widget = None):\n pre_render(self, element, container)\n \n _original_render(self, element, container)\n\n_RenderContext.render = _patched_render",
"crumbs": [
"Reacton"
]
},
{
"objectID": "reacton.html#testing",
"href": "reacton.html#testing",
"title": "Reacton",
"section": "Testing",
"text": "Testing\nThe following cells displays ipywidgets an solara example of monitoring state changes. Interact with the following widgets to intercept its state changes.\n\nint_value = solara.reactive(0)\nslider = solara.SliderInt(\"Another Test Slider:\", value=int_value, min=0, max=10)",
"crumbs": [
"Reacton"
]
}
]
Loading

0 comments on commit 92781d5

Please sign in to comment.