live_utils.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:Interactivity 作者: treeoftenere 项目源码 文件源码
def update(self, x):
        """Update the buffer.

        Args:
            x (numpy.ndarray): array of shape
                (n_new_samples, n_channels(, n_points))
        """
        if x.ndim != self.buffer.ndim:
            raise ValueError('x has not the same number of dimensions as '
                             'the buffer.')
        nw = x.shape[0]

        # Determine index at which new values should be put into array
        ind = np.arange(self.ind, self.ind + nw, dtype=np.int16) % self.n
        self.buffer[ind, :] = x

        # Set self.ind = to the index at which new locations were put.
        # Separately defined here to allow new data to be an array rather
        # than just one row
        self.ind = (ind[-1] + 1) % self.n
        self.pts += nw
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号