penzai.treescope

penzai.treescope#

Treescope: Penzai’s interactive HTML pretty-printer and array visualizer.

You can configure treescope as the default IPython pretty-printer using

pz.ts.register_as_default()

# Optional:
pz.ts.register_autovisualize_magic()
pz.enable_interactive_context()
pz.ts.active_autovisualizer.set_interactive(pz.ts.ArrayAutovisualizer())

You can also pretty-print individual values using pz.show or pz.ts.display. See also the pz.ts module for convenient access to the most commonly-used treescope functions and classes.

Submodules

penzai.treescope.arrayviz

Treescope's array visualizer.

penzai.treescope.autovisualize

User-configurable automatic visualization of subtrees.

penzai.treescope.canonical_aliases

Registry of certain "well-known" objects, such as module functions.

penzai.treescope.copypaste_fallback

Fallback definitions for copying non-roundtrippable objects.

penzai.treescope.default_renderer

Configures the default renderer, and allows reconfiguring it dynamically.

penzai.treescope.figures

Containers for conveniently rendering multiple objects together.

penzai.treescope.foldable_representation

Definition of components of Treescope's intermediate representation.

penzai.treescope.handlers

Treescope handlers for known objects.

penzai.treescope.html_compression

Helper function to compress HTML for saving and displaying.

penzai.treescope.html_escaping

Utilities for escaping HTML values.

penzai.treescope.ndarray_summarization

Utilities for summarizing ndarray data.

penzai.treescope.renderer

Renderer objects and handler definitions.

penzai.treescope.selection_rendering

Rendering logic for selections and selected objects in treescope.

penzai.treescope.treescope_ipython

Support for using treescope in IPython.