On Wed, Feb 6, 2013 at 11:34 PM, Case Van Horsen <[email protected]> wrote:
> On Wed, Feb 6, 2013 at 10:38 PM, Ondřej Čertík <[email protected]> 
> wrote:
>> On Tue, Feb 5, 2013 at 10:28 PM, Case Van Horsen <[email protected]> wrote:
>>> On Tue, Feb 5, 2013 at 5:42 PM, Aaron Meurer <[email protected]> wrote:
>>>> On Tue, Feb 5, 2013 at 5:46 PM, Ondřej Čertík <[email protected]> 
>>>> wrote:
>>>>> Hi Case!
>>>>>
>>>>> Thanks for working on this. I have finally found time and added gmpy
>>>>> support into our Travis-CI testing:
>>>>>
>>>>> https://github.com/sympy/sympy/pull/1756
>>>>>
>>>>> the tests discovered a few minor gmpy failures today:
>>>>>
>>>>> http://code.google.com/p/sympy/issues/detail?id=3616
>>>>>
>>>>> Btw, I also noticed, that gmpy2 doesn't have the sqrt method, required
>>>>> by mpmath.
>>>
>>> In gmpy2, I added support for MPFR and MPC and one of the goals was to
>>> make gmpy2 follow existing Python conventions as much as possible.
>>> gmpy2.sqrt now returns an mpfr type and gmpy2.isqrt returns the
>>> integer square root.
>>>
>>> The mpmath repository includes a couple fixes for gmpy2. For example,
>>> one of fixes in mpmath is
>>>
>>> if BACKEND == 'gmpy':
>>>     if gmpy.version() >= "2":
>>>         isqrt_small = isqrt_fast = isqrt = gmpy.isqrt
>>>         sqrtrem = gmpy.isqrt_rem
>>>     else:
>>>         isqrt_small = isqrt_fast = isqrt = gmpy.sqrt
>>>         sqrtrem = gmpy.sqrtrem
>>>
>>> I've follwed a similar approach in sympy.
>>>
>>> casevh
>>>>
>>>> From the previous response: "gmpy duplicated almost all function calls
>>>> with method calls; gmpy2 removes most of duplicate method calls". So I
>>>> guess sqrt is only a function in gmpy2.
>>
>> I see. Thanks a lot for fixing it.
>>
>> Ondrej
>
> I created issue 3622 and uploaded a patch. All the tests pass on my
> machine with either gmpy or gmpy2. The sympy test uncovered a bug in
> gmpy2 so I'll release a new beta version in a few days.

Awesome, thanks a lot! Here is the PR with your patch:

https://github.com/sympy/sympy/pull/1762

you can watch the Travis tests over there.

> I haven't quite figured git yet so I thought I'd get the patch out there.

That was very helpful. In case you are curious what I did with your patch:

git co -b gmpy
git apply 
~/Downloads/0001-Changes-to-support-gmpy-1.13-or-later-or-gmpy2-2.0.0.patch
git ci -a --author="Case Van Horsen <[email protected]>"
# copy & pasted your git log, formatted it to nicely fit the first line
git push ondrej gmpy

went to github, clicked send pull request and that's it.

Ondrej

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to