Exemple #1
0
def test_negative_slice():
    n = 10
    array = _array_2d_to_RGB(np.arange(0, n)[np.newaxis, :])
    # Test both x and y slices.
    pic = novice.Picture(array=array)
    assert pic[-3:, 0] == pic[n - 3:, 0]
    pic = novice.Picture(array=rgb_transpose(array))
    assert pic[0, -3:] == pic[0, n - 3:]
Exemple #2
0
def test_negative_index():
    n = 10
    array = _array_2d_to_RGB(np.arange(0, n)[np.newaxis, :])
    # Test both x and y indices.
    pic = novice.Picture(array=array)
    assert pic[-1, 0] == pic[n - 1, 0]
    pic = novice.Picture(array=rgb_transpose(array))
    assert pic[0, -1] == pic[0, n - 1]
Exemple #3
0
def test_negative_slice():
    n = 10
    array = _array_2d_to_RGBA(np.arange(0, n)[np.newaxis, :])
    # Test both x and y slices.
    pic = novice.Picture(array=array)
    assert pic[-3:, 0] == pic[n - 3:, 0]
    pic = novice.Picture(array=rgb_transpose(array))
    assert pic[0, -3:] == pic[0, n - 3:]
Exemple #4
0
def test_negative_index():
    n = 10
    array = _array_2d_to_RGBA(np.arange(0, n)[np.newaxis, :])
    # Test both x and y indices.
    pic = novice.Picture(array=array)
    assert pic[-1, 0] == pic[n - 1, 0]
    pic = novice.Picture(array=rgb_transpose(array))
    assert pic[0, -1] == pic[0, n - 1]