Ejemplo n.º 1
0
def test_filter():

    x = arange(2*3*4).reshape(2, 3, 4)
    b = array(x)

    # Test all generic filter functionality
    generic.filter_suite(x, b)
Ejemplo n.º 2
0
def test_filter(sc):

    x = arange(2*3*4).reshape(2, 3, 4)
    b = array(x, sc, axis=0)

    # Test all filter functionality when the base array is split after the first axis
    generic.filter_suite(x, b)

    # Split the BoltArraySpark after the second axis and rerun the tests
    b = array(x, sc, axis=(0, 1))
    generic.filter_suite(x, b)

    # Split the BoltArraySpark after the third axis (scalar values) and rerun the tests
    b = array(x, sc, axis=(0, 1, 2))
    generic.filter_suite(x, b)
Ejemplo n.º 3
0
def test_filter(sc):

    x = arange(2*3*4).reshape(2, 3, 4)
    b = array(x, sc, axis=0)

    # Test all filter functionality when the base array is split after the first axis
    generic.filter_suite(x, b)

    # Split the BoltArraySpark after the second axis and rerun the tests
    b = array(x, sc, axis=(0, 1))
    generic.filter_suite(x, b)

    # Split the BoltArraySpark after the third axis (scalar values) and rerun the tests
    b = array(x, sc, axis=(0, 1, 2))
    generic.filter_suite(x, b)

    # Test that the split is correct after the filter (should always be 1
    # due to reindexing)
    b = array(x, sc, axis=(0, 1))
    r = b.filter(lambda x: True, axis=(1,))
    assert r.shape == (b.shape[1], b.shape[0], b.shape[2])
    assert r._split == 1
Ejemplo n.º 4
0
def test_filter(sc):

    x = arange(2 * 3 * 4).reshape(2, 3, 4)
    b = array(x, sc, axis=0)

    # Test all filter functionality when the base array is split after the first axis
    generic.filter_suite(x, b)

    # Split the BoltArraySpark after the second axis and rerun the tests
    b = array(x, sc, axis=(0, 1))
    generic.filter_suite(x, b)

    # Split the BoltArraySpark after the third axis (scalar values) and rerun the tests
    b = array(x, sc, axis=(0, 1, 2))
    generic.filter_suite(x, b)

    # Test that the split is correct after the filter (should always be 1
    # due to reindexing)
    b = array(x, sc, axis=(0, 1))
    r = b.filter(lambda x: True, axis=(1, ))
    assert r.shape == (b.shape[1], b.shape[0], b.shape[2])
    assert r._split == 1