예제 #1
0
    def assertFullSlice(self, keys, ndim, expected):
        result = _full_keys(keys, ndim)
        assert_array_equal(result, tuple(expected))

        # Now check that this is actually the numpy behaviour.
        a = np.empty(range(7, 7 + ndim), dtype=np.bool)
        msg = 'Full slice produces a different result to numpy.'
        assert_array_equal(a[keys], a[expected], msg)
예제 #2
0
    def assertFullSlice(self, keys, ndim, expected):
        result = _full_keys(keys, ndim)
        assert_array_equal(result, tuple(expected))

        # Now check that this is actually the numpy behaviour.
        a = np.empty(range(7, 7 + ndim), dtype=np.bool)
        msg = 'Full slice produces a different result to numpy.'
        assert_array_equal(a[keys], a[expected], msg)
예제 #3
0
 def test_expand_too_many(self):
     with self.assertRaises(IndexError):
         _full_keys((slice(None), 2, 3), 2)
예제 #4
0
 def test_expand_too_many(self):
     with self.assertRaises(IndexError):
         _full_keys((slice(None), 2, 3), 2)