Beispiel #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)
Beispiel #2
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)
Beispiel #3
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))
def test_unary_op():
    assert (compute(exp(t['amount']), df) == np.exp(df['amount'])).all()
Beispiel #5
0
def test_unary_op():
    assert (compute(exp(t['amount']), df) == np.exp(df['amount'])).all()
Beispiel #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))
def test_UnaryOp():
    assert eq(compute(exp(t['amount']), x),
              np.exp(x['amount']))
Beispiel #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']))
Beispiel #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)
Beispiel #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)
Beispiel #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"]))
Beispiel #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)
Beispiel #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))