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)
评论列表
文章目录