Skip to content

alvinwan/iwut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iWut

Friendlier tracebacks, with (1) collapsible traceback frames for library code and (2) inlined variable values.

  1. Collapsed traceback frames for library code, to hide traceback information for library internals.

    The following is an example traceback from a faulty PyTorch dataloader.

    Screen Shot 2021-10-26 at 4 13 20 PM

    Compare the above output to the below, collapsible traceback from wut:

    collapsible-traceback
  2. Inline Variable Values to make debugging faster.

    inline-variable-values

Usage

To install,

pip install iwut

Or, from within a notebook cell, run %pip install iwut. Then, load the iwut extension.

%load_ext iwut

Global Usage: You can turn on wut globally to catch and re-render all tracebacks.

%wut on

Post-Error Usage (Line Magic): If you don't turn wut on globally, you can use wut to retroactively re-parse the exception. For example, say you've got a ZeroDivisionError.

Screen Shot 2021-10-26 at 4 01 38 PM

In the next cell, use the %wut line magic to print a friendlier traceback.

%wut

Screen Shot 2021-10-26 at 3 59 06 PM

Pre-Error Usage (Cell Magic): If you don't turn on wut globally, you can also rerun a cell with the cell magic %%wut prepended to get friendlier tracebacks.

%%wut
1/0

Demo

See demo.ipynb in the root directory of this repository for a demo, or see the GIF below:

wut-vars-ctx-prettier