halo
halo copied to clipboard
Bug: Output gets hidden on stop_and_persist in Jupyter notebooks
Description
Currently, in jupyter notebooks, the final stop_and_persist output is not persisted. I've opened an issue in ipywidget for understanding the issue a little better (https://github.com/jupyter-widgets/ipywidgets/issues/2072).
System settings
- Operating System: Mac OS 10.13.1
- Terminal in use: NA
- Jupyter version: 4.4.0
- Python version: 2.7.14
- Halo version: 9f9ea376d43f0d43859f7ddeee68e34834fdbf19
pip freezeoutput: NA
Error
The output display is not persited on stop_and_persist call.
Expected behaviour
The output should be persited on stop_and_persist call.
Steps to recreate

People to notify
@JungWinter @ManrajGrover
@JungWinter Could you look into this as well?
Sorry for late response. I checked this issue in python 2.7.13 and find this line is making the problem.
https://github.com/ManrajGrover/halo/blob/4dbaa1a52356281cdf18cc1ce19016ad9276c09e/halo/halo_notebook.py#L38
After removing that line, final output seems to be resolved. Would you like to check this solution? I guess it caused by this change, but not sure.
@JungWinter Yes, it seems to resolve the issue. I'm not sure if it breaks anything else.
I'd love to check this out for hacktoberfest. @JungWinter thanks for the starting point.
I looked into this a bit today. This commit caused the bug.
The reason why is ip.events.register('post_run_cell', clean_up) fires after every cell execution, which calls clear() and clears the last output.
I don't want to simply revert that commit, because it seems like there was a good reason for wanting to clean up after execution. Maybe @manrajgrover you can expand on what issue that commit is fixing? I notice it replaced a previous callback to handle SIGINT.