本文整理汇总了Python中bokeh.__version__方法的典型用法代码示例。如果您正苦于以下问题:Python bokeh.__version__方法的具体用法?Python bokeh.__version__怎么用?Python bokeh.__version__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bokeh
的用法示例。
在下文中一共展示了bokeh.__version__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_bokeh_version
# 需要导入模块: import bokeh [as 别名]
# 或者: from bokeh import __version__ [as 别名]
def check_bokeh_version():
"""Check minimum bokeh version."""
try:
import bokeh
assert version.parse(bokeh.__version__) >= version.parse("1.4.0")
except (ImportError, AssertionError):
raise ImportError("'bokeh' backend needs Bokeh (1.4.0+) installed.")
示例2: bokehplot
# 需要导入模块: import bokeh [as 别名]
# 或者: from bokeh import __version__ [as 别名]
def bokehplot():
figure = make_plot()
fig_script, fig_div = components(figure)
return render_template(
"bokeh.html.j2",
fig_script=fig_script,
fig_div=fig_div,
bkversion=bokeh.__version__,
)
示例3: _get_background_tile
# 需要导入模块: import bokeh [as 别名]
# 或者: from bokeh import __version__ [as 别名]
def _get_background_tile(provider_name):
"""Returns a Bokeh WTMS Tile Provider Source from <provider_name>. If
<provider_name is not valid, it returns False."""
if provider_name not in TILE_PROVIDERS:
return False
if bokeh.__version__ >= "1.1":
from bokeh.tile_providers import get_provider
return get_provider(provider_name)
else:
from bokeh.tile_providers import (
CARTODBPOSITRON,
CARTODBPOSITRON_RETINA,
STAMEN_TERRAIN,
STAMEN_TERRAIN_RETINA,
STAMEN_TONER,
STAMEN_TONER_BACKGROUND,
STAMEN_TONER_LABELS,
)
tile_dict = {
"CARTODBPOSITRON": CARTODBPOSITRON,
"CARTODBPOSITRON_RETINA": CARTODBPOSITRON_RETINA,
"STAMEN_TERRAIN": STAMEN_TERRAIN,
"STAMEN_TERRAIN_RETINA": STAMEN_TERRAIN_RETINA,
"STAMEN_TONER": STAMEN_TONER,
"STAMEN_TONER_BACKGROUND": STAMEN_TONER_BACKGROUND,
"STAMEN_TONER_LABELS": STAMEN_TONER_LABELS,
}
return tile_dict[provider_name]
示例4: get_plotting_function
# 需要导入模块: import bokeh [as 别名]
# 或者: from bokeh import __version__ [as 别名]
def get_plotting_function(plot_name, plot_module, backend):
"""Return plotting function for correct backend."""
_backend = {
"mpl": "matplotlib",
"bokeh": "bokeh",
"matplotlib": "matplotlib",
}
if backend is None:
backend = rcParams["plot.backend"]
backend = backend.lower()
try:
backend = _backend[backend]
except KeyError:
raise KeyError(
"Backend {} is not implemented. Try backend in {}".format(
backend, set(_backend.values())
)
)
if backend == "bokeh":
try:
import bokeh
assert packaging.version.parse(bokeh.__version__) >= packaging.version.parse("1.4.0")
except (ImportError, AssertionError):
raise ImportError(
"'bokeh' backend needs Bokeh (1.4.0+) installed." " Please upgrade or install"
)
# Perform import of plotting method
# TODO: Convert module import to top level for all plots
module = importlib.import_module(
"arviz.plots.backends.{backend}.{plot_module}".format(
backend=backend, plot_module=plot_module
)
)
plotting_method = getattr(module, plot_name)
return plotting_method