本文整理汇总了Python中block.Block.exclude_post方法的典型用法代码示例。如果您正苦于以下问题:Python Block.exclude_post方法的具体用法?Python Block.exclude_post怎么用?Python Block.exclude_post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类block.Block
的用法示例。
在下文中一共展示了Block.exclude_post方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: next_block
# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import exclude_post [as 别名]
def next_block(self):
"""Get the next block for fitting. Returns None when the end
of the data is reached.
"""
if self.debug:
print("\nSearching for next block...")
print(" Starting index:", self.idx)
# Call the C function that will do the actual search.
return_inds = np.zeros(2, dtype=np.int64)
b = blockident_median_c.next_block(
max(self.idx - self.filt_len, 0),
self.filt_len,
self.pad_post,
self.max_len,
self.th,
self.r,
return_inds)
i0, i1 = return_inds
# Are we at the end of the data?
if i0 == self.r.size:
return None
# Construct new block.
block = Block(self.r, self.p,
max(i0 - self.pad_pre, 0),
min(i1 + self.pad_post, self.r.size - 1),
b)
block.exclude_pre = self.exclude_pre
block.exclude_post = self.exclude_post
# Update current index, always making some progress.
# This helps us avoid a problem that occurs when we reach the
# end of the data.
self.set_position(max(self.idx + 1, block.i1 - self.exclude_post))
if self.debug:
print(" Found block :", block.i0)
print(" Length :", block.i1 - block.i0)
return block