Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

FIX OSX test failures in qz decomposition. #292

Merged
merged 1 commit into from

2 participants

Fabian Pedregosa Ralf Gommers
Fabian Pedregosa
Collaborator

Test the absolut because the sign might be platform dependent. Tested
in OS X 10.7 x86-64.

Fabian Pedregosa fabianp FIX OSX test failures in qz decomposition.
Test the absolut because the sign might be platform dependent. Tested
in OS X 10.7 x86-64.
7b73a57
Fabian Pedregosa
Collaborator

BTW @jseabold , I think testing

        assert_array_almost_equal(dot(dot(Q,AA),Z.T), A)
        assert_array_almost_equal(dot(dot(Q,BB),Z.T), B)

plus properties of Q, AA, BB would be enough to test the result is correct, and probably more readable than hard-coding the result, what do you think ?

Ralf Gommers
Owner

See #303, which disables the sort kw. I think we can merge this first and then #303. Please have a look, since this is still a blocker for the 0.11.0 release.

Ralf Gommers
Owner

OK merging this now; will backport to 0.11.x. The question of hardcoding values in the test can be revisited once we re-enable this functionality (disabled by #303). Thanks Fabian.

Ralf Gommers rgommers merged commit 78fa7a2 into from
Fabian Pedregosa
Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 26, 2012
  1. Fabian Pedregosa

    FIX OSX test failures in qz decomposition.

    fabianp authored
    Test the absolut because the sign might be platform dependent. Tested
    in OS X 10.7 x86-64.
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 8 deletions.
  1. +10 −8 scipy/linalg/tests/test_decomp.py
18 scipy/linalg/tests/test_decomp.py
View
@@ -1721,26 +1721,28 @@ def test_qz_double_sort(self):
assert_array_almost_equal(dot(dot(Q,AA),Z.T), A)
assert_array_almost_equal(dot(dot(Q,BB),Z.T), B)
- assert_array_almost_equal(AA, np.array(
+ # test absolute values bc the sign is ambiguous and might be platform
+ # dependent
+ assert_array_almost_equal(np.abs(AA), np.abs(np.array(
[[ 35.7864, -80.9061, -12.0629, -9.498 ],
[ 0. , 2.7638, -2.3505, 7.3256],
[ 0. , 0. , 0.6258, -0.0398],
- [ 0. , 0. , 0. , -12.8217]]), 4)
- assert_array_almost_equal(BB, np.array(
+ [ 0. , 0. , 0. , -12.8217]])), 4)
+ assert_array_almost_equal(np.abs(BB), np.abs(np.array(
[[ 4.5324, -8.7878, 3.2357, -3.5526],
[ 0. , 1.4314, -2.1894, 0.9709],
[ 0. , 0. , 1.3126, -0.3468],
- [ 0. , 0. , 0. , 0.559 ]]), 4)
- assert_array_almost_equal(Q, np.array(
+ [ 0. , 0. , 0. , 0.559 ]])), 4)
+ assert_array_almost_equal(np.abs(Q), np.abs(np.array(
[[-0.4193, -0.605 , -0.1894, -0.6498],
[-0.5495, 0.6987, 0.2654, -0.3734],
[-0.4973, -0.3682, 0.6194, 0.4832],
- [-0.5243, 0.1008, -0.7142, 0.4526]]), 4)
- assert_array_almost_equal(Z, np.array(
+ [-0.5243, 0.1008, -0.7142, 0.4526]])), 4)
+ assert_array_almost_equal(np.abs(Z), np.abs(np.array(
[[-0.9471, -0.2971, -0.1217, 0.0055],
[-0.0367, 0.1209, 0.0358, 0.9913],
[ 0.3171, -0.9041, -0.2547, 0.1312],
- [ 0.0346, 0.2824, -0.9587, 0.0014]]), 4)
+ [ 0.0346, 0.2824, -0.9587, 0.0014]])), 4)
# test absolute values bc the sign is ambiguous and might be platform
# dependent
Something went wrong with that request. Please try again.