test_rbfparams.py 文件源码

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

项目:PyGeM 作者: mathLab 项目源码 文件源码
def test_write_parameters_filename_default(self):
        params = rbfp.RBFParameters()
        params.basis = 'gaussian_spline'
        params.radius = 0.5
        params.n_control_points = 8
        params.power = 2
        params.original_control_points = np.array([0., 0., 0., 0., 0., 1., 0., 1., 0., 1., 0., 0., \
         0., 1., 1., 1., 0., 1., 1., 1., 0., 1., 1., 1.]).reshape((8, 3))
        params.deformed_control_points = np.array([0., 0., 0., 0., 0., 1., 0., 1., 0., 1., 0., 0., \
         0., 1., 1., 1., 0., 1., 1., 1., 0., 1., 1., 1.]).reshape((8, 3))
        outfilename = 'test.prm'
        params.write_parameters(outfilename)
        outfilename_expected = 'tests/test_datasets/parameters_rbf_default.prm'

        print(filecmp.cmp(outfilename, outfilename_expected))
        self.assertTrue(filecmp.cmp(outfilename, outfilename_expected))
        os.remove(outfilename)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号