예제 #1
0
def test_symbol_printing_is_legible():
    accounts = symbol('accounts',
                      'var * {name: string, balance: int, id: int}')

    expr = (exp(accounts.balance * 10)) + accounts['id']
    assert "exp(accounts.balance * 10)" in str(expr)
    assert "+ accounts.id" in str(expr)
예제 #2
0
파일: test_table.py 프로젝트: Casolt/blaze
def test_TableSymbol_printing_is_legible():
    accounts = TableSymbol('accounts', '{name: string, balance: int, id: int}')

    expr = (exp(accounts['balance'] * 10)) + accounts['id']
    assert "exp(accounts['balance'] * 10)" in str(expr)
    assert "+ accounts['id']" in str(expr)
예제 #3
0
파일: test_table.py 프로젝트: Casolt/blaze
def test_unary_ops():
    t = TableSymbol('t', '{name: string, amount: int}')
    expr = cos(exp(t['amount']))
    assert 'cos' in str(expr)

    assert '~' in str(~(t.amount > 0))
예제 #4
0
def test_unary_op():
    assert (compute(exp(t['amount']), df) == np.exp(df['amount'])).all()
예제 #5
0
def test_unary_op():
    assert (compute(exp(t['amount']), df) == np.exp(df['amount'])).all()
예제 #6
0
def test_unary_ops():
    t = symbol('t', 'var * {name: string, amount: int}')
    expr = cos(exp(t['amount']))
    assert 'cos' in str(expr)

    assert '~' in str(~(t.amount > 0))
예제 #7
0
def test_UnaryOp():
    assert eq(compute(exp(t['amount']), x),
              np.exp(x['amount']))
예제 #8
0
def test_UnaryOp():
    assert eq(compute(exp(t['amount']), x), np.exp(x['amount']))

    assert eq(compute(abs(-t['amount']), x), abs(-x['amount']))
예제 #9
0
def test_unary_op():
    assert str(compute(exp(t['amount']), s, post_compute=False)) == \
        str(sa.func.exp(s.c.amount))

    assert str(compute(-t['amount'], s, post_compute=False)) == \
        str(-s.c.amount)
예제 #10
0
def test_unary_op():
    assert str(compute(exp(t['amount']), s, post_compute=False)) == \
        str(sa.func.exp(s.c.amount))

    assert str(compute(-t['amount'], s, post_compute=False)) == \
        str(-s.c.amount)
예제 #11
0
def test_UnaryOp():
    assert eq(compute(exp(t["amount"]), x), np.exp(x["amount"]))

    assert eq(compute(abs(-t["amount"]), x), abs(-x["amount"]))
예제 #12
0
def test_TableSymbol_printing_is_legible():
    accounts = TableSymbol("accounts", "{name: string, balance: int, id: int}")

    expr = (exp(accounts.balance * 10)) + accounts["id"]
    assert "exp(accounts.balance * 10)" in str(expr)
    assert "+ accounts.id" in str(expr)
예제 #13
0
def test_unary_ops():
    t = TableSymbol("t", "{name: string, amount: int}")
    expr = cos(exp(t["amount"]))
    assert "cos" in str(expr)

    assert "~" in str(~(t.amount > 0))