👌 IMPROVE: Notebook Execution#236
Conversation
Both now call the same underlying function (from jupyter-cache) and act the same. This improves auto, by making it output error reports and not raising an exception on an error. Additional config has also been added: `execution_allow_errors` and `execution_in_temp`. Like for timeout, `allow_errors` can also be set in the notebook metadata.execution.allow_errors This presents one breaking change, in that `auto` will now by default execute in a temporary folder as the cwd.
Codecov Report
@@ Coverage Diff @@
## master #236 +/- ##
==========================================
+ Coverage 85.37% 85.99% +0.61%
==========================================
Files 9 10 +1
Lines 841 921 +80
==========================================
+ Hits 718 792 +74
- Misses 123 129 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This import is to mitigate errors on CI VMs, where you can get the message: "Matplotlib is building the font cache"
31485f8 to
e8dad54
Compare
|
Just got to document it also... |
There was a problem hiding this comment.
@chrisjsewell some initial general point for discussion.
Option Names:
With option names do you think we should adopt a convention such as {ext}_{option} where {ext} is an indication of which extension the option belongs to. My only concern is option names could get long with this approach but it may help to avoid name conflicts in the option namespace in the future?
Report:
Looks like execution stats include mtime, runtime, method, and succeeded added to env.nb_execution_data[env.docname]. If succeeded is False could we also save a path/reference to the generated error log file? This might be useful for opening traceback information based on context.
Yeh in myst-parser all the config start with Could do something similar here, but I was not sure if it was a good idea to break back compatibility. If we did want to change, probably we should keep both name versions for a time, and somehow log warnings about one being deprecated
I'd say better to be long and specific, than have conflicts.
Sounds good to me 👍 |
Added in 8534c2c |
9288695 to
8534c2c
Compare
|
Awesome @chrisjsewell . A few pointers from my side.
|
|
Ok @mmcky @AakashGfude check this out! https://myst-nb--236.org.readthedocs.build/en/236/use/execute.html#execution-statistics
I think maybe it would be better to have a customizable function, for extracting additional data from the notebook and adding it to
and that is what the
Not sure what you mean by this? coverage reporting how?
as with changing the names of the current configuration values (see above), I'm hesitant to change them, since it means having to implement some kind of deprecation process, updating the documentation both here and in jupyter-book, and dealing with lots of people raising issues about why their books no longer build 😬 |
|
The difference between auto and cache, is that cache does all its execution "at once" before any files have been parsed, whereas auto executes each notebook during the parsing phase. Personally I was never really on-board with having two methods. But I guess it was done since jupyter-cache was/is less developed. This PR though converges them a bit more, and maybe eventually we can just have the one execution method. |
|
Note I'm now going to set |
Both now call the same underlying function (from jupyter-cache) and act the same.
This improves auto, by making it output error reports and not raising an exception on an error.
Additional config has also been added:
execution_allow_errorsandexecution_in_temp.Like for timeout,
allow_errorscan also be set in the notebookmetadata.execution.allow_errorsThis presents one breaking change, in that
autowill now by default execute in a temporary folder as the cwd. (we could set temp to False by default, but I think this is safer?)This (almost) closes executablebooks/jupyter-cache#56