From ab130277d7c13c0ac7b6532aa3d045c5bd8ec7d3 Mon Sep 17 00:00:00 2001 From: Matthew Brett Date: Thu, 2 Feb 2017 15:11:11 +0000 Subject: [PATCH] TST: make test shear matrix full rank Matrix with shears was rank deficient, so small deviations in the SVD output were making the tests fail - see: http://nipy.bic.berkeley.edu/builders/nibabel-py2.7-debian-ppc/builds/106/steps/shell_6/logs/stdio Make test matrix full rank to avoid test failures. --- nibabel/tests/test_nifti1.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nibabel/tests/test_nifti1.py b/nibabel/tests/test_nifti1.py index 6aab35aff0..065ac1d404 100644 --- a/nibabel/tests/test_nifti1.py +++ b/nibabel/tests/test_nifti1.py @@ -357,7 +357,9 @@ def test_qform_sform(self): another_aff = np.diag([3, 4, 5, 1]) # Affine with shears nasty_aff = from_matvec(np.arange(9).reshape((3, 3)), [9, 10, 11]) + nasty_aff[0, 0] = 1 # Make full rank fixed_aff = unshear_44(nasty_aff) + assert_false(np.allclose(fixed_aff, nasty_aff)) for in_meth, out_meth in ((hdr.set_qform, hdr.get_qform), (hdr.set_sform, hdr.get_sform)): in_meth(nice_aff, 2)