From db38ba57bf222fe3c5bac3b8f0c69f70f0a8c5ef 2013-09-20 21:03:06 From: Jonathan Frederic Date: 2013-09-20 21:03:06 Subject: [PATCH] Added wait=True to a couple more clear_output calls. --- diff --git a/IPython/parallel/client/asyncresult.py b/IPython/parallel/client/asyncresult.py index aa58015..c26bbaf 100644 --- a/IPython/parallel/client/asyncresult.py +++ b/IPython/parallel/client/asyncresult.py @@ -391,7 +391,7 @@ class AsyncResult(object): tic = time.time() while not self.ready() and (timeout < 0 or time.time() - tic <= timeout): self.wait(interval) - clear_output() + clear_output(wait=True) print("%4i/%i tasks finished after %4i s" % (self.progress, N, self.elapsed), end="") sys.stdout.flush() print() diff --git a/examples/parallel/InteractiveMPI-publish-data.ipynb b/examples/parallel/InteractiveMPI-publish-data.ipynb index 4235c83..6205db3 100644 --- a/examples/parallel/InteractiveMPI-publish-data.ipynb +++ b/examples/parallel/InteractiveMPI-publish-data.ipynb @@ -271,7 +271,7 @@ " # We clear the notebook output before plotting this if in-place \n", " # plot updating is requested\n", " if in_place:\n", - " clear_output()\n", + " clear_output(wait=True)\n", " display(fig)\n", " \n", " return fig" @@ -333,7 +333,7 @@ " msg = 'Simulation completed!'\n", " tmon = dt.datetime.now() - t0\n", " if plots_in_place and fig is not None:\n", - " clear_output()\n", + " clear_output(wait=True)\n", " plt.close('all')\n", " display(fig)\n", " print msg\n", diff --git a/examples/parallel/InteractiveMPI.ipynb b/examples/parallel/InteractiveMPI.ipynb index ea03906..526fe29 100644 --- a/examples/parallel/InteractiveMPI.ipynb +++ b/examples/parallel/InteractiveMPI.ipynb @@ -281,7 +281,7 @@ " plt.axis('off')\n", " # We clear the notebook output before plotting this if in-place plot updating is requested\n", " if in_place:\n", - " clear_output()\n", + " clear_output(wait=True)\n", " display(fig)\n", " return fig" ], @@ -377,7 +377,7 @@ " msg = 'Simulation completed!'\n", " tmon = dt.datetime.now() - t0\n", " if plots_in_place and fig is not None:\n", - " clear_output()\n", + " clear_output(wait=True)\n", " plt.close('all')\n", " display(fig)\n", " print msg\n",