-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
After upgrading to Jupyter version 5.0.0b1 on Mac OS X, I'm getting errors like:
IOPub data rate exceeded.
The notebook server will temporarily stop sending output
to the client in order to avoid crashing it.
To change this limit, set the config variable
`--NotebookApp.iopub_data_rate_limit`.
for just about every notebook I run, all of which have various visualizations. From that message I had no idea what units the rate limits might be expressed in, but by adding enough zeros I eventually figured out that the problems go away if I launch jupyter with:
jupyter notebook --NotebookApp.iopub_data_rate_limit=10000000000
As mentioned in #1821, it is not obvious what limits are reasonable to set for this value by default, but I would like to put in my vote that the current value is at least an order of magnitude too low. A sample matplotlib script that usually causes the problem is below, but I mostly use HoloViews, where I see the problem for just about every visualization when using the Bokeh backend, which requires a lot of JavaScript to be sent to the browser.
As someone who in part maintains HoloViews, I now have to recommend that all of our users start Jupyter in this way, which makes it very awkward for them, for what I think is a very reasonable way to be using a Jupyter notebook for visualizations. So I would strongly plead with you to increase this value by default so that it is only reached for actual error cases, not for ordinary visualization workflows.
import numpy as np
import matplotlib.pyplot as plt
freq = 100
def sine(x, phase=0, freq=freq):
return np.sin((freq * x + phase))
dist = np.linspace(-0.5,0.5,256)
x,y = np.meshgrid(dist, dist)
grid = (x**2+y**2)
testpattern = sine(grid, freq=freq)
methods = [None, 'none', 'nearest', 'bilinear', 'bicubic', 'spline16',
'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric',
'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos']
fig, axes = plt.subplots(3, 6, figsize=(96, 48))
fig.subplots_adjust(hspace=0.3, wspace=0.05)
for ax, interp_method in zip(axes.flat, methods):
ax.imshow(testpattern , interpolation=interp_method, cmap='gray')
ax.set_title(interp_method)
plt.show()