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