You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance %notebook to save outputs, including MIME types and exceptions (#14780)
### Description:
This PR implements an enhancement to the `%notebook` magic command,
enabling it to optionally save the output, including the MIME types and
exceptions.
### Changes:
Introduced two new dictionaries, `output_mime_bundles` and `exceptions`
in history manager, to store output MIME types and exceptions
separately. This prevents inflating the history.
When the `%notebook` command is invoked, the code extracts MIME types
and exceptions from the `history_manager` and appends them to the
respective output cells in the generated notebook.
### Feedback Request:
Currently, we are using `mime_obj.get_figure()` to retrieve the MIME
data for Matplotlib objects. However, this approach only works for the
figure object. Are there any other approaches to capture MIME data ?
I am using `VerboseTB` to get a structured traceback. While this works
for most errors, it doesn't handle syntax errors and some other edge
cases very well. In `interactiveshell.py`, different types of errors are
handled by using different traceback formats. Should we take the same
approach here to handle different types of exceptions? It might result
in some repetition, but it could improve error reporting for edge cases.
0 commit comments