(name='hvplot', extension='bokeh', logo=False)
| 1 | def 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 | |
| 24 | patch() |
no test coverage detected
searching dependent graphs…