marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
5.33k stars 156 forks source link

Debugging tools: better tracebacks with cell links #848

Open jamieray opened 4 months ago

jamieray commented 4 months ago

Description

Debug cells that failed to run. Sometimes they are using functions defined in other cells, or imported modules.

Suggested solution

Multiple features would be helpful, below:

Alternative

  1. %debug magic like Jupyter?
  2. More readable tracebacks? Currently traceback has cells named with a hash, I wonder if this could be mapped to the 'cell number' that is displayed e.g. in dependency explorer (and/or if there's an option to toggle display of cell names)
    Traceback (most recent call last):
    Cell /tmp/marimo_73071/__marimo__cell_XQaa__output.py, line 1
    f
    NameError: name 'f' is not defined
  3. Related, maybe better: when there's a traceback, make the trace levels in the notebook clickable to jump to the cell (line?) in question, as seems to already be supported when there's a cycle.

Additional context

No response

akshayka commented 4 months ago

All great ideas -- thank you!