Skip to content

Commit 7e08d25

Browse files
Merge pull request #510 from matthew-brett/sheared-rank-fix
MRG: 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.
2 parents b8017c9 + ab13027 commit 7e08d25

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

nibabel/tests/test_nifti1.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,9 @@ def test_qform_sform(self):
357357
another_aff = np.diag([3, 4, 5, 1])
358358
# Affine with shears
359359
nasty_aff = from_matvec(np.arange(9).reshape((3, 3)), [9, 10, 11])
360+
nasty_aff[0, 0] = 1 # Make full rank
360361
fixed_aff = unshear_44(nasty_aff)
362+
assert_false(np.allclose(fixed_aff, nasty_aff))
361363
for in_meth, out_meth in ((hdr.set_qform, hdr.get_qform),
362364
(hdr.set_sform, hdr.get_sform)):
363365
in_meth(nice_aff, 2)

0 commit comments

Comments
 (0)