basic_interactive_setup

basic_interactive_setup#

treescope.basic_interactive_setup(autovisualize_arrays: bool = True, abbreviation_threshold: int | None = None)[source]#

Sets up IPython for interactive use with Treescope.

This is a helper function that runs various setup steps:

  • Configures Treescope as the default IPython renderer.

  • Turns on interactive mode for Treescope’s context managers.

  • Registers the %%autovisualize magic.

  • Registers the %%with magic.

  • If autovisualize_arrays is True, configures Treescope to automatically visualize arrays.

  • If abbreviation_threshold is not None, configures Treescope to abbreviate collapsed objects at the given depth.

Parameters:
  • autovisualize_arrays – Whether to automatically visualize arrays.

  • abbreviation_threshold – If not None, configures Treescope to abbreviate collapsed objects at the given depth (recommended to set to 1 or 2).