UCL / rsd-engineeringcourse

Course materials for Research Software Engineering course.
http://github-pages.ucl.ac.uk/rsd-engineeringcourse/
Other
108 stars 97 forks source link

Only allow specific errors in notebooks #121

Open ageorgou opened 5 years ago

ageorgou commented 5 years ago

Some of the notebooks contain cells that intentionally cause errors, which breaks the execution. We are currently running nbconvert --allow-errors to continue the conversion after an error occurs, but this means we are potentially letting other errors through without noticing (there doesn't seem to be a way to get all the errors raised).

Version 5.4 of nbconvert has support for the raises-exception tag, which lets you specify that a particular cell is expected to produce an error, and shouldn't stop the conversion if an exception is raised (there is an issue open for the inverse, requiring that the cell produces the error, and stopping the conversion if it doesn't). If we use that, then we should be able to just run nbconvert and only accept the errors we have put there intentionally.