本文整理汇总了Python中holoviews.extension方法的典型用法代码示例。如果您正苦于以下问题:Python holoviews.extension方法的具体用法?Python holoviews.extension怎么用?Python holoviews.extension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类holoviews
的用法示例。
在下文中一共展示了holoviews.extension方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: output_notebook
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import extension [as 别名]
def output_notebook(inline=True, logo=False):
"""
Load the notebook extension
Parameters
----------
inline : boolean (optional)
Whether to inline JS code or load it from a CDN
logo : boolean (optional)
Whether to show the logo(s)
"""
try:
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`.")
import holoviews as hv
return hv.extension('bokeh', inline=inline, logo=logo)
示例2: swarm
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import extension [as 别名]
def swarm(request):
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
swarm_name, backend = request.param
holoviews.extension(backend)
swarm_viz = swarm_dict.get(swarm_name)()
PLOTS[request.param] = swarm_viz.plot()
return swarm_viz
示例3: plot_saver
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import extension [as 别名]
def plot_saver(request):
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
swarm_name, backend = request.param
holoviews.extension(backend)
swarm_viz = swarm_dict.get(swarm_name)()
swarm_viz.stream_interval = 1
plot_saver = PlotSaver(swarm_viz, output_path="Miau_db", fmt="png")
return plot_saver
示例4: test_get_file_name
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import extension [as 别名]
def test_get_file_name(self, plot_saver):
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
filename = plot_saver._get_file_name()
assert isinstance(filename, str)
name, extension = filename.split(".")
assert extension == plot_saver._fmt
class_name, epoch = name.split("_")
assert class_name == plot_saver.unwrapped.__class__.__name__.lower()
assert len(epoch) == 5
assert int(epoch) == plot_saver.epoch
示例5: with_hv_extension
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import extension [as 别名]
def with_hv_extension(func, extension='bokeh', logo=False):
"""If hv.extension is not loaded, load before calling function"""
def wrapper(*args, **kwargs):
if extension and not getattr(hv.extension, '_loaded', False):
hv.extension(extension, logo=logo)
return func(*args, **kwargs)
return wrapper
示例6: post_patch
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import extension [as 别名]
def post_patch(extension='bokeh', logo=False):
if extension and not getattr(_hv.extension, '_loaded', False):
_hv.extension(extension, logo=logo)
示例7: setUp
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import extension [as 别名]
def setUp(self):
try:
import pandas as pd
except:
raise SkipTest('Pandas not available')
self.backend = 'bokeh'
hv.extension(self.backend)
Store.current_backend = self.backend
self.store_copy = OptionTree(sorted(Store.options().items()),
groups=Options._option_groups)
import hvplot.pandas # noqa
self.df = pd.DataFrame([[1, 2, 'A', 0.1], [3, 4, 'B', 0.2], [5, 6, 'C', 0.3]],
columns=['x', 'y', 'category', 'number'])
self.symmetric_df = pd.DataFrame([[1, 2, -1], [3, 4, 0], [5, 6, 1]],
columns=['x', 'y', 'number'])