Jupyter and Pyodide integration#

Support for working with WebGPU from Jupyter notebooks and Pyodide.

Jupyter helpers#

webgpu.jupyter.Draw(
scene: Scene | list[Renderer] | Renderer,
width=640,
height=640,
)#

Draw a scene using display(Javascript()) with all information in the HTML This way, data is kept in the converted html when running nbconvert The scene object is unpickled and drawn within a pyodide instance in the browser when the html is opened

webgpu.jupyter.create_package_zip(module_name='webgpu')#

Creates a zip file containing all files in the specified Python package.

Pyodide integration#

webgpu.jupyter_pyodide.Draw(
scene: Scene | list[Renderer] | Renderer,
width=608,
height=608,
modules=[],
)#
webgpu.jupyter_pyodide.DrawCustom(
client_function,
kwargs={},
modules: list[str] = [],
files: list[str] = [],
width=608,
height=608,
)#
class webgpu.jupyter_pyodide.Pyodide#

Bases: object

webgpu.jupyter_pyodide.create_package_zip(module_name='webgpu')#

Creates a zip file containing all files in the specified Python package.

webgpu.jupyter_pyodide.get_render_canvas(canvas_id)#
webgpu.jupyter_pyodide.pyodide_and_kernel(line, cell)#
webgpu.jupyter_pyodide.pyodide_install_packages(packages)#
webgpu.jupyter_pyodide.redraw_canvas(canvas_id: str)#
webgpu.jupyter_pyodide.register_cell_magic(func)#
webgpu.jupyter_pyodide.run_code_in_pyodide(code: str)#
webgpu.jupyter_pyodide.update_render_object(id, **kwargs)#