Skip to content

Commit

Permalink
Add support for cuDF
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 24, 2020
1 parent 8dc94cb commit 10c94e5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions hvplot/cudf.py
@@ -0,0 +1,19 @@
from __future__ import absolute_import

def patch(name='hvplot', extension='bokeh', logo=False):
from . import hvPlotTabular, post_patch

try:
import cudf
except:
raise ImportError('Could not patch plotting API onto cuDF. '
'cuDF could not be imported.')
_patch_plot = lambda self: hvPlotTabular(self)
_patch_plot.__doc__ = hvPlotTabular.__call__.__doc__
patch_property = property(_patch_plot)
setattr(cudf.DataFrame, name, patch_property)
setattr(cudf.Series, name, patch_property)

post_patch(extension, logo)

patch()

0 comments on commit 10c94e5

Please sign in to comment.