MCPcopy Create free account
hub / github.com/holoviz/hvplot / patch

Function patch

hvplot/dask.py:20–43  ·  view source on GitHub ↗
(name='hvplot', interactive='interactive', extension='bokeh', logo=False)

Source from the content-addressed store, hash-verified

18
19
20def patch(name='hvplot', interactive='interactive', extension='bokeh', logo=False):
21 from . import hvPlotTabular, post_patch, _module_extensions
22
23 try:
24 import dask.dataframe as dd
25 except ImportError:
26 raise ImportError('Could not patch plotting API onto dask. Dask could not be imported.')
27
28 if 'hvplot.dask' not in _module_extensions:
29 _patch_plot = lambda self: hvPlotTabular(self) # noqa: E731
30 _patch_plot.__doc__ = hvPlotTabular.__call__.__doc__
31 plot_prop = property(_patch_plot)
32 setattr(dd.DataFrame, name, plot_prop)
33 setattr(dd.Series, name, plot_prop)
34
35 _patch_interactive = lambda self: DaskInteractive(self) # noqa: E731
36 _patch_interactive.__doc__ = DaskInteractive.__call__.__doc__
37 interactive_prop = property(_patch_interactive)
38 setattr(dd.DataFrame, interactive, interactive_prop)
39 setattr(dd.Series, interactive, interactive_prop)
40
41 _module_extensions.add('hvplot.dask')
42
43 post_patch(extension, logo)
44
45
46patch()

Calls 3

hvPlotTabularClass · 0.85
DaskInteractiveClass · 0.85
post_patchFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…