Skip to content

Commit 65595ed

Browse files
committed
Update hash, add (and test) a few imports to __init__.py
1 parent 4e7592b commit 65595ed

File tree

6 files changed

+31
-27
lines changed

6 files changed

+31
-27
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ build*
2929
MANIFEST
3030
*.egg-info
3131
dist/
32-
.cache/
32+
.*cache/
3333
symengine.egg-info/
3434

3535
# Temp files

symengine/__init__.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
from .lib.symengine_wrapper import (Symbol, S, sympify,
2-
SympifyError, Add, Mul, Pow, function_symbol, I, E, pi, oo,
3-
zoo, nan, have_mpfr, have_mpc, have_flint, have_piranha,
4-
have_llvm, Integer, Rational, Float, Number, RealNumber,
5-
RealDouble, ComplexDouble, Max, Min, DenseMatrix, Matrix,
6-
ImmutableMatrix, ImmutableDenseMatrix, MutableDenseMatrix,
7-
MatrixBase, Basic, DictBasic, symarray, series, diff, zeros,
8-
eye, diag, ones, Derivative, Subs, add, expand, has_symbol,
9-
UndefFunction, Function, FunctionSymbol as AppliedUndef,
10-
have_numpy, true, false, Equality, Unequality, GreaterThan,
11-
LessThan, StrictGreaterThan, StrictLessThan, Eq, Ne, Ge, Le,
12-
Gt, Lt, golden_ratio as GoldenRatio, catalan as Catalan,
13-
eulergamma as EulerGamma, Dummy, perfect_power, integer_nthroot,
14-
isprime, sqrt_mod, Expr, cse, count_ops)
1+
from .lib.symengine_wrapper import (
2+
have_mpfr, have_mpc, have_flint, have_piranha, have_llvm,
3+
I, E, pi, oo, zoo, nan, Symbol, Dummy, S, sympify, SympifyError,
4+
Integer, Rational, Float, Number, RealNumber, RealDouble, ComplexDouble,
5+
add, Add, Mul, Pow, function_symbol,
6+
Max, Min, DenseMatrix, Matrix,
7+
ImmutableMatrix, ImmutableDenseMatrix, MutableDenseMatrix,
8+
MatrixBase, Basic, DictBasic, symarray, series, diff, zeros,
9+
eye, diag, ones, Derivative, Subs, expand, has_symbol,
10+
UndefFunction, Function,
11+
have_numpy, true, false, Equality, Unequality, GreaterThan,
12+
LessThan, StrictGreaterThan, StrictLessThan, Eq, Ne, Ge, Le,
13+
Gt, Lt, And, Or, Not, Nand, Nor, Xor, Xnor, perfect_power, integer_nthroot,
14+
isprime, sqrt_mod, Expr, cse, count_ops, ccode, Piecewise, Contains, Interval, FiniteSet,
15+
FunctionSymbol as AppliedUndef,
16+
golden_ratio as GoldenRatio,
17+
catalan as Catalan,
18+
eulergamma as EulerGamma
19+
)
1520
from .utilities import var, symbols
1621
from .functions import *
1722

symengine/tests/test_functions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from symengine import (Symbol, sin, cos, sqrt, Add, Mul, function_symbol, Integer, log, E, symbols, I,
2-
Rational, EulerGamma, Function)
3-
from symengine.lib.symengine_wrapper import (Subs, Derivative, LambertW, zeta, dirichlet_eta,
4-
zoo, pi, KroneckerDelta, LeviCivita, erf, erfc,
5-
oo, lowergamma, uppergamma, exp, loggamma, beta,
6-
polygamma, digamma, trigamma, sign, floor, ceiling,
7-
conjugate, nan, Float)
1+
from symengine import (
2+
Symbol, sin, cos, sqrt, Add, Mul, function_symbol, Integer, log, E, symbols, I,
3+
Rational, EulerGamma, Function, Subs, Derivative, LambertW, zeta, dirichlet_eta,
4+
zoo, pi, KroneckerDelta, LeviCivita, erf, erfc, oo, lowergamma, uppergamma, exp,
5+
loggamma, beta, polygamma, digamma, trigamma, sign, floor, ceiling, conjugate,
6+
nan, Float
7+
)
88

99
import unittest
1010

symengine/tests/test_lambdify.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ def test_Lambdify_Piecewise():
8282
p = se.Piecewise((-x, x<0), (x*x*x, True))
8383
f = se.Lambdify([x], [p])
8484
arr = np.linspace(3, 7)
85-
assert np.all(f(-arr) == arr)
86-
assert np.all(f(arr) == arr**3)
85+
assert np.allclose(f(-arr).flat, arr, atol=1e-14, rtol=1e-15)
86+
assert np.allclose(f(arr).flat, arr**3, atol=1e-14, rtol=1e-15)
8787

8888

8989
@unittest.skipUnless(have_numpy, "Numpy not installed")

symengine/tests/test_printing.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from symengine import (ccode, Symbol, sqrt, Pow, Max, sin, Integer, MutableDenseMatrix)
12
from symengine.utilities import raises
2-
from symengine.lib.symengine_wrapper import (ccode, Symbol, sqrt, Pow, Max, sin, Integer, MutableDenseMatrix)
33
from symengine.printing import CCodePrinter
44

55
def test_ccode():
@@ -24,4 +24,3 @@ def test_CCodePrinter():
2424
assert myprinter.doprint(MutableDenseMatrix(1, 2, [x, y]), "larry") == "larry[0] = x;\nlarry[1] = y;"
2525
raises(TypeError, lambda: myprinter.doprint(sin(x), Integer))
2626
raises(RuntimeError, lambda: myprinter.doprint(MutableDenseMatrix(1, 2, [x, y])))
27-

symengine_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b3a2159b7e6950726157626069c30712427d55b2
1+
32d8612118a542b2fbd08feeeeac665c7c13ff65

0 commit comments

Comments
 (0)