File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def test_mnf_all_equals_data(self):
5555 noise = spy .noise_from_diffs (data [117 : 137 , 85 : 122 , :])
5656 mnfr = spy .mnf (signal , noise )
5757 denoised = mnfr .denoise (data , num = data .shape [- 1 ])
58- assert_allclose ( denoised , data )
58+ assert ( np . allclose ( denoised , data ) )
5959
6060 def test_ppi (self ):
6161 '''Tests that ppi function runs'''
@@ -75,7 +75,7 @@ def test_ppi_continues(self):
7575 np .random .set_state (s )
7676 p2 = spy .ppi (data , 2 )
7777 p2 = spy .ppi (data , 2 , start = p2 )
78- np .all (p == p2 )
78+ assert ( np .all (p == p2 ) )
7979
8080 def test_ppi_centered (self ):
8181 '''Tests that ppi with mean-subtracted data works as expected.'''
@@ -86,7 +86,7 @@ def test_ppi_centered(self):
8686 np .random .set_state (s )
8787 data_centered = data - spy .calc_stats (data ).mean
8888 p2 = spy .ppi (data_centered , 4 )
89- np .all (p == p2 )
89+ assert ( np .all (p == p2 ) )
9090
9191 def test_pca_runs (self ):
9292 '''Should be able to compute PCs and transform data.'''
Original file line number Diff line number Diff line change 4444from __future__ import division , print_function , unicode_literals
4545
4646import numpy as np
47- from numpy .testing import assert_almost_equal
4847from .spytest import SpyTest
4948
49+ def assert_almost_equal (a , b , ** kwargs ):
50+ if not np .allclose (a , b , ** kwargs ):
51+ raise Exception ('NOPE' )
5052
5153class SpyFileTest (SpyTest ):
5254 '''Tests that SpyFile methods read data correctly from files.'''
@@ -165,7 +167,7 @@ def test_load(self):
165167 data = self .image .load ()
166168 spyf = self .image
167169
168- load_assert = assert_same_shape_almost_equal
170+ load_assert = np . allclose
169171 load_assert (data [i , j , k ], self .value )
170172 first_band = spyf [:, :, 0 ]
171173 load_assert (data [:, :, 0 ], first_band )
You can’t perform that action at this time.
0 commit comments