(self)
| 177 | assert_equal(test, {}) |
| 178 | |
| 179 | def test_find_duplicates(self): |
| 180 | # Test find_duplicates |
| 181 | a = ma.array([(2, (2., 'B')), (1, (2., 'B')), (2, (2., 'B')), |
| 182 | (1, (1., 'B')), (2, (2., 'B')), (2, (2., 'C'))], |
| 183 | mask=[(0, (0, 0)), (0, (0, 0)), (0, (0, 0)), |
| 184 | (0, (0, 0)), (1, (0, 0)), (0, (1, 0))], |
| 185 | dtype=[('A', int), ('B', [('BA', float), ('BB', '|S1')])]) |
| 186 | |
| 187 | test = find_duplicates(a, ignoremask=False, return_index=True) |
| 188 | control = [0, 2] |
| 189 | assert_equal(sorted(test[-1]), control) |
| 190 | assert_equal(test[0], a[test[-1]]) |
| 191 | |
| 192 | test = find_duplicates(a, key='A', return_index=True) |
| 193 | control = [0, 1, 2, 3, 5] |
| 194 | assert_equal(sorted(test[-1]), control) |
| 195 | assert_equal(test[0], a[test[-1]]) |
| 196 | |
| 197 | test = find_duplicates(a, key='B', return_index=True) |
| 198 | control = [0, 1, 2, 4] |
| 199 | assert_equal(sorted(test[-1]), control) |
| 200 | assert_equal(test[0], a[test[-1]]) |
| 201 | |
| 202 | test = find_duplicates(a, key='BA', return_index=True) |
| 203 | control = [0, 1, 2, 4] |
| 204 | assert_equal(sorted(test[-1]), control) |
| 205 | assert_equal(test[0], a[test[-1]]) |
| 206 | |
| 207 | test = find_duplicates(a, key='BB', return_index=True) |
| 208 | control = [0, 1, 2, 3, 4] |
| 209 | assert_equal(sorted(test[-1]), control) |
| 210 | assert_equal(test[0], a[test[-1]]) |
| 211 | |
| 212 | def test_find_duplicates_ignoremask(self): |
| 213 | # Test the ignoremask option of find_duplicates |
nothing calls this directly
no test coverage detected