nbval
nbval copied to clipboard
Allow naming cells?
Currently, cells are named as 'Cell %d' % cell_num. This makes it hard to trace errors in case you have hundreds of cells.
Could the cells be possibly named? Either via cell metadata (given it's already supported anyway), or via inline comments, like # nbval: name = 'cell_name', or just # nbval: cell_name.
To enforce uniqueness, cell number can still be kept, so the output could look e.g. like this:
nbval_test.ipynb::Cell 0 [do_stuff] PASSED
nbval_test.ipynb::Cell 1 PASSED
nbval_test.ipynb::Cell 2 PASSED
nbval_test.ipynb::Cell 3 [other_stuff] FAILED
nbval_test.ipynb::Cell 4 PASSED
nbval_test.ipynb::Cell 5 [custom_name] PASSED
nbval_test.ipynb::Cell 6 PASSED
I'd be OK with doing that based on cell metadata. Using comments for this feels like a bit too much magic parsing.
at least should also use (cell_num + 1) by default to correspond to the numbering in the notebook