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

Function patch

hvplot/pandas.py:6–30  ·  view source on GitHub ↗
(name='hvplot', interactive='interactive', extension='bokeh', logo=False)

Source from the content-addressed store, hash-verified

4
5
6def patch(name='hvplot', interactive='interactive', extension='bokeh', logo=False):
7 from . import hvPlotTabular, post_patch, _module_extensions
8
9 try:
10 import pandas as pd
11 except ImportError:
12 raise ImportError(
13 'Could not patch plotting API onto pandas. Pandas could not be imported.'
14 )
15
16 if 'hvplot.pandas' not in _module_extensions:
17 _patch_plot = lambda self: hvPlotTabular(self) # noqa: E731
18 _patch_plot.__doc__ = hvPlotTabular.__call__.__doc__
19 plot_prop = property(_patch_plot)
20 setattr(pd.DataFrame, name, plot_prop)
21 setattr(pd.Series, name, plot_prop)
22
23 _patch_interactive = lambda self: Interactive(self) # noqa: E731
24 _patch_interactive.__doc__ = Interactive.__call__.__doc__
25 interactive_prop = property(_patch_interactive)
26 setattr(pd.DataFrame, interactive, interactive_prop)
27 setattr(pd.Series, interactive, interactive_prop)
28 _module_extensions.add('hvplot.pandas')
29
30 post_patch(extension, logo)
31
32
33patch()

Callers 1

pandas.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…