本文整理匯總了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