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

Function patch

hvplot/streamz.py:1–21  ·  view source on GitHub ↗
(name='hvplot', extension='bokeh', logo=False)

Source from the content-addressed store, hash-verified

1def patch(name='hvplot', extension='bokeh', logo=False):
2 from . import hvPlotTabular, post_patch, _module_extensions
3
4 try:
5 import streamz.dataframe as sdf
6 except ImportError:
7 raise ImportError(
8 'Could not patch plotting API onto streamz. Streamz could not be imported.'
9 )
10 if 'hvplot.streamz' not in _module_extensions:
11 _patch_plot = lambda self: hvPlotTabular(self) # noqa: E731
12 _patch_plot.__doc__ = hvPlotTabular.__call__.__doc__
13 patch_property = property(_patch_plot)
14 setattr(sdf.DataFrame, name, patch_property)
15 setattr(sdf.DataFrames, name, patch_property)
16 setattr(sdf.Series, name, patch_property)
17 setattr(sdf.Seriess, name, patch_property)
18
19 _module_extensions.add('hvplot.streamz')
20
21 post_patch(extension, logo)
22
23
24patch()

Callers 1

streamz.pyFile · 0.70

Calls 2

hvPlotTabularClass · 0.85
post_patchFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…