I help maintain the sympy package for the Fedora Linux distribution. The sympy package is distributed upstream with a bundled version of mpmath. The bundling runs afoul of Fedora policies, so we are required to rip it out and substitute the system mpmath package instead. The mpmath maintainer recently updated that package to version 0.19, and now the sympy test suite is failing like so:
_________ sympy/polys/tests/test_polyroots.py:test_roots_preprocessed __________
File "/builddir/build/BUILD/sympy-0.7.5/sympy/polys/tests/test_polyroots.py", line 440, in test_roots_preprocessed
R1 = roots(f.evalf(), x, multiple=True)
File "sympy/polys/polyroots.py", line 858, in roots
for r in f.nroots():
File "sympy/polys/polytools.py", line 3384, in nroots
coeffs, maxsteps=maxsteps, cleanup=cleanup, error=error)
File "/usr/lib/python2.7/site-packages/mpmath/calculus/polynomials.py", line 188, in polyroots
% maxsteps)
NoConvergence: Didn't converge in maxsteps=50 steps.
________________________________________________________________________________
_______________ sympy/polys/tests/test_polytools.py:test_nroots ________________
File "/builddir/build/BUILD/sympy-0.7.5/sympy/polys/tests/test_polytools.py", line 2657, in test_nroots
roots, error = Poly(x**2 - 1, x).nroots(error=True)
File "sympy/polys/polytools.py", line 3384, in nroots
coeffs, maxsteps=maxsteps, cleanup=cleanup, error=error)
File "/usr/lib/python2.7/site-packages/mpmath/calculus/polynomials.py", line 201, in polyroots
err = max(err, ctx.ldexp(1, -orig+1))
NameError: global name 'orig' is not defined
The second test failure appears to be due to a missing "orig = ctx.prec" in polyroots(). I don't know what is causing the first test failure. Any help figuring it out would be much appreciated. Thank you,