本文整理汇总了Python中param.Selector方法的典型用法代码示例。如果您正苦于以下问题:Python param.Selector方法的具体用法?Python param.Selector怎么用?Python param.Selector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类param
的用法示例。
在下文中一共展示了param.Selector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: select
# 需要导入模块: import param [as 别名]
# 或者: from param import Selector [as 别名]
def select(self, selector=None):
"""
Iterates over the Viewable and any potential children in the
applying the Selector.
Arguments
---------
selector: type or callable or None
The selector allows selecting a subset of Viewables by
declaring a type or callable function to filter by.
Returns
-------
viewables: list(Viewable)
"""
return super().select(selector) + self.layout.select(selector)
示例2: __init__
# 需要导入模块: import param [as 别名]
# 或者: from param import Selector [as 别名]
def __init__(self, shiftds, sampling=2, pct_thres=99.9, on=0):
self.shiftds = shiftds
self.temps = shiftds['temps']
self.on = on
self.pct_thres = pct_thres
self.hh = self.temps.sizes['height']
self.ww = self.temps.sizes['width']
self.mask = xr.zeros_like(self.temps, dtype=bool)
self.ls_anm = np.unique(shiftds.coords['animal'].values)
self.ls_ss = np.unique(shiftds.coords['session'].values)
Selection = Stream.define(
'selection',
anm=param.Selector(self.ls_anm),
ss=param.Selector(self.ls_ss))
self.str_sel = Selection(anm=self.ls_anm[0], ss=self.ls_ss[0])
# self.sampling = sampling
self.str_box = BoxEdit()
self.box = hv.DynamicMap(self._box, streams=[self.str_box])
self.box = self.box.opts(
style=dict(fill_alpha=0.3, line_color='white'))
self.wgts = self._widgets()
self.hvobjs = self._get_objs()