-
-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Milestone
Description
Add :no-execute:
to cell metadata and write a nbconvert
pre-parser to skip execution as an alternative to the current implementation of :class: no-execute
.
class MyExecutePreprocessor(nbconvert.preprocessors.ExecutePreprocessor):
def preprocess_cell(self, cell, resources, cell_index):
"""
Executes a single code cell. See base.py for details.
To execute all cells see :meth:`preprocess`.
Checks cell.metadata for 'execute' key. If set, and maps to False,
the cell is not executed.
"""
if not cell.metadata.get('execute', True):
# Don't execute this cell in output
return cell, resources
return super().preprocess_cell(cell, resources, cell_index)
- For the
.. jupyter::
directive we can add:allow-error:
for cell-blocks that should execute (when compiling the website) but don't execute when running thecoverage
test suite. In the future we could add error types such asValueError
to catch only specific error types etc. For now it will be just a boolean flag. It is also pretty self explanatory.
Metadata
Metadata
Assignees
Labels
No labels