halo icon indicating copy to clipboard operation
halo copied to clipboard

Bug: Output gets hidden on stop_and_persist in Jupyter notebooks

Open manrajgrover opened this issue 7 years ago • 5 comments
trafficstars

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 freeze output: 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

widget bug

People to notify

@JungWinter @ManrajGrover

manrajgrover avatar May 14 '18 17:05 manrajgrover

@JungWinter Could you look into this as well?

manrajgrover avatar May 16 '18 16:05 manrajgrover

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.

winterjung avatar May 17 '18 15:05 winterjung

@JungWinter Yes, it seems to resolve the issue. I'm not sure if it breaks anything else.

manrajgrover avatar May 20 '18 13:05 manrajgrover

I'd love to check this out for hacktoberfest. @JungWinter thanks for the starting point.

mschmo avatar Oct 12 '19 23:10 mschmo

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.

mschmo avatar Oct 15 '19 23:10 mschmo