@@ -64,42 +64,42 @@ def test_iterator_nonzero(self):
6464 classes = self .gt .ravel ()
6565 pixels = data .reshape ((- 1 , data .shape [- 1 ]))
6666 sum = np .sum (pixels [classes > 0 ], 0 )
67- itsum = np .sum (np .array ([x for x in iterator (data , classes )]), 0 )
67+ itsum = np .sum (np .array ([x for x in iterator (data , self . gt )]), 0 )
6868 assert_allclose (sum , itsum )
6969
7070 def test_iterator_index (self ):
7171 '''Iteration over single ground truth index'''
7272 from spectral .algorithms .algorithms import iterator
73- i = 5
73+ cls = 5
7474 data = self .image .load ()
7575 classes = self .gt .ravel ()
7676 pixels = data .reshape ((- 1 , data .shape [- 1 ]))
77- sum = np .sum (pixels [classes == 5 ], 0 )
78- itsum = np .sum (np .array ([x for x in iterator (data , classes , 5 )]), 0 )
77+ sum = np .sum (pixels [classes == cls ], 0 )
78+ itsum = np .sum (np .array ([x for x in iterator (data , self . gt , cls )]), 0 )
7979 assert_allclose (sum , itsum )
8080
8181 def test_iterator_spyfile (self ):
8282 '''Iteration over SpyFile object for single ground truth index'''
8383 from spectral .algorithms .algorithms import iterator
84- i = 5
84+ cls = 5
8585 data = self .image .load ()
8686 classes = self .gt .ravel ()
8787 pixels = data .reshape ((- 1 , data .shape [- 1 ]))
88- sum = np .sum (pixels [classes == 5 ], 0 )
89- itsum = np .sum (np .array ([x for x in iterator (self .image , classes , 5 )]),
88+ sum = np .sum (pixels [classes == cls ], 0 )
89+ itsum = np .sum (np .array ([x for x in iterator (self .image , self . gt , cls )]),
9090 0 )
9191 assert_allclose (sum , itsum )
9292
9393 def test_iterator_spyfile_nomemmap (self ):
9494 '''Iteration over SpyFile object without memmap'''
9595 from spectral .algorithms .algorithms import iterator
96- i = 5
96+ cls = 5
9797 data = self .image .load ()
9898 classes = self .gt .ravel ()
9999 pixels = data .reshape ((- 1 , data .shape [- 1 ]))
100- sum = np .sum (pixels [classes == 5 ], 0 )
100+ sum = np .sum (pixels [classes == cls ], 0 )
101101 image = spy .open_image ('92AV3C.lan' )
102- itsum = np .sum (np .array ([x for x in iterator (image , classes , 5 )]), 0 )
102+ itsum = np .sum (np .array ([x for x in iterator (image , self . gt , cls )]), 0 )
103103 assert_allclose (sum , itsum )
104104
105105
0 commit comments