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

Function patch

hvplot/cudf.py:4–27  ·  view source on GitHub ↗
(name='hvplot', interactive='interactive', extension='bokeh', logo=False)

Source from the content-addressed store, hash-verified

2
3
4def 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
30patch()

Callers 1

cudf.pyFile · 0.70

Calls 3

hvPlotTabularClass · 0.85
InteractiveClass · 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…