On Wed, Oct 15, 2008 at 4:12 PM, Fredrik Johansson
<[EMAIL PROTECTED]> wrote:
>
> On Wed, Oct 15, 2008 at 3:56 PM, Ondrej Certik <[EMAIL PROTECTED]> wrote:
>
>> Indeed, me too. Could you please Fredrik (or anyone else) prepare a patch?
>
> I don't have time at the moment (I made the release so I could take a
> break for the next few days).
>
> A few updates to SymPy will be needed, mainly due to the fact that
> many of the functions used by evalf.py have been renamed. This should
> be straightforward to fix by search-and-replace (the use of explicit
> imports helps here :-). Some SymPy functions should also be updated to
> use new mpmath features (see e.g. issue 1094, Bernoulli numbers).

I went ahead, spent about an hour fixing it:

http://github.com/certik/sympy/commits/mpmath3

But a lot more work is needed.

Unfortunately, I now encountered a more serious problem with x[0] and
x._mpf_[0]. Here is how to reproduce (Kirill, is there an easier way
to checkout the remote branch?):

$ git clone git://github.com/certik/sympy.git
$ cd sympy
$ git pull origin mpmath3:mpmath3
$ git checkout mpmath3
$ py.test sympy/core/tests/test_evalf.py
============================= test process starts ==============================
executable:   /usr/bin/python  (2.5.2-final-0)
using py lib: /usr/lib/python2.5/site-packages/py <rev unknown>

sympy/core/tests/test_evalf.py[18] .FFFFFFFFFFFFFFF.F

[...]

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def __add__(self, other):
        try:
            other = _sympify(other)
        except SympifyError:
            return NotImplemented
        if (other is S.NaN) or (self is NaN):
            return S.NaN
        if isinstance(other, Number):
            rhs, prec = other._as_mpf_op(self._prec)
>           return Real._new(mlib.mpf_add(self._mpf_, rhs, prec, rnd), prec)

[/tmp/mp/sympy/sympy/core/numbers.py:328]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def mpf_add(s, t, prec, rnd=round_fast):
E       if t[2] > s[2]:
>       TypeError: 'mpf' object is unindexable

[/tmp/mp/sympy/sympy/mpmath/libmpf.py:607]
________________________________________________________________________________
============= tests finished: 2 passed, 16 failed in 0.18 seconds ==============
DO *NOT* COMMIT!



See also these patches I had to commit to fix similar problems:

http://github.com/certik/sympy/commit/f0e1ecf2d8122a3c35d4566770d97f89cb6bbb48
http://github.com/certik/sympy/commit/d2ff029911dee9810dc6ce72498c6fe1feb9980e

I don't like the way I fixed that. Fredrik, do you think you could
please look into that? I think we'll release with our old mpmath, as
that is well tested and works. And import the new mpmath into our next
release, so that we have enough time to discover and fix bugs.

Ondrej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to