예제 #1
0
def test_array_from_query():

    x = sdb.ones(4)
    q = sdb.afl.apply(x, 'g', 'f0 + 3').query
    array = SciDBArray.from_query(sdb, q)

    assert array.shape == x.shape

    assert_allclose(x.toarray(), array.toarray()['f0'])
    assert_allclose(x.toarray() + 3, array.toarray()['g'])
예제 #2
0
def test_array_from_query():

    x = sdb.ones(4)
    q = sdb.afl.apply(x, 'g', 'f0 + 3').query
    array = SciDBArray.from_query(sdb, q)

    assert array.shape == x.shape

    assert_allclose(x.toarray(), array.toarray()['f0'])
    assert_allclose(x.toarray() + 3, array.toarray()['g'])
예제 #3
0
def test_array_eval():

    x = sdb.ones(4)
    q = sdb.afl.apply(x, 'g', 'f0 + 3').query
    array = SciDBArray.from_query(sdb, q)
    assert array.name == q

    array.eval()
    assert array.name != q

    expected = array.toarray()
    np.testing.assert_array_equal(expected, array.toarray())
예제 #4
0
def test_array_eval():

    x = sdb.ones(4)
    q = sdb.afl.apply(x, 'g', 'f0 + 3').query
    array = SciDBArray.from_query(sdb, q)
    assert array.name == q

    array.eval()
    assert array.name != q

    expected = array.toarray()
    np.testing.assert_array_equal(expected, array.toarray())