suppress_widget_comms#

jdaviz.utils.suppress_widget_comms()[source]#

Prevent widgets created within this block from opening frontend comms.

Every ipywidgets/ipyvuetify widget opens a comm (a message channel to the browser) as soon as it’s constructed, which emits messages on Jupyter’s IOPub channel. Some of the code constructs temporary widgets, most notably during the loader process, e.g. finding valid resolvers which builds (and throws away) a resolver widget for every resolver on every load() call. When many datasets are loaded in a loop, the resulting flood of comm messages can exceed Jupyter’s IOPub message-rate limit (“IOPub message rate exceeded”).

Here, the create_comm method temporarily uses a dummy comm to prevent temporary widgets from sending messages to the browser. Widgets constructed in this block are still fully functional Python objects.

Notes

This swaps a module-level attribute, so it should only be used on short, synchronous blocks that don’t display their widgets (such as resolver matching).