-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: respect wait for clear_output #969
FIX: respect wait for clear_output #969
Conversation
This looks like a nice fix ping me when the WIP aspect is done and I'll +1 to merge. |
@MSeal thanks. I was done but thought I missed something. There are issues with voila, but I don't think they should be solved in nbconvert. I did refactored it a bit so it's easier to reuse the The CI failure seems similar to other PR's, I'm assuming it is unrelated. |
@@ -440,6 +440,7 @@ def run_cell(self, cell, cell_index=0): | |||
exec_reply = self._wait_for_reply(msg_id, cell) | |||
|
|||
outs = cell.outputs = [] | |||
self.clear_before_next_output = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check if this is True before exiting (if it were the final message) and clear just before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, if nothing is outputted, it should not clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be covered by the notebook btw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I more meant if the final line of the final cell were clear_output(wait=True)
wouldn't this not apply clear before exiting run_cell
? I might be missing a behavioral aspect this morning before my coffee kicks in :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it would not clear, and it should not. One of the cells in the
notebook has this. Unless you found a scenario I did not test. (apparently, reply by email does not work well with threads).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks, looks good to me them. I'll get to looking at your other PRs related to widgets this next week (been super busy)
if cell_index in cell_map: | ||
cell_map[cell_index] = [] | ||
|
||
def handle_comm_msg(self, outs, msg, cell_index): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea for extensions to overwrite :)
Yes, it would not clear, and it should not. One of the cells in the
notebook has this.
(from mobile phone)
…On Thu, 21 Mar 2019, 17:12 Matthew Seal, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In nbconvert/preprocessors/execute.py
<#969 (comment)>:
> @@ -440,6 +440,7 @@ def run_cell(self, cell, cell_index=0):
exec_reply = self._wait_for_reply(msg_id, cell)
outs = cell.outputs = []
+ self.clear_before_next_output = False
I more meant if the final line of the final cell were
clear_output(wait=True) wouldn't this not apply clear before exiting
run_cell? I might be missing a behavioral aspect this morning before my
coffee kicks in :D
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#969 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABryPZB1P7NVAKvb4tp50qp7NmJcesvvks5vY69ZgaJpZM4b_is_>
.
|
clear_output was not respecting wait. This caused, for instance, ipywidgets' interact not to work voila-dashboards/voila#85
The follow code:
did not output 'Hello world'. This is fixed with this PR. More complicated scenarios are tested in the notebook.