frozen.py 文件源码

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

项目:kripodb 作者: 3D-e-Chem 项目源码 文件源码
def from_array(self, data, labels):
        """Fill matrix from 2 dimensional array

        Args:
            data (np.array): 2 dimensional square array with scores
            labels (list): List of labels for each column and row index
        """
        labels = [np.string_(d) for d in labels]
        self.labels = self.h5file.create_carray('/', 'labels', obj=labels, filters=self.filters)
        self.h5file.flush()
        self.build_label_cache()

        nr_frags = len(labels)
        self.scores = self.h5file.create_carray('/', 'scores', atom=tables.UInt16Atom(),
                                                shape=(nr_frags, nr_frags), chunkshape=(1, nr_frags),
                                                filters=self.filters)
        self.scores[0:nr_frags, 0:nr_frags] = (data * self.score_precision).astype('uint16')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号