Skip to content

Commit

Permalink
Merge pull request #1113 from skirpichev/v0.12
Browse files Browse the repository at this point in the history
v0.12
  • Loading branch information
skirpichev committed Jan 18, 2021
2 parents c137255 + d5c99ee commit ad00f7f
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 32 deletions.
9 changes: 5 additions & 4 deletions diofant/tests/integrals/test_integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,10 +1153,6 @@ def test_sympyissue_8945():
assert integrate(cos(x)**2/x**2, x) == -Si(2*x) - cos(2*x)/(2*x) - 1/(2*x)


def test_diofantissue_303():
assert integrate((cos(x)/x)**2, (x, pi, 2*pi)) == Si(2*pi) - Si(4*pi) + 1/pi/2


@pytest.mark.slow
def test_sympyissue_7130():
integrand = (cos(pi*i*x/L)**2 / (a + b*x)).rewrite(exp)
Expand Down Expand Up @@ -1218,6 +1214,11 @@ def test_definite_integrals_abs():
assert integrate(e, (x, -17, 20)) == Rational(74481, 4)


def test_definite_integrals_other():
# issue diofant/diofant#303
assert integrate((cos(x)/x)**2, (x, pi, 2*pi)) == Si(2*pi) - Si(4*pi) + 1/pi/2


def test_sympyissue_12081():
assert integrate(x**(-Rational(3, 2))*exp(-x), (x, 0, oo)) == oo

Expand Down
7 changes: 3 additions & 4 deletions diofant/tests/polys/test_polytools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2345,6 +2345,9 @@ def test_factor():

assert factor(x**6 - 4*x**4 + 4*x**3 - x**2) == x**2*(x - 1)**2*(x**2 + 2*x - 1)

# issue sympy/sympy#9607
assert factor(1e-20*x - 7.292115e-5) == 1e-20*x - 7.292115e-5


def test_factor_large():
f = (x**2 + 4*x + 4)**10000000*(x**2 + 1)*(x**2 + 2*x + 1)**1234567
Expand Down Expand Up @@ -3056,10 +3059,6 @@ def test_to_rational_coeffs():
assert to_rational_coeffs((x**5 + sqrt(2)*x**2 + 1).as_poly(x, domain=EX)) is None


def test_sympyissue_9607():
assert factor(1e-20*x - 7.292115e-5) == 1e-20*x - 7.292115e-5


def test_sympyissue_8754():
z = 0.0001*(x*(x + (4.0*y))) + 0.0001*(y*(x + (4.0*y)))
w = expand(z)
Expand Down
7 changes: 3 additions & 4 deletions diofant/tests/series/test_gruntz.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ def test_intractable():
assert limitinf(airyai(2 + 1/x), x) == airyai(2)
assert limitinf(airybi(2 + 1/x), x) == airybi(2)

# issue sympy/sympy#10976
assert limitinf(erf(m/x)/erf(1/x), x) == m


def test_branch_cuts():
assert limitinf(sqrt(-1 + I/x), x) == +I
Expand Down Expand Up @@ -489,7 +492,3 @@ def test_sympyissue_8241():
e = x/log(x)**(log(x)/(m*log(log(x))))
pytest.raises(NotImplementedError, lambda: limitinf(e, x))
assert isinstance(e.limit(x, oo), Limit)


def test_sympyissue_10976():
assert limitinf(erf(m/x)/erf(1/x), x) == m
9 changes: 4 additions & 5 deletions diofant/tests/series/test_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ def test_basic4():
l = Limit(Piecewise((x, x > 1), (0, True)), x, -1)
assert l.doit() == l

# issue sympy/sympy#16714
e = ((n**(n + 1) + (n + 1)**n)/n**(n + 1))**n
assert limit(e, n, oo) == E**E


def test_basic5():
class MyFunction(Function):
Expand Down Expand Up @@ -652,11 +656,6 @@ def test_sympyissue_16222():
assert limit(exp(x), x, 1000000000) == exp(1000000000)


def test_sympyissue_16714():
e = ((n**(n + 1) + (n + 1)**n)/n**(n + 1))**n
assert limit(e, n, oo) == E**E


@pytest.mark.timeout(20)
def test_sympyissue_15282():
assert limit((x**2000 - (x + 1)**2000)/x**1999, x, oo) == -2000
Expand Down
6 changes: 4 additions & 2 deletions diofant/tests/simplify/test_cse.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ def test_powers():
assert cse(x*y**2 + x*y) == ([(x0, x*y)], [x0*y + x0])


def test_sympyissue_4498():
def test_basic_optimization():
# issue sympy/sympy#4498
assert cse(w/(x - y) + z/(y - x), optimizations='basic') == \
([], [(w - z)/(x - y)])

Expand Down Expand Up @@ -375,7 +376,8 @@ def test_sympyissue_7840():
assert len(substitutions) < 1


def test_sympyissue_8891():
def test_matrices():
# issue sympy/sympy#8891
for cls in (MutableDenseMatrix, MutableSparseMatrix,
ImmutableDenseMatrix, ImmutableSparseMatrix):
m = cls(2, 2, [x + y, 0, 0, 0])
Expand Down
9 changes: 4 additions & 5 deletions diofant/tests/simplify/test_hyperexpand.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def test_hyperexpand():
assert hyperexpand(f, place=0) == sqrt(pi)*z/sqrt(z**2 + 1)
assert hyperexpand(f, place=zoo) == sqrt(pi)/sqrt(1 + z**(-2))

# issue diofant/diofant#241
e = hyper((2, 3, 5, 9, 1), (1, 4, 6, 10), 1)
assert hyperexpand(e) == Rational(108, 7)


def can_do(ap, bq, numerical=True, div=1, lowerplane=False):
r = hyperexpand(hyper(ap, bq, z))
Expand Down Expand Up @@ -1095,11 +1099,6 @@ def test_sympyissue_6052():
assert hyperexpand(hyper((), (2,), 0)) == 1


def test_diofantissue_241():
e = hyper((2, 3, 5, 9, 1), (1, 4, 6, 10), 1)
assert hyperexpand(e) == Rational(108, 7)


def test_hyperexpand_doc():
from diofant.simplify.hyperexpand_doc import __doc__
assert __doc__[:91] == \
Expand Down
3 changes: 2 additions & 1 deletion diofant/tests/simplify/test_powsimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ def test_powsimp_polar():
sin(exp_polar(x + y))


def test_sympyissue_5728():
def test_powsimp_other():
# see also issue sympy/sympy#5728
b = x*sqrt(y)
a = sqrt(b)
c = sqrt(sqrt(x)*y)
Expand Down
3 changes: 2 additions & 1 deletion diofant/tests/simplify/test_sqrtdenest.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ def test_sqrt_symbolic_denest():
assert sqrtdenest(z) == z


def test_sympyissue_5857():
def test_sqrtdenest5():
# issue sympy/sympy#5857
z = sqrt(1/(4*r3 + 7) + 1)
ans = (r2 + r6)/(r3 + 2)
assert sqrtdenest(z) == ans
Expand Down
4 changes: 3 additions & 1 deletion diofant/tests/simplify/test_trigsimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ def test_trigsimp_old(capsys):
assert capsys.readouterr().out == '\tfutrig: tan(x)**2\n'


def test_sympyissue_2827_trigsimp_methods():
def test_trigsimp_methods():
# issue sympy/sympy#2827

def measure1(expr):
return len(str(expr))

Expand Down
3 changes: 2 additions & 1 deletion docs/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ All work should be submitted via `Pull Requests (PR)`_.
or adding comment with issue number).
2. All new functionality should be tested, every new line
should be covered by tests. Please use in tests only
public interfaces.
public interfaces. Regression tests are not accounted in
the coverage statistics.
3. Optionally, provide doctests to illustrate usage. But keep in
mind, doctests are not tests. Think of them as examples that
happen to be tested.
Expand Down
3 changes: 1 addition & 2 deletions docs/release/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ development work they do here in a user friendly format.

sympy
notes-0.[89]*
notes-0.1[01]*
Diofant 0.12 (Not Released Yet) <notes-0.12>
notes-0.1[0-2]*
4 changes: 2 additions & 2 deletions docs/release/notes-0.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Diofant 0.12
============

Not Released Yet
18 Jan 2021

New features
============
Expand Down Expand Up @@ -48,7 +48,7 @@ Developer changes
=================

* Depend on `flake8-sfs <https://github.com/peterjc/flake8-sfs>`_, see :pull:`983`.
* Depend on `mypy <http://mypy-lang.org/>`_, see :pull:`1022`.
* Depend on `mypy <http://mypy-lang.org/>`_, see :pull:`1046`.
* Drop dependency on strategies, see :pull:`1074`.

Issues closed
Expand Down

0 comments on commit ad00f7f

Please sign in to comment.