pz.ts: Treescope alias namespace#

Using Treescope in IPython Notebooks#

pz.ts.register_as_default([...])

Alias of penzai.treescope.treescope_ipython.register_as_default: Registers treescope as the default IPython renderer.

pz.ts.register_autovisualize_magic()

Alias of penzai.treescope.treescope_ipython.register_autovisualize_magic: Registers the %%autovisualize magic.

pz.ts.register_context_manager_magic()

Alias of penzai.treescope.treescope_ipython.register_context_manager_magic: Registers the %%with magic.

Showing Objects Explicitly#

pz.ts.render_array(array, *[, columns, ...])

Alias of penzai.treescope.arrayviz.arrayviz.render_array: Renders an array (positional or named) to a displayable HTML object.

pz.ts.render_array_sharding(array[, rows, ...])

Alias of penzai.treescope.arrayviz.arrayviz.render_array_sharding: Renders the sharding of an array.

pz.ts.render_sharded_shape(sharding, ...[, ...])

Alias of penzai.treescope.arrayviz.arrayviz.render_sharded_shape: Renders the sharding an array would have, based on its shape.

pz.ts.integer_digitbox(value[, label_top, ...])

Alias of penzai.treescope.arrayviz.arrayviz.integer_digitbox: Returns a "digitbox" rendering of a single integer.

pz.ts.text_on_color(text, value[, vmax, ...])

Alias of penzai.treescope.arrayviz.arrayviz.text_on_color: Renders some text on colored background, similar to arrayviz coloring.

pz.ts.display(value[, ignore_exceptions, ...])

Alias of penzai.treescope.treescope_ipython.display: Displays a value as an interactively foldable object.

pz.show(*args[, wrap, space_separated])

Alias of penzai.treescope.treescope_ipython.show: Shows a list of objects inline, like python print, but with rich display.

Styling Displayed Objects#

pz.ts.inline(*parts[, wrap])

Alias of penzai.treescope.figures.inline: Returns a figure that arranges a set of displayable objects along a line.

pz.ts.indented(subfigure)

Alias of penzai.treescope.figures.indented: Returns a figure object that displays a value with an indent.

pz.ts.with_font_size(subfigure, size)

Alias of penzai.treescope.figures.with_font_size: Returns a scaled version of the first figure.

pz.ts.with_color(subfigure, color)

Alias of penzai.treescope.figures.with_color: Returns a colored version of the first figure.

pz.ts.bolded(subfigure)

Alias of penzai.treescope.figures.bolded: Returns a bolded version of the first figure.

pz.ts.styled(subfigure, style)

Alias of penzai.treescope.figures.styled: Returns a CSS-styled version of the first figure.

Configuring Treescope#

pz.ts.active_renderer

Alias of penzai.treescope.default_renderer.active_renderer: A global value which can be modified in a scoped context.

pz.ts.active_expansion_strategy

Alias of penzai.treescope.default_renderer.active_expansion_strategy: A global value which can be modified in a scoped context.

pz.ts.using_expansion_strategy([max_height, ...])

Alias of penzai.treescope.default_renderer.using_expansion_strategy: Context manager that modifies the expansion strategy of Treescope.

pz.ts.active_autovisualizer

Alias of penzai.treescope.autovisualize.active_autovisualizer: A global value which can be modified in a scoped context.

pz.ts.default_diverging_colormap

Alias of penzai.treescope.arrayviz.arrayviz.default_diverging_colormap: A global value which can be modified in a scoped context.

pz.ts.default_sequential_colormap

Alias of penzai.treescope.arrayviz.arrayviz.default_sequential_colormap: A global value which can be modified in a scoped context.

Building Autovisualizers#

pz.ts.ArrayAutovisualizer

Alias of penzai.treescope.arrayviz.array_autovisualizer.ArrayAutovisualizer: An automatic visualizer for arrays.

pz.ts.Autovisualizer

Alias of penzai.treescope.autovisualize.Autovisualizer: Protocol for autovisualizers.

pz.ts.ChildAutovisualizer

Alias of penzai.treescope.autovisualize.ChildAutovisualizer: Used by autovisualizers to switch to a different autovisualizer.

pz.ts.IPythonVisualization

Alias of penzai.treescope.autovisualize.IPythonVisualization: Used by autovisualizers to replace a subtree with a display object.

pz.ts.CustomTreescopeVisualization

Alias of penzai.treescope.autovisualize.CustomTreescopeVisualization: Used by autovisualizers to directly insert Treescope content.

pz.ts.vocab_autovisualizer(tokenizer)

Alias of penzai.treescope.arrayviz.array_autovisualizer.ArrayAutovisualizer.for_tokenizer: Builds an autovisualizer for a tokenizer.

pz.ts.default_magic_autovisualizer

Alias of penzai.treescope.treescope_ipython.default_magic_autovisualizer: A global value which can be modified in a scoped context.

Rendering to Strings#

pz.ts.render_to_text(value[, ...])

Alias of penzai.treescope.default_renderer.render_to_text: Renders an object to text using the default renderer.

pz.ts.render_to_html(value[, ...])

Alias of penzai.treescope.default_renderer.render_to_html: Renders an object to HTML using the default renderer.

Utility Types#

pz.ts.NotRoundtrippable

Alias of penzai.treescope.copypaste_fallback.NotRoundtrippable: A placeholder for a non-roundtrippable object in roundtrip mode.