[sage-devel] Re: Running MathicsSession inside Sage

2021-03-27 Thread seb....@gmail.com
Thanks to everyone who helped here somewhere along the way!

rocky.b...@gmail.com schrieb am Freitag, 26. März 2021 um 23:52:54 UTC+1:

> I asked about this in the mpmath group and the solution there I think is 
> good and only requires a change (or rather simplification) to the Mathics 
> code.
>
> So as far as I am concerned no changes are needed to sage or mpmath. See 
> https://groups.google.com/g/mpmath/c/qzA5gs57Qm8/m/_eg4GHisAAAJ
>
> On Friday, March 26, 2021 at 6:47:32 PM UTC-4 dim...@gmail.com wrote:
>
>> On Thursday, March 25, 2021 at 2:24:43 PM UTC seb@gmail.com wrote:
>>
>>> Hi,
>>>
>>> Did anyone try this before? At the moment this stucks at the following 
>>> issue:
>>>
>>> sage: import mpmath
>>> sage: mpmath.ctx_mp_python.mpf
>>>
>>> ---
>>> AttributeErrorTraceback (most recent call 
>>> last)
>>>  in 
>>> > 1 mpmath.ctx_mp_python.mpf
>>>
>>> AttributeError: module 'mpmath.ctx_mp_python' has no attribute 'mpf'
>>>
>>
>> this is apparently easy to fix, as this is due to
>>
>> https://github.com/fredrik-johansson/mpmath/blob/bd6715df41f2034f4438a77acc9bb05d03564942/mpmath/ctx_mp.py#L54
>> which makes the import of mpf conditional on BACKEND not being 'sage'
>>
>> Making it unconditional does not seem to break anything in Sage.
>>
>>  
>>
>>>
>>>
>>> whereas
>>>
>>> ~/devel/sage$ ./local/bin/python3
>>> Python 3.9.2 (default, Mar 19 2021, 22:23:28)
>>> [GCC 7.4.0] on linux
>>> Type "help", "copyright", "credits" or "license" for more information.
>>> >>> import mpmath
>>> >>> mpmath.ctx_mp_python.mpf
>>> 
>>>
>>>
>>> Any ideas what is the reason for this?
>>>
>>> For the background of this question see Mathics issue 1169 
>>>   especially this 
>>> comment 
>>> .
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/7ec21d2a-801a-4bc9-8c92-8be4e2bd112an%40googlegroups.com.


[sage-devel] Re: Running MathicsSession inside Sage

2021-03-26 Thread Rocky Bernstein
I asked about this in the mpmath group and the solution there I think is 
good and only requires a change (or rather simplification) to the Mathics 
code.

So as far as I am concerned no changes are needed to sage or mpmath. See 
https://groups.google.com/g/mpmath/c/qzA5gs57Qm8/m/_eg4GHisAAAJ

On Friday, March 26, 2021 at 6:47:32 PM UTC-4 dim...@gmail.com wrote:

> On Thursday, March 25, 2021 at 2:24:43 PM UTC seb@gmail.com wrote:
>
>> Hi,
>>
>> Did anyone try this before? At the moment this stucks at the following 
>> issue:
>>
>> sage: import mpmath
>> sage: mpmath.ctx_mp_python.mpf
>>
>> ---
>> AttributeErrorTraceback (most recent call 
>> last)
>>  in 
>> > 1 mpmath.ctx_mp_python.mpf
>>
>> AttributeError: module 'mpmath.ctx_mp_python' has no attribute 'mpf'
>>
>
> this is apparently easy to fix, as this is due to
>
> https://github.com/fredrik-johansson/mpmath/blob/bd6715df41f2034f4438a77acc9bb05d03564942/mpmath/ctx_mp.py#L54
> which makes the import of mpf conditional on BACKEND not being 'sage'
>
> Making it unconditional does not seem to break anything in Sage.
>
>  
>
>>
>>
>> whereas
>>
>> ~/devel/sage$ ./local/bin/python3
>> Python 3.9.2 (default, Mar 19 2021, 22:23:28)
>> [GCC 7.4.0] on linux
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import mpmath
>> >>> mpmath.ctx_mp_python.mpf
>> 
>>
>>
>> Any ideas what is the reason for this?
>>
>> For the background of this question see Mathics issue 1169 
>>   especially this comment 
>> .
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/b7da58d3-b5eb-4a42-8b73-c0e63d02bcb3n%40googlegroups.com.


[sage-devel] Re: Running MathicsSession inside Sage

2021-03-26 Thread Dima Pasechnik


On Thursday, March 25, 2021 at 2:24:43 PM UTC seb@gmail.com wrote:

> Hi,
>
> Did anyone try this before? At the moment this stucks at the following 
> issue:
>
> sage: import mpmath
> sage: mpmath.ctx_mp_python.mpf
> ---
> AttributeErrorTraceback (most recent call last)
>  in 
> > 1 mpmath.ctx_mp_python.mpf
>
> AttributeError: module 'mpmath.ctx_mp_python' has no attribute 'mpf'
>

this is apparently easy to fix, as this is due to
https://github.com/fredrik-johansson/mpmath/blob/bd6715df41f2034f4438a77acc9bb05d03564942/mpmath/ctx_mp.py#L54
which makes the import of mpf conditional on BACKEND not being 'sage'

Making it unconditional does not seem to break anything in Sage.

 

>
>
> whereas
>
> ~/devel/sage$ ./local/bin/python3
> Python 3.9.2 (default, Mar 19 2021, 22:23:28)
> [GCC 7.4.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import mpmath
> >>> mpmath.ctx_mp_python.mpf
> 
>
>
> Any ideas what is the reason for this?
>
> For the background of this question see Mathics issue 1169 
>   especially this comment 
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/4abfd997-03ec-4953-8232-833aa80f5f84n%40googlegroups.com.


[sage-devel] Re: Running MathicsSession inside Sage

2021-03-25 Thread Rocky Bernstein
I spent some time looking over the links in the ticket cited. 

I am trying to understand why mpmath decided to do something special for 
sage and whether that is relevant still. I will ask on mpmath...
On Thursday, March 25, 2021 at 12:19:59 PM UTC-4 Matthias Koeppe wrote:

> Sounds like https://trac.sagemath.org/ticket/25445
>
> On Thursday, March 25, 2021 at 7:24:43 AM UTC-7 seb@gmail.com wrote:
>
>> Hi,
>>
>> Did anyone try this before? At the moment this stucks at the following 
>> issue:
>>
>> sage: import mpmath
>> sage: mpmath.ctx_mp_python.mpf
>>
>> ---
>> AttributeErrorTraceback (most recent call 
>> last)
>>  in 
>> > 1 mpmath.ctx_mp_python.mpf
>>
>> AttributeError: module 'mpmath.ctx_mp_python' has no attribute 'mpf'
>>
>>
>> whereas
>>
>> ~/devel/sage$ ./local/bin/python3
>> Python 3.9.2 (default, Mar 19 2021, 22:23:28)
>> [GCC 7.4.0] on linux
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import mpmath
>> >>> mpmath.ctx_mp_python.mpf
>> 
>>
>>
>> Any ideas what is the reason for this?
>>
>> For the background of this question see Mathics issue 1169 
>>   especially this comment 
>> .
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/015ea382-7387-40e3-92c3-b4de551ec307n%40googlegroups.com.


[sage-devel] Re: Running MathicsSession inside Sage

2021-03-25 Thread Matthias Koeppe
Sounds like https://trac.sagemath.org/ticket/25445

On Thursday, March 25, 2021 at 7:24:43 AM UTC-7 seb@gmail.com wrote:

> Hi,
>
> Did anyone try this before? At the moment this stucks at the following 
> issue:
>
> sage: import mpmath
> sage: mpmath.ctx_mp_python.mpf
> ---
> AttributeErrorTraceback (most recent call last)
>  in 
> > 1 mpmath.ctx_mp_python.mpf
>
> AttributeError: module 'mpmath.ctx_mp_python' has no attribute 'mpf'
>
>
> whereas
>
> ~/devel/sage$ ./local/bin/python3
> Python 3.9.2 (default, Mar 19 2021, 22:23:28)
> [GCC 7.4.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import mpmath
> >>> mpmath.ctx_mp_python.mpf
> 
>
>
> Any ideas what is the reason for this?
>
> For the background of this question see Mathics issue 1169 
>   especially this comment 
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/98843786-f8b9-4a60-b295-4253e9b31810n%40googlegroups.com.