Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def patch(name='hvplot', extension='bokeh', logo=False):
try:
import intake
except:
raise ImportError('Could not patch plotting API onto intake. '
'intake could not be imported.')
_patch_plot = lambda self: hvPlot(self)
_patch_plot.__doc__ = hvPlot.__call__.__doc__
patch_property = property(_patch_plot)
setattr(intake.source.base.DataSource, name, patch_property)
post_patch(extension, logo)
"""
try:
from hvplot import hvPlot
except ImportError:
raise ImportError("The intake plotting API requires hvplot."
"hvplot may be installed with:\n\n"
"`conda install -c pyviz hvplot` or "
"`pip install hvplot`.")
metadata = self.metadata.get('plot', {})
fields = self.metadata.get('fields', {})
for attrs in fields.values():
if 'range' in attrs:
attrs['range'] = tuple(attrs['range'])
metadata['fields'] = fields
plots = self.metadata.get('plots', {})
return hvPlot(self, custom_plots=plots, **metadata)
_patch_plot = lambda self: hvPlot(self)
_patch_plot.__doc__ = hvPlot.__call__.__doc__
"""
try:
from hvplot import hvPlot
except ImportError:
raise ImportError("The intake plotting API requires hvplot."
"hvplot may be installed with:\n\n"
"`conda install -c pyviz hvplot` or "
"`pip install hvplot`.")
metadata = self.metadata.get('plot', {})
fields = self.metadata.get('fields', {})
for attrs in fields.values():
if 'range' in attrs:
attrs['range'] = tuple(attrs['range'])
metadata['fields'] = fields
plots = self.metadata.get('plots', {})
return hvPlot(self, custom_plots=plots, **metadata)