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

Function patch

hvplot/xarray.py:41–61  ·  view source on GitHub ↗
(name='hvplot', interactive='interactive', extension='bokeh', logo=False)

Source from the content-addressed store, hash-verified

39
40
41def patch(name='hvplot', interactive='interactive', extension='bokeh', logo=False):
42 from . import hvPlot, post_patch, _module_extensions
43
44 try:
45 import xarray as xr
46 except ImportError:
47 raise ImportError(
48 'Could not patch plotting API onto xarray. xarray could not be imported.'
49 )
50
51 # Remove the class docstring as it very developer focused
52 XArrayInteractive.__doc__ = ''
53
54 if 'hvplot.xarray' not in _module_extensions:
55 xr.register_dataset_accessor(name)(hvPlot)
56 xr.register_dataarray_accessor(name)(hvPlot)
57 xr.register_dataset_accessor(interactive)(XArrayInteractive)
58 xr.register_dataarray_accessor(interactive)(XArrayInteractive)
59 _module_extensions.add('hvplot.xarray')
60
61 post_patch(extension, logo)
62
63
64patch()

Callers 1

xarray.pyFile · 0.70

Calls 1

post_patchFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…