Example #1
0
def test_get_axis_off():
    f = np.zeros((3,4,5,3,2,2,5,3,2,4,1))
    for i in [ 12,
             13,
             14,
             67,
             -67,
             -len(f.shape)-1]:
        with pytest.raises(ValueError):
            _get_axis(f, i, 'test')
Example #2
0
 def index(i):
     _get_axis(f, i, 'test')
Example #3
0
def test_get_axis_good():
    f = np.zeros((3,4,5,3,2,2,5,3,2,4,1))
    for i in xrange(len(f.shape)):
        assert i == _get_axis(f, i, 'test')
    for i in xrange(len(f.shape)):
        assert len(f.shape)-1-i == _get_axis(f, -1-i, 'test')
Example #4
0
 def index(i):
     _get_axis(f, i, 'test')
Example #5
0
def test_get_axis_good():
    f = np.zeros((3,4,5,3,2,2,5,3,2,4,1))
    for i in range(len(f.shape)):
        assert i == _get_axis(f, i, 'test')
    for i in range(len(f.shape)):
        assert len(f.shape)-1-i == _get_axis(f, -1-i, 'test')