(name='hvplot', interactive='interactive', extension='bokeh', logo=False)
| 2 | |
| 3 | |
| 4 | def patch(name='hvplot', interactive='interactive', extension='bokeh', logo=False): |
| 5 | from . import hvPlotTabular, post_patch, _module_extensions |
| 6 | |
| 7 | try: |
| 8 | import cudf |
| 9 | except ImportError: |
| 10 | raise ImportError('Could not patch plotting API onto cuDF. cuDF could not be imported.') |
| 11 | |
| 12 | if 'hvplot.cudf' not in _module_extensions: |
| 13 | _patch_plot = lambda self: hvPlotTabular(self) # noqa: E731 |
| 14 | _patch_plot.__doc__ = hvPlotTabular.__call__.__doc__ |
| 15 | plot_prop = property(_patch_plot) |
| 16 | setattr(cudf.DataFrame, name, plot_prop) |
| 17 | setattr(cudf.Series, name, plot_prop) |
| 18 | |
| 19 | _patch_interactive = lambda self: Interactive(self) # noqa: E731 |
| 20 | _patch_interactive.__doc__ = Interactive.__call__.__doc__ |
| 21 | interactive_prop = property(_patch_interactive) |
| 22 | setattr(cudf.DataFrame, interactive, interactive_prop) |
| 23 | setattr(cudf.Series, interactive, interactive_prop) |
| 24 | |
| 25 | _module_extensions.add('hvplot.cudf') |
| 26 | |
| 27 | post_patch(extension, logo) |
| 28 | |
| 29 | |
| 30 | patch() |
no test coverage detected
searching dependent graphs…