Friendlier tracebacks, with (1) collapsible traceback frames for library code and (2) inlined variable values.
-
Collapsed traceback frames for library code, to hide traceback information for library internals.
The following is an example traceback from a faulty PyTorch dataloader.
Compare the above output to the below, collapsible traceback from wut:
-
Inline Variable Values to make debugging faster.
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
.
In the next cell, use the %wut
line magic to print a friendlier traceback.
%wut
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
See demo.ipynb
in the root directory of this repository for a demo, or see the GIF below: