points.py 文件源码

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

项目:autolab_core 作者: BerkeleyAutomation 项目源码 文件源码
def _check_valid_data(self, data):
        """Checks that the incoming data is a 2 x #elements ndarray of ints.

        Parameters
        ----------
        data : :obj:`numpy.ndarray`
            The data to verify.

        Raises
        ------
        ValueError
            If the data is not of the correct shape or type.
        """
        if data.dtype.type != np.int8 and data.dtype.type != np.int16 \
                and data.dtype.type != np.int32 and data.dtype.type != np.int64 \
                and data.dtype.type != np.uint8 and data.dtype.type != np.uint16 \
                and data.dtype.type != np.uint32 and data.dtype.type != np.uint64:
            raise ValueError('Must initialize image coords with a numpy int ndarray')
        if data.shape[0] != 2:
            raise ValueError('Illegal data array passed to image coords. Must have 2 coordinates')
        if len(data.shape) > 2:
            raise ValueError('Illegal data array passed to point cloud. Must have 1 or 2 dimensions')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号