Ejemplo n.º 1
0
def test_reduce():

    from numpy import asarray

    dims = (10, 10, 10)
    area = dims[0] * dims[1]
    arr = asarray([repeat(x,area).reshape(dims[0], dims[1]) for x in range(dims[2])])
    b = array(arr)

    # Test all generic reduce functionality
    generic.reduce_suite(arr, b)
Ejemplo n.º 2
0
def test_reduce(sc):
    from numpy import asarray

    dims = (10, 10, 10)
    area = dims[0] * dims[1]
    arr = asarray([repeat(x, area).reshape(dims[0], dims[1]) for x in range(dims[2])])
    b = array(arr, sc, axis=0)

    # Test all reduce functionality when the base array is split after the first axis
    generic.reduce_suite(arr, b)

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

    # Split the BoltArraySpark after the third axis (scalar values) and rerun the tests
    b = array(arr, sc, axis=(0, 1, 2))
    generic.reduce_suite(arr, b)
Ejemplo n.º 3
0
def test_reduce(sc):
    from numpy import asarray

    dims = (10, 10, 10)
    area = dims[0] * dims[1]
    arr = asarray(
        [repeat(x, area).reshape(dims[0], dims[1]) for x in range(dims[2])])
    b = array(arr, sc, axis=0)

    # Test all reduce functionality when the base array is split after the first axis
    generic.reduce_suite(arr, b)

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

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