def test_LandmarkManager_group_order(): points = np.ones((10, 3)) pcloud = PointCloud(points, copy=False) target = PointCloud(points) man = LandmarkManager() man['test_set'] = pcloud.copy() man['abc'] = pcloud.copy() man['def'] = pcloud.copy() assert_equal(list(man._landmark_groups.keys()), ['test_set', 'abc', 'def']) # check that after deleting and inserting the order will remain the same. del man['test_set'] man['tt'] = pcloud.copy() assert_equal(list(man._landmark_groups.keys()), ['abc', 'def', 'tt'])
def test_LandmarkManager_group_order(): points = np.ones((10, 3)) pcloud = PointCloud(points, copy=False) target = PointCloud(points) man = LandmarkManager() man["test_set"] = pcloud.copy() man["abc"] = pcloud.copy() man["def"] = pcloud.copy() assert_equal(list(man._landmark_groups.keys()), ["test_set", "abc", "def"]) # check that after deleting and inserting the order will remain the same. del man["test_set"] man["tt"] = pcloud.copy() assert_equal(list(man._landmark_groups.keys()), ["abc", "def", "tt"])
def test_pointcloud_copy_method(): points = np.array([[1, 2, 3], [1, 1, 1]]) landmarks = PointCloud(np.ones([3, 3]), copy=False) p = PointCloud(points, copy=False) p.landmarks["test"] = landmarks p_copy = p.copy() assert not is_same_array(p_copy.points, p.points) assert not is_same_array(p_copy.landmarks["test"].lms.points, p.landmarks["test"].lms.points)
def test_pointcloud_copy_method(): points = np.array([[1, 2, 3], [1, 1, 1]]) landmarks = PointCloud(np.ones([3, 3]), copy=False) p = PointCloud(points, copy=False) p.landmarks["test"] = landmarks p_copy = p.copy() assert not is_same_array(p_copy.points, p.points) assert not is_same_array(p_copy.landmarks["test"].points, p.landmarks["test"].points)