コード例 #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
ファイル: test_sql_compute.py プロジェクト: Webs234/blaze
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
ファイル: test_numpy_compute.py プロジェクト: Webs234/blaze
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
ファイル: test_table.py プロジェクト: testmana2/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)
コード例 #13
0
ファイル: test_table.py プロジェクト: testmana2/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))