本文整理汇总了Python中selection.select函数的典型用法代码示例。如果您正苦于以下问题:Python select函数的具体用法?Python select怎么用?Python select使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了select函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: get_waveforms
def get_waveforms(self, spikes=None, clusters=None):
if self.waveforms_selected is None:
return None
# Special case: return the already-selected values from the cache.
if spikes is None and clusters is None:
values = self.process_waveforms(self.waveforms_selected)
return pandaize(values, self.spikes_waveforms)
# Normal case.
if self.spikes_selected_table is None:
return None
if spikes is not None:
return select(self.waveforms, spikes)
else:
if clusters is None:
clusters = self.clusters_selected
if clusters is not None:
spikes = get_some_spikes_in_clusters(clusters, self.clusters,
counter=self.counter,
nspikes_max_expected=self.userpref['waveforms_nspikes_max_expected'],
nspikes_per_cluster_min=self.userpref['waveforms_nspikes_per_cluster_min'])
else:
spikes = self.spikes_selected
return select(self.waveforms, spikes)
开发者ID:beniamino38,项目名称:kwiklib,代码行数:25,代码来源:hdf5loader.py
示例2: get_waveforms
def get_waveforms(self, spikes=None, clusters=None):
if spikes is not None:
return select(self.waveforms, spikes)
else:
if clusters is None:
clusters = self.clusters_selected
if clusters is not None:
spikes = get_some_spikes_in_clusters(clusters, self.clusters,
counter=self.counter,
nspikes_max_expected=self.userpref['waveforms_nspikes_max_expected'],
nspikes_per_cluster_min=self.userpref['waveforms_nspikes_per_cluster_min'])
else:
spikes = self.spikes_selected
return select(self.waveforms, spikes)
开发者ID:beniamino38,项目名称:kwiklib,代码行数:14,代码来源:loader.py
示例3: get_spiketimes
def get_spiketimes(self, spikes=None, clusters=None):
if clusters is not None:
spikes = get_spikes_in_clusters(clusters, self.clusters)
if spikes is None:
spikes = self.spikes_selected
spiketimes = getattr(self, 'spiketimes', getattr(self, 'spiketimes_res', None))
return select(spiketimes, spikes)
开发者ID:beniamino38,项目名称:kwiklib,代码行数:7,代码来源:loader.py
示例4: get_cluster_colors
def get_cluster_colors(self, clusters=None, can_override=True):
if clusters is None:
clusters = self.clusters_selected
if can_override and self.override_color:
group_colors = get_array(self.get_group_colors("all"))
groups = get_array(self.get_cluster_groups("all"))
colors = pd.Series(group_colors[groups], index=self.get_clusters_unique())
else:
colors = pd.Series([self.get_cluster_color(c) for c in clusters], index=clusters)
return select(colors, clusters)
开发者ID:klusta-team,项目名称:kwiklib,代码行数:10,代码来源:loader.py
示例5: get_channel_colors
def get_channel_colors(self, channels=None, can_override=True):
if channels is None:
channels = self.channels_selected
if can_override and self.override_color:
channel_group_colors = get_array(self.get_channel_group_colors("all"))
channel_groups = get_array(self.get_channel_groups("all"))
colors = pd.Series(channel_group_colors[channel_groups], index=self.channels)
else:
colors = self.channel_colors
return select(colors, channels)
开发者ID:klusta-team,项目名称:kwiklib,代码行数:10,代码来源:loader.py
示例6: get_masks
def get_masks(self, spikes=None, full=None, clusters=None):
if clusters is not None:
spikes = get_spikes_in_clusters(clusters, self.clusters)
if spikes is None:
spikes = self.spikes_selected
if not full:
masks = self.masks
else:
masks = self.masks_full
return select(masks, spikes)
开发者ID:beniamino38,项目名称:kwiklib,代码行数:10,代码来源:loader.py
示例7: get_features
def get_features(self, spikes=None, clusters=None):
if self.spikes_selected_table is None:
return None
# Special case: return the already-selected values from the cache.
if spikes is None and clusters is None:
features = self.spikes_selected_table['features']
values = self.process_features(features)
return pandaize(values, self.spikes_selected)
# Normal case.
if clusters is not None:
spikes = get_spikes_in_clusters(clusters, self.clusters)
if spikes is None:
spikes = self.spikes_selected
return select(self.features, spikes)
开发者ID:beniamino38,项目名称:kwiklib,代码行数:14,代码来源:hdf5loader.py
示例8: get_some_features
def get_some_features(self, clusters=None):
"""Return the features for a subset of all spikes: a large number
of spikes from any cluster, and a controlled subset of the selected
clusters."""
if clusters is None:
clusters = self.clusters_selected
if clusters is not None:
spikes_background = get_some_spikes(self.clusters,
nspikes_max=self.userpref['features_nspikes_background_max'],)
spikes_clusters = get_some_spikes_in_clusters(
clusters,
self.clusters,
counter=self.counter,
nspikes_max_expected=self.userpref[
'features_nspikes_selection_max'],
nspikes_per_cluster_min=self.userpref[
'features_nspikes_per_cluster_min'])
spikes = np.union1d(spikes_background, spikes_clusters)
else:
spikes = self.spikes_selected
return select(self.features, spikes)
开发者ID:beniamino38,项目名称:kwiklib,代码行数:21,代码来源:loader.py
示例9: get_masks
def get_masks(self, spikes=None, full=None, clusters=None):
if self.spikes_selected_table is None:
return None
# Special case: return the already-selected values from the cache.
if spikes is None and clusters is None:
masks = self.spikes_selected_table['masks']
if full:
values = self.process_masks_full(masks)
else:
values = self.process_masks(masks)
return pandaize(values, self.spikes_selected)
# Normal case.
if clusters is not None:
spikes = get_spikes_in_clusters(clusters, self.clusters)
if spikes is None:
spikes = self.spikes_selected
if not full:
masks = self.masks
else:
masks = self.masks_full
return select(masks, spikes)
开发者ID:beniamino38,项目名称:kwiklib,代码行数:22,代码来源:hdf5loader.py
示例10: get_group_names
def get_group_names(self, groups=None):
return select(self.group_names, groups)
开发者ID:beniamino38,项目名称:kwiklib,代码行数:2,代码来源:loader.py
示例11: get_group_colors
def get_group_colors(self, groups=None):
return select(self.group_colors, groups)
开发者ID:beniamino38,项目名称:kwiklib,代码行数:2,代码来源:loader.py
示例12: get_cluster_groups
def get_cluster_groups(self, clusters=None):
if clusters is None:
clusters = self.clusters_selected
return select(self.cluster_groups, clusters)
开发者ID:beniamino38,项目名称:kwiklib,代码行数:4,代码来源:loader.py
示例13: get_cluster_color
def get_cluster_color(self, cluster):
try:
return select(self.cluster_colors, cluster)
except IndexError:
return 0
开发者ID:beniamino38,项目名称:kwiklib,代码行数:5,代码来源:loader.py
示例14: get_traces
def get_traces(self):
return select(self.raw)
开发者ID:klusta-team,项目名称:kwiklib,代码行数:2,代码来源:loader.py
示例15: get_masks
def get_masks(self, spikes=None, full=None):
if not full:
masks = self.masks
else:
masks = self.masks_full
return select(masks, spikes)
开发者ID:rossant,项目名称:spiky,代码行数:6,代码来源:loader.py
示例16: get_channel_names
def get_channel_names(self, channels=None):
return select(self.channel_names, channels)
开发者ID:beniamino38,项目名称:kwiklib,代码行数:2,代码来源:loader.py
示例17: get_channel_group_colors
def get_channel_group_colors(self, channel_groups=None):
return select(self.channel_group_colors, channel_groups)
开发者ID:beniamino38,项目名称:kwiklib,代码行数:2,代码来源:loader.py
示例18: Decls
def Decls(self,
name=None,
fullname=None,
type=None,
retval=None,
args=None,
anyarg=None,
signature=None,
header=None,
headerdir=None,
accesstype=None,
const=None,
virtuality=None,
filter=None,
recursive=None,
allow_empty=None,
assert_count=None
):
"""Obtain a Decl object referencing one or more declarations.
Filters all contained declarations and returns a new Decl
object that only contains declarations matching the filtering
rules as specified by the arguments. If an argument is None,
that particular filtering operation is disabled. If several
arguments are provided, all of them must be matched.
For any filter that is based on strings (such as name) the
following rules apply:
- A string must match exactly the corresponding attribute of the
declaration (C{name="wxFrame"} will only return the class
"wxFrame").
- A string that is bracketed by a leading and trailing slash '/' is
interpreted as a regular expression (C{name="/wx.*/"} will return
all classes that begin with "wx").
Any argument can also be passed a list of values which duplicates
the filter. These filter are concatenated with OR, so a declaration
has to match only one of the filters. For example, you can select all
classes starting with either "wx" or "WX" by setting
C{name=["/wx.*/", "/WX.*/"}].
The user defined filter function filter must accept a Decl
object as argument and has to return True when the declaration
is matched.
@param name: Select declarations by name
@type name: str
@param fullname: Select declarations by name (which includes namespaces)
@type fullname: str
@param type: Select declarations by type. The type is given by a combination of flags (CLASS, MEMBER_FUNCTION/METHOD, FREE_FUNCTION/FUNCTION, ENUM, ...)
@type type: int
@param retval: Select functions/methods based on their return value (this implies the type flags MEMBER_FUNCTION | FREE_FUNCTION)
@type retval: str
@param args: Select functions/methods bases on their arguments (this implies the type flags MEMBER_FUNCTION | FREE_FUNCTION)
@type args: list of str
@param anyarg: Select all functions/methods that have the specified argument somewhere in their argument list (this implies the type flags MEMBER_FUNCTION | FREE_FUNCTION)
@type anyarg: str
@param signature: Select declarations by their signature (this implies the type flags MEMBER_FUNCTION | FREE_FUNCTION)
@type signature: str
@param header: Select declarations by the header file in which they are defined
@type header: str
@param headerdir: Select declarations by the directory in which their header file is located
@type headerdir: str
@param accesstype: Access type (PUBLIC or PROTECTED). This implies the type flags CLASS_MEMBER.
@param const: Select declarations by their constness.
@type const: bool
@param virtuality: Select declarations by their virtuality. This implies the type flags CLASS_MEMBER:
@type virtuality: Virtuality flags
@param filter: User defined filter function
@type callable
@param recursive: Extend the search to grandchildren? If not specified, a global (customizable) default value is used.
@type recursive: bool
@param allow_empty: Allow empty results. If not specified, a global (customizable) default value is used.
@type allow_empty: bool
@param assert_count: Check the number of matched declarations in the resulting Decl object
@type assert_count: int
:rtype: Returns a Decl object that may reference an arbitrary number of declarations.
@rtype: IDecl
@see: Namespace(), Class(), Method(), Function(), Enum()
"""
global allow_empty_queries, default_recursive
itype = 0
filters = []
if recursive==None:
recursive = default_recursive
if allow_empty==None:
allow_empty = allow_empty_queries
def addFilter(arg, filtercls):
if arg!=None:
if _type(arg)==list:
filters.append(OrFilter(map(lambda x: filtercls(x), arg)))
else:
filters.append(filtercls(arg))
# name filter
addFilter(name, NameFilter)
#.........这里部分代码省略.........
开发者ID:CTrauma,项目名称:pypp11,代码行数:101,代码来源:declwrapper.py
示例19: get_freq
def get_freq(self):
return select(self.freq)
开发者ID:klusta-team,项目名称:kwiklib,代码行数:2,代码来源:loader.py
示例20: get_waveforms
def get_waveforms(self, spikes=None):
return select(self.waveforms, spikes)
开发者ID:rossant,项目名称:spiky,代码行数:2,代码来源:loader.py
注:本文中的selection.select函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论