[sympy/f12/master] Patch around BZ #564504.

Jussi Lehtola jussilehtola at fedoraproject.org
Mon Sep 6 18:06:13 UTC 2010


commit 4f194d19ec0ae9a9c811e2f794633775f40205fa
Author: Jussi Lehtola <jussilehtola at fedoraproject.org>
Date:   Mon Sep 6 21:06:17 2010 +0300

    Patch around BZ #564504.

 sympy-0.6.7-mpf.patch                  |  108 ++++++++++
 sympy-0.6.7-strip-internal-mpmath.diff |  366 ++++++++++++++++++++++++++++++++
 sympy-python27.patch                   |   13 ++
 3 files changed, 487 insertions(+), 0 deletions(-)
---
diff --git a/sympy-0.6.7-mpf.patch b/sympy-0.6.7-mpf.patch
new file mode 100644
index 0000000..f4a35bd
--- /dev/null
+++ b/sympy-0.6.7-mpf.patch
@@ -0,0 +1,108 @@
+Index: sympy-0.6.7/sympy/core/numbers.py
+===================================================================
+--- sympy-0.6.7.orig/sympy/core/numbers.py
++++ sympy-0.6.7/sympy/core/numbers.py
+@@ -1040,6 +1040,7 @@ class Zero(Integer):
+ 
+     p = 0
+     q = 1
++    _mpf_ = (0, 0L, 0, 0)
+     is_positive = False
+     is_negative = False
+     is_finite = False
+@@ -1082,6 +1083,7 @@ class One(Integer):
+ 
+     p = 1
+     q = 1
++    _mpf_ = (0, 1L, 0, 1)
+ 
+     is_prime = True
+ 
+@@ -1110,6 +1112,7 @@ class NegativeOne(Integer):
+ 
+     p = -1
+     q = 1
++    _mpf_ = (1, 1L, 0, 1)
+ 
+     __slots__ = []
+ 
+@@ -1150,6 +1153,7 @@ class Half(Rational):
+ 
+     p = 1
+     q = 2
++    _mpf_ = (0, 1L, -1, 1)
+ 
+     __slots__ = []
+ 
+@@ -1163,6 +1167,7 @@ class Infinity(Rational):
+ 
+     p = 1
+     q = 0
++    _mpf_ = mpmath.inf._mpf_
+ 
+     __slots__ = []
+ 
+@@ -1236,6 +1241,7 @@ class NegativeInfinity(Rational):
+ 
+     p = -1
+     q = 0
++    _mpf_ = mpmath.ninf._mpf_
+ 
+     __slots__ = []
+ 
+@@ -1303,6 +1309,7 @@ class NaN(Rational):
+ 
+     p = 0
+     q = 0
++    _mpf_ = mpmath.nan._mpf_
+ 
+     is_commutative = True
+     is_real = None
+@@ -1440,6 +1447,7 @@ class NumberSymbol(Atom):
+ 
+ class Exp1(NumberSymbol):
+ 
++    _mpf_ = mpmath.e._mpf_
+     is_real = True
+     is_positive = True
+     is_negative = False # XXX Forces is_negative/is_nonnegative
+@@ -1469,6 +1477,7 @@ class Exp1(NumberSymbol):
+ 
+ class Pi(NumberSymbol):
+ 
++    _mpf_ = mpmath.pi._mpf_
+     is_real = True
+     is_positive = True
+     is_negative = False
+@@ -1495,6 +1504,7 @@ class Pi(NumberSymbol):
+ 
+ class GoldenRatio(NumberSymbol):
+ 
++    _mpf_ = mpmath.phi._mpf_
+     is_real = True
+     is_positive = True
+     is_negative = False
+@@ -1520,6 +1530,7 @@ class GoldenRatio(NumberSymbol):
+ 
+ class EulerGamma(NumberSymbol):
+ 
++    _mpf_ = mpmath.euler._mpf_
+     is_real = True
+     is_positive = True
+     is_negative = False
+@@ -1543,6 +1554,7 @@ class EulerGamma(NumberSymbol):
+ 
+ class Catalan(NumberSymbol):
+ 
++    _mpf_ = mpmath.catalan._mpf_
+     is_real = True
+     is_positive = True
+     is_negative = False
+@@ -1566,6 +1578,7 @@ class Catalan(NumberSymbol):
+ class ImaginaryUnit(Atom):
+     __metaclass__ = SingletonMeta
+ 
++    _mpc_ = mpmath.j._mpc_
+     is_commutative = True
+     is_imaginary = True
+     is_bounded = True
diff --git a/sympy-0.6.7-strip-internal-mpmath.diff b/sympy-0.6.7-strip-internal-mpmath.diff
new file mode 100644
index 0000000..4fc246e
--- /dev/null
+++ b/sympy-0.6.7-strip-internal-mpmath.diff
@@ -0,0 +1,366 @@
+diff -up sympy-0.6.7/examples/advanced/pidigits.py.mpmath sympy-0.6.7/examples/advanced/pidigits.py
+--- sympy-0.6.7/examples/advanced/pidigits.py.mpmath	2010-01-28 23:54:00.000000000 +0200
++++ sympy-0.6.7/examples/advanced/pidigits.py	2010-04-27 08:52:43.405300743 +0300
+@@ -5,8 +5,8 @@ Example shows arbitrary precision using 
+ computation of the digits of pi.
+ """
+ 
+-from sympy.mpmath import libmpf
+-from sympy.mpmath import functions as mpf_funs
++from mpmath import libmpf
++from mpmath import functions as mpf_funs
+ 
+ import math
+ from time import clock
+diff -up sympy-0.6.7/setup.py.mpmath sympy-0.6.7/setup.py
+--- sympy-0.6.7/setup.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/setup.py	2010-04-27 08:50:51.168363641 +0300
+@@ -63,11 +63,6 @@ modules = [
+     'sympy.logic',
+     'sympy.logic.algorithms',
+     'sympy.logic.utilities',
+-    'sympy.mpmath',
+-    'sympy.mpmath.libmp',
+-    'sympy.mpmath.functions',
+-    'sympy.mpmath.matrices',
+-    'sympy.mpmath.calculus',
+     'sympy.polys',
+     'sympy.printing',
+     'sympy.printing.pretty',
+@@ -169,7 +164,6 @@ tests = [
+     'sympy.integrals.tests',
+     'sympy.logic.tests',
+     'sympy.matrices.tests',
+-    'sympy.mpmath.tests',
+     'sympy.ntheory.tests',
+     'sympy.parsing.tests',
+     'sympy.physics.tests',
+diff -up sympy-0.6.7/sympy/core/basic.py.mpmath sympy-0.6.7/sympy/core/basic.py
+--- sympy-0.6.7/sympy/core/basic.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/sympy/core/basic.py	2010-04-27 08:51:31.264239225 +0300
+@@ -1,6 +1,6 @@
+ """Base class for all objects in sympy"""
+ 
+-import sympy.mpmath as mpmath
++import mpmath
+ 
+ from decorators import _sympifyit
+ from assumptions import AssumeMeths, make__get_assumption
+diff -up sympy-0.6.7/sympy/core/evalf.py.mpmath sympy-0.6.7/sympy/core/evalf.py
+--- sympy-0.6.7/sympy/core/evalf.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/sympy/core/evalf.py	2010-04-27 08:50:51.169363495 +0300
+@@ -3,21 +3,21 @@ Adaptive numerical evaluation of SymPy e
+ for mathematical functions.
+ """
+ 
+-from sympy.mpmath.libmp import (from_int, from_rational, fzero, normalize,
++from mpmath.libmp import (from_int, from_rational, fzero, normalize,
+         bitcount, round_nearest, to_str, fone, fnone, fhalf, from_float,
+         to_float, fnone, to_int, mpf_lt, mpf_sqrt, mpf_cmp, mpf_abs,
+         mpf_pow_int, mpf_shift, mpf_add, mpf_mul, mpf_neg)
+ 
+-import sympy.mpmath.libmp as libmp
+-from sympy.mpmath.libmp.libmpf import dps_to_prec
+-from sympy.mpmath import mpf, mpc, quadts, quadosc, mp, make_mpf
+-from sympy.mpmath.libmp import (mpf_pi, mpf_log, mpf_pow, mpf_sin, mpf_cos,
++import mpmath.libmp as libmp
++from mpmath.libmp.libmpf import dps_to_prec
++from mpmath import mpf, mpc, quadts, quadosc, mp, make_mpf
++from mpmath.libmp import (mpf_pi, mpf_log, mpf_pow, mpf_sin, mpf_cos,
+         mpf_atan, mpf_atan2, mpf_e, mpf_exp, from_man_exp)
+-from sympy.mpmath.libmp.backend import MPZ
+-from sympy.mpmath import nsum
+-from sympy.mpmath import inf as mpmath_inf
++from mpmath.libmp.backend import MPZ
++from mpmath import nsum
++from mpmath import inf as mpmath_inf
+ 
+-from sympy.mpmath.libmp.gammazeta import mpf_bernoulli
++from mpmath.libmp.gammazeta import mpf_bernoulli
+ 
+ import math
+ 
+diff -up sympy-0.6.7/sympy/core/function.py.mpmath sympy-0.6.7/sympy/core/function.py
+--- sympy-0.6.7/sympy/core/function.py.mpmath	2010-03-17 22:37:28.000000000 +0200
++++ sympy-0.6.7/sympy/core/function.py	2010-04-27 09:32:14.636301031 +0300
+@@ -40,7 +40,7 @@ from multidimensional import vectorize
+ from sympy.utilities.decorator import deprecated
+ from sympy.utilities import all
+ 
+-from sympy import mpmath
++import mpmath
+ 
+ class PoleError(Exception):
+     pass
+diff -up sympy-0.6.7/sympy/core/numbers.py.mpmath sympy-0.6.7/sympy/core/numbers.py
+--- sympy-0.6.7/sympy/core/numbers.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/sympy/core/numbers.py	2010-04-27 08:50:51.170363259 +0300
+@@ -1,9 +1,9 @@
+ from basic import Atom, SingletonMeta, S, Basic
+ from decorators import _sympifyit
+ from cache import Memoizer, cacheit, clear_cache
+-import sympy.mpmath as mpmath
+-import sympy.mpmath.libmp as mlib
+-from sympy.mpmath.libmp import mpf_pow, mpf_pi, mpf_e, phi_fixed
++import mpmath as mpmath
++import mpmath.libmp as mlib
++from mpmath.libmp import mpf_pow, mpf_pi, mpf_e, phi_fixed
+ import decimal
+ 
+ rnd = mlib.round_nearest
+diff -up sympy-0.6.7/sympy/core/power.py.mpmath sympy-0.6.7/sympy/core/power.py
+--- sympy-0.6.7/sympy/core/power.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/sympy/core/power.py	2010-04-27 09:33:29.416300946 +0300
+@@ -3,7 +3,7 @@ from sympify import _sympify
+ from cache import cacheit
+ from symbol import Symbol, Wild
+ 
+-from sympy import mpmath
++import mpmath
+ 
+ from math import log as _log
+ 
+diff -up sympy-0.6.7/sympy/core/sets.py.mpmath sympy-0.6.7/sympy/core/sets.py
+--- sympy-0.6.7/sympy/core/sets.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/sympy/core/sets.py	2010-04-27 08:55:33.639300968 +0300
+@@ -1,6 +1,6 @@
+ from basic import Basic, SingletonMeta, S
+ from sympify import _sympify
+-from sympy.mpmath import mpi
++from mpmath import mpi
+ 
+ class Set(Basic):
+     """
+diff -up sympy-0.6.7/sympy/core/tests/test_numbers.py.mpmath sympy-0.6.7/sympy/core/tests/test_numbers.py
+--- sympy-0.6.7/sympy/core/tests/test_numbers.py.mpmath	2010-03-10 00:09:45.000000000 +0200
++++ sympy-0.6.7/sympy/core/tests/test_numbers.py	2010-04-27 09:32:39.883300975 +0300
+@@ -4,7 +4,7 @@ from sympy.core.power import integer_nth
+ 
+ from sympy.core.numbers import igcd, ilcm, igcdex, seterr
+ from sympy.utilities.pytest import raises
+-from sympy import mpmath
++import mpmath
+ 
+ def test_seterr():
+     seterr(divide = True)
+diff -up sympy-0.6.7/sympy/core/tests/test_sets.py.mpmath sympy-0.6.7/sympy/core/tests/test_sets.py
+--- sympy-0.6.7/sympy/core/tests/test_sets.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/sympy/core/tests/test_sets.py	2010-04-27 08:55:04.312301024 +0300
+@@ -1,5 +1,5 @@
+ from sympy import Symbol, Set, Union, Interval, oo, S, Inequality, max_, min_, raises
+-from sympy.mpmath import mpi
++from mpmath import mpi
+ 
+ def test_interval_arguments():
+     assert Interval(0, oo) == Interval(0, oo, False, True)
+diff -up sympy-0.6.7/sympy/functions/combinatorial/numbers.py.mpmath sympy-0.6.7/sympy/functions/combinatorial/numbers.py
+--- sympy-0.6.7/sympy/functions/combinatorial/numbers.py.mpmath	2010-03-17 22:37:28.000000000 +0200
++++ sympy-0.6.7/sympy/functions/combinatorial/numbers.py	2010-04-27 08:58:34.753300999 +0300
+@@ -9,7 +9,7 @@ the separate 'factorials' module.
+ 
+ from sympy import Function, S, Symbol, Rational, oo, Integer, C
+ 
+-from sympy.mpmath import bernfrac
++from mpmath import bernfrac
+ 
+ from sympy.utilities.decorator import deprecated
+ 
+diff -up sympy-0.6.7/sympy/functions/special/error_functions.py.mpmath sympy-0.6.7/sympy/functions/special/error_functions.py
+--- sympy-0.6.7/sympy/functions/special/error_functions.py.mpmath	2010-03-17 22:37:28.000000000 +0200
++++ sympy-0.6.7/sympy/functions/special/error_functions.py	2010-04-27 08:58:16.129301012 +0300
+@@ -70,6 +70,6 @@ class erf(Function):
+         if arg.is_Number:
+             # XXX: Temporary hack. FIX THIS
+             from sympy.core.numbers import Real
+-            from sympy.mpmath import erf
++            from mpmath import erf
+             e = erf(float(arg))
+             return Real(str(e))
+diff -up sympy-0.6.7/sympy/matrices/matrices.py.mpmath sympy-0.6.7/sympy/matrices/matrices.py
+--- sympy-0.6.7/sympy/matrices/matrices.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/sympy/matrices/matrices.py	2010-04-27 08:54:06.171176365 +0300
+@@ -804,7 +804,7 @@ class Matrix(object):
+         self is the coefficient matrix A and rhs is the right side b.
+ 
+         This is for symbolic matrices, for real or complex ones use
+-        sympy.mpmath.lu_solve or sympy.mpmath.qr_solve.
++        mpmath.lu_solve or mpmath.qr_solve.
+         """
+         assert rhs.rows == self.rows
+         A, perm = self.LUdecomposition_Simple(iszerofunc=_iszero)
+@@ -1023,7 +1023,7 @@ class Matrix(object):
+         to use QRsolve.
+ 
+         This is mainly for educational purposes and symbolic matrices, for real
+-        (or complex) matrices use sympy.mpmath.qr_solve.
++        (or complex) matrices use mpmath.qr_solve.
+         """
+ 
+         Q, R = self.QRdecomposition()
+diff -up sympy-0.6.7/sympy/ntheory/partitions_.py.mpmath sympy-0.6.7/sympy/ntheory/partitions_.py
+--- sympy-0.6.7/sympy/ntheory/partitions_.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/sympy/ntheory/partitions_.py	2010-04-27 08:50:51.171363156 +0300
+@@ -1,4 +1,4 @@
+-from sympy.mpmath.libmp import (fzero,
++from mpmath.libmp import (fzero,
+     from_man_exp, from_int, from_rational,
+     fone, ftwo, fhalf, bitcount, to_int, to_str, mpf_mul, mpf_div, mpf_sub,
+     mpf_add,
+diff -up sympy-0.6.7/sympy/polys/integerpolys.py.mpmath sympy-0.6.7/sympy/polys/integerpolys.py
+--- sympy-0.6.7/sympy/polys/integerpolys.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/sympy/polys/integerpolys.py	2010-04-27 08:50:51.173363035 +0300
+@@ -15,7 +15,7 @@ from math import floor, ceil, log, sqrt
+ from random import randint
+ 
+ from sympy.core.numbers import igcd, igcdex
+-from sympy.mpmath.libmp import isqrt
++from mpmath.libmp import isqrt
+ 
+ INT_TYPE = int
+ INT_ZERO = 0
+diff -up sympy-0.6.7/sympy/printing/latex.py.mpmath sympy-0.6.7/sympy/printing/latex.py
+--- sympy-0.6.7/sympy/printing/latex.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/sympy/printing/latex.py	2010-04-27 08:50:51.174363059 +0300
+@@ -8,8 +8,8 @@ from conventions import split_super_sub
+ from sympy.simplify import fraction
+ from sympy import Interval
+ 
+-import sympy.mpmath.libmp as mlib
+-from sympy.mpmath.libmp import prec_to_dps
++import mpmath.libmp as mlib
++from mpmath.libmp import prec_to_dps
+ 
+ import re
+ 
+diff -up sympy-0.6.7/sympy/printing/repr.py.mpmath sympy-0.6.7/sympy/printing/repr.py
+--- sympy-0.6.7/sympy/printing/repr.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/sympy/printing/repr.py	2010-04-27 08:50:51.174363059 +0300
+@@ -8,8 +8,8 @@ relation eval(srepr(expr))=expr holds in
+ from printer import Printer
+ from sympy.printing.precedence import precedence
+ from sympy.core import Basic
+-import sympy.mpmath.libmp as mlib
+-from sympy.mpmath.libmp import prec_to_dps, repr_dps
++import mpmath.libmp as mlib
++from mpmath.libmp import prec_to_dps, repr_dps
+ 
+ class ReprPrinter(Printer):
+     printmethod = "_sympyrepr_"
+diff -up sympy-0.6.7/sympy/printing/str.py.mpmath sympy-0.6.7/sympy/printing/str.py
+--- sympy-0.6.7/sympy/printing/str.py.mpmath	2010-03-17 22:37:37.000000000 +0200
++++ sympy-0.6.7/sympy/printing/str.py	2010-04-27 08:50:51.175363132 +0300
+@@ -10,8 +10,8 @@ from sympy.core.power import Pow
+ from sympy.core.symbol import Symbol, Wild
+ from sympy.core.basic import Basic
+ 
+-import sympy.mpmath.libmp as mlib
+-from sympy.mpmath.libmp import prec_to_dps
++import mpmath.libmp as mlib
++from mpmath.libmp import prec_to_dps
+ 
+ class StrPrinter(Printer):
+     printmethod = "_sympystr_"
+diff -up sympy-0.6.7/sympy/simplify/simplify.py.mpmath sympy-0.6.7/sympy/simplify/simplify.py
+--- sympy-0.6.7/sympy/simplify/simplify.py.mpmath	2010-03-17 22:37:28.000000000 +0200
++++ sympy-0.6.7/sympy/simplify/simplify.py	2010-04-27 08:53:12.251300999 +0300
+@@ -14,7 +14,7 @@ from sympy.simplify.cse_main import cse
+ 
+ from sympy.polys import Poly, factor, PolynomialError
+ 
+-import sympy.mpmath as mpmath
++import mpmath
+ 
+ def fraction(expr, exact=False):
+     """Returns a pair with expression's numerator and denominator.
+diff -up sympy-0.6.7/sympy/solvers/solvers.py.mpmath sympy-0.6.7/sympy/solvers/solvers.py
+--- sympy-0.6.7/sympy/solvers/solvers.py.mpmath	2010-03-10 00:09:45.000000000 +0200
++++ sympy-0.6.7/sympy/solvers/solvers.py	2010-04-27 08:57:48.546300975 +0300
+@@ -30,7 +30,7 @@ from sympy.functions.elementary.piecewis
+ from sympy.utilities import any, all
+ from sympy.utilities.iterables import iff
+ from sympy.utilities.lambdify import lambdify
+-from sympy.mpmath import findroot
++from mpmath import findroot
+ 
+ from sympy.solvers.polysys import solve_poly_system
+ 
+@@ -746,7 +746,8 @@ def nsolve(*args, **kwargs):
+ 
+     >>> from sympy import Symbol, nsolve
+     >>> import sympy
+-    >>> sympy.mpmath.mp.dps = 15
++    >>> import mpmath 
++    >>> mpmath.mp.dps = 15
+     >>> x1 = Symbol('x1')
+     >>> x2 = Symbol('x2')
+     >>> f1 = 3 * x1**2 - 2 * x2**2 - 1
+diff -up sympy-0.6.7/sympy/solvers/tests/test_numeric.py.mpmath sympy-0.6.7/sympy/solvers/tests/test_numeric.py
+--- sympy-0.6.7/sympy/solvers/tests/test_numeric.py.mpmath	2010-01-28 23:54:00.000000000 +0200
++++ sympy-0.6.7/sympy/solvers/tests/test_numeric.py	2010-04-27 08:57:01.284300981 +0300
+@@ -1,4 +1,4 @@
+-from sympy.mpmath import mnorm, mpf
++from mpmath import mnorm, mpf
+ from sympy.solvers import nsolve
+ from sympy.utilities.lambdify import lambdify
+ from sympy import Symbol, Matrix, sqrt, Eq
+diff -up sympy-0.6.7/sympy/statistics/distributions.py.mpmath sympy-0.6.7/sympy/statistics/distributions.py
+--- sympy-0.6.7/sympy/statistics/distributions.py.mpmath	2010-02-16 01:30:47.000000000 +0200
++++ sympy-0.6.7/sympy/statistics/distributions.py	2010-04-27 08:54:35.546300698 +0300
+@@ -129,7 +129,7 @@ class Normal(ContinuousProbability):
+         # error function is not yet implemented in SymPy but can easily be
+         # computed numerically
+ 
+-        from sympy.mpmath import mpf, erfinv
++        from mpmath import mpf, erfinv
+ 
+         # calculate y = ierf(p) by solving erf(y) - p = 0
+         y = erfinv(mpf(p))
+diff -up sympy-0.6.7/sympy/statistics/tests/test_statistics.py.mpmath sympy-0.6.7/sympy/statistics/tests/test_statistics.py
+--- sympy-0.6.7/sympy/statistics/tests/test_statistics.py.mpmath	2010-01-28 23:54:00.000000000 +0200
++++ sympy-0.6.7/sympy/statistics/tests/test_statistics.py	2010-04-27 08:54:23.178301026 +0300
+@@ -4,7 +4,7 @@ from sympy.statistics import Normal, Uni
+ from sympy.statistics.distributions import PDF
+ import operator # XXX weird abs/sympy.abs conflict
+ 
+-from sympy.mpmath import mp
++from mpmath import mp
+ 
+ def test_normal():
+     dps, mp.dps = mp.dps, 20
+diff -up sympy-0.6.7/sympy/test_external/test_numpy.py.mpmath sympy-0.6.7/sympy/test_external/test_numpy.py
+--- sympy-0.6.7/sympy/test_external/test_numpy.py.mpmath	2010-03-17 22:37:28.000000000 +0200
++++ sympy-0.6.7/sympy/test_external/test_numpy.py	2010-04-27 08:50:51.176363100 +0300
+@@ -17,7 +17,7 @@ from sympy import (Rational, Symbol, lis
+         symarray, symbols)
+ import sympy
+ 
+-from sympy import mpmath
++import mpmath
+ mpmath.mp.dps = 16
+ sin02 = mpmath.mpf("0.198669330795061215459412627")
+ 
+diff -up sympy-0.6.7/sympy/utilities/lambdify.py.mpmath sympy-0.6.7/sympy/utilities/lambdify.py
+--- sympy-0.6.7/sympy/utilities/lambdify.py.mpmath	2010-03-17 22:37:28.000000000 +0200
++++ sympy-0.6.7/sympy/utilities/lambdify.py	2010-04-27 08:56:39.365300857 +0300
+@@ -58,7 +58,7 @@ NUMPY_TRANSLATIONS = {
+ # Available modules:
+ MODULES = {
+     "math":(MATH, MATH_TRANSLATIONS, ("from math import *",)),
+-    "mpmath":(MPMATH, MPMATH_TRANSLATIONS, ("from sympy.mpmath import *",)),
++    "mpmath":(MPMATH, MPMATH_TRANSLATIONS, ("from mpmath import *",)),
+     "numpy":(NUMPY, NUMPY_TRANSLATIONS, ("from numpy import *",)),
+     "sympy":(SYMPY, {}, ("from sympy.functions import *",
+                          "from sympy.matrices import Matrix",
+diff -up sympy-0.6.7/sympy/utilities/runtests.py.mpmath sympy-0.6.7/sympy/utilities/runtests.py
+diff -up sympy-0.6.7/sympy/utilities/tests/test_lambdify.py.mpmath sympy-0.6.7/sympy/utilities/tests/test_lambdify.py
+--- sympy-0.6.7/sympy/utilities/tests/test_lambdify.py.mpmath	2010-01-28 23:54:00.000000000 +0200
++++ sympy-0.6.7/sympy/utilities/tests/test_lambdify.py	2010-04-27 09:32:59.977300954 +0300
+@@ -1,7 +1,7 @@
+ from sympy.utilities.pytest import XFAIL
+ from sympy import (symbols, lambdify, sqrt, sin, cos, pi, atan, Rational, Real,
+         Matrix, Lambda, exp, Integral, oo)
+-from sympy import mpmath
++import mpmath
+ import math, sympy
+ 
+ # high precision output of sin(0.2*pi) is used to detect if precision is lost unwanted
diff --git a/sympy-python27.patch b/sympy-python27.patch
new file mode 100644
index 0000000..fbdbbda
--- /dev/null
+++ b/sympy-python27.patch
@@ -0,0 +1,13 @@
+diff --git a/sympy/utilities/runtests.py b/sympy/utilities/runtests.py
+index 65f870a..6aaf935 100644
+--- a/sympy/utilities/runtests.py
++++ b/sympy/utilities/runtests.py
+@@ -779,7 +779,7 @@ class PyTestReporter(Reporter):
+         self.write_center("test process starts")
+         executable = sys.executable
+         v = sys.version_info
+-        python_version = "%s.%s.%s-%s-%s" % v
++        python_version = "%s.%s.%s-%s-%s" % tuple(v)
+         self.write("executable:   %s  (%s)\n\n" % (executable, python_version))
+         self._t_start = clock()
+ 


More information about the scm-commits mailing list