This enables the clearing of output during the execution of a cell. It can be used for simple forms of animation in the notebook.
Adding clear_output to kernel and HTML notebook.
I like the idea of the clear_output message, because I think it does have a lot of valid use cases. A few comments though on this PR before merging:
We were terrible in adding the entire messaging spec without a simple test suite for all the message types that would check compliance and should match our docs. While we may not have time right now to retrofit the whole spec with full test coverage, let's not compound the problem by adding more messages without any tests. This is an easy one to start with, and our test_messages can for now just consist of a test for this one. Over time, we can extend it to complete coverage of the entire specification.
We're starting to have other users of the messaging spec and more than one client, so it's becoming very important to have that specification really validated.
Once these two points are addressed, this one can go in as far as I'm concerned. Thanks for doing it quickly, I think it's a very good idea and will be super-useful in practice.
Since this is a new message type, it should probably be added to the message spec doc.
(quote from #788 comment):
Yep, that is basically what I implemented.
No, it isn't. You implemented a new message type, for which the behavior is really quite different. I'm not saying what you did is better or worse, but it's certainly not adding hold-like function to existing display messages, since it's a new message altogether. If you did want to avoid adding a new message to the spec, this could certainly have been added tot he regular display-message spec, which would also result in a reduction in the number of messages to accomplish a 'display this and this alone' action from two to one.
I like the channels idea. I wouldn't breakdown by mimetype, because that doesn't make a lot of sense to me. For instance, if you are doing repeated plots of a value inplace, changing the figure type from png to svg shouldn't change the behavior.
The way we have channel options elsewhere is in the KernelManager, which has:
KM.start_channels(self, shell=True, stdin=True, iopub=True, hb=True)
so, should we have:
clear_output(stdout=True, stderr=True, pyout=True, pyerr=True, payloads=True)
Note that I don't think pyerr and pyout can get output at any point other than the end of execution, which is necessarily after any call to clear_output(), so they may not make sense to include. I'm pretty sure about that on pyerr, but not pyout.
I made the channel support changes described in my branch.
Did you make a PR for @ellisonbg to merge those in here, or do you want to move this PR over to your branch?
I can do a new PR if Brian doesn't have time to pull from mine.
Closing here since it will be done in #893.