Re: [sage-support] init_printing from sympy is no longer working in SageCell

2022-02-02 Thread Andrey Novoseltsev
On Wednesday, 2 February 2022 at 14:35:35 UTC-7 dsfitz...@gmail.com wrote:

> Thanks! I just discovered that there is a separate group for Sage Cell.
> Oddly, the SageCell page links here for help! Apologies for not posting 
> there first.
>

This is on purpose - most questions people have are about Sage itself and 
they will get much better and faster help here ;-) 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/b78b0e94-2023-489b-8d76-fb595a3077e7n%40googlegroups.com.


Re: [sage-support] init_printing from sympy is no longer working in SageCell

2022-02-02 Thread Sean Fitzpatrick
Thanks! I just discovered that there is a separate group for Sage Cell.
Oddly, the SageCell page links here for help! Apologies for not posting 
there first.

On Wednesday, February 2, 2022 at 2:34:17 PM UTC-7 Andrey Novoseltsev wrote:

> This is due to recent upgrade to Sage 9.5. I will try to have it fixed in 
> a few hours or revert to 9.4 until I figure out the fix.
>
> On Wednesday, 2 February 2022 at 12:28:11 UTC-7 dsfitz...@gmail.com wrote:
>
>> Here is an example with Sage cells in context:
>> https://opentext.uleth.ca/Math3410/sec-kernel-image.html#p-283-part2
>>
>> If I remove the init_printing() line, or change this to 
>> init_printing(use_latex=False), the code will run, but I lose the 
>> MathJax-formatted output.
>>
>> I can't tell if this is a bug in the init_printing() function (to my 
>> knowledge, there is no recent update to Sympy -- I upgraded my local Python 
>> installation and everything is still working) or if something is going 
>> wrong with Sage Cell trying to process the output.
>>
>> On Wednesday, February 2, 2022 at 12:09:52 PM UTC-7 Sean Fitzpatrick 
>> wrote:
>>
>>> This is in SageMathCell, rather than in a local installation of Sage. I 
>>> don't think there's much I can do about what is running on here.
>>> [image: sagecell.png]
>>>
>>> On Wednesday, February 2, 2022 at 11:39:40 AM UTC-7 HG wrote:
>>>
  I tried it in sage 9.2 nice printing.

 But in sage I use show(LatexExpr("r \mu \epsilon))

 μϵ

 I am not sure that what you want (and naturaly first command in cell 
 %display latexin sage)

 One can even format text in a beautifull latex 

 show(LatexExpr(r"This \ is \ \mu \ and \ \epsilon"))

 This is μ and ϵ 

 best
  Best

 Henri
 Le 02/02/2022 à 18:38, Sean Fitzpatrick a écrit :

 I'm teaching a linear algebra course where we use the Sympy Python 
 package for a lot of the computations. This includes a PreTeXt textbook 
 where there are Sage Cells throughout, with sample code supplied. 

 Until today (I think it was working yesterday), I've had no trouble 
 running code like the following:

 from sympy import Matrix, init_printing
 init_printing()
 A = Matrix([[1,2,3,4],[5,6,7,8],[9,0,1,2]])
 display(A.rref())

 The init_printing function from Sympy renders the output in MathJax 
 rather than pretty-printed plain text, which is nice for teaching. I can 
 run this with the language set to either Sage or Python. (the 'display' 
 command is only needed for Python, which is funny, because it is not 
 needed 
 in Jupyter with a Python kernel.)

 Right now this code throws about 50 lines of error messages; the main 
 error is a Type Error:

 TypeError: Object of type  with value of '(a very, very 
 long string that I won't reproduce here)' is not JSON serializable

 Was there a change made today that would cause this error? Maybe in the 
 Sympy library? If I remove the init_printing() line, everything works, 
 except that there's no longer nice display for the output.

 The reason for using Python syntax is that we also do labs in Jupyter 
 notebooks. Our institution has a Jupyter hub with Python and R kernels, 
 but 
 no Sage kernel. (We do not have a CoCalc subscription.)

 I know there is a Sage equivalent to init_printing (although I forget 
 what it is) but that won't work on the Jupyter side.

 -- 
 You received this message because you are subscribed to the Google 
 Groups "sage-support" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to sage-support...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/sage-support/0262ca41-4a74-467b-8f46-0af9ad6c4df1n%40googlegroups.com
  
 
 .



-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/05b6d4c3-2ba2-4fa7-a092-c90b128e20f5n%40googlegroups.com.


Re: [sage-support] init_printing from sympy is no longer working in SageCell

2022-02-02 Thread Andrey Novoseltsev
This is due to recent upgrade to Sage 9.5. I will try to have it fixed in a 
few hours or revert to 9.4 until I figure out the fix.

On Wednesday, 2 February 2022 at 12:28:11 UTC-7 dsfitz...@gmail.com wrote:

> Here is an example with Sage cells in context:
> https://opentext.uleth.ca/Math3410/sec-kernel-image.html#p-283-part2
>
> If I remove the init_printing() line, or change this to 
> init_printing(use_latex=False), the code will run, but I lose the 
> MathJax-formatted output.
>
> I can't tell if this is a bug in the init_printing() function (to my 
> knowledge, there is no recent update to Sympy -- I upgraded my local Python 
> installation and everything is still working) or if something is going 
> wrong with Sage Cell trying to process the output.
>
> On Wednesday, February 2, 2022 at 12:09:52 PM UTC-7 Sean Fitzpatrick wrote:
>
>> This is in SageMathCell, rather than in a local installation of Sage. I 
>> don't think there's much I can do about what is running on here.
>> [image: sagecell.png]
>>
>> On Wednesday, February 2, 2022 at 11:39:40 AM UTC-7 HG wrote:
>>
>>>  I tried it in sage 9.2 nice printing.
>>>
>>> But in sage I use show(LatexExpr("r \mu \epsilon))
>>>
>>> μϵ
>>>
>>> I am not sure that what you want (and naturaly first command in cell 
>>> %display latexin sage)
>>>
>>> One can even format text in a beautifull latex 
>>>
>>> show(LatexExpr(r"This \ is \ \mu \ and \ \epsilon"))
>>>
>>> This is μ and ϵ 
>>>
>>> best
>>>  Best
>>>
>>> Henri
>>> Le 02/02/2022 à 18:38, Sean Fitzpatrick a écrit :
>>>
>>> I'm teaching a linear algebra course where we use the Sympy Python 
>>> package for a lot of the computations. This includes a PreTeXt textbook 
>>> where there are Sage Cells throughout, with sample code supplied. 
>>>
>>> Until today (I think it was working yesterday), I've had no trouble 
>>> running code like the following:
>>>
>>> from sympy import Matrix, init_printing
>>> init_printing()
>>> A = Matrix([[1,2,3,4],[5,6,7,8],[9,0,1,2]])
>>> display(A.rref())
>>>
>>> The init_printing function from Sympy renders the output in MathJax 
>>> rather than pretty-printed plain text, which is nice for teaching. I can 
>>> run this with the language set to either Sage or Python. (the 'display' 
>>> command is only needed for Python, which is funny, because it is not needed 
>>> in Jupyter with a Python kernel.)
>>>
>>> Right now this code throws about 50 lines of error messages; the main 
>>> error is a Type Error:
>>>
>>> TypeError: Object of type  with value of '(a very, very 
>>> long string that I won't reproduce here)' is not JSON serializable
>>>
>>> Was there a change made today that would cause this error? Maybe in the 
>>> Sympy library? If I remove the init_printing() line, everything works, 
>>> except that there's no longer nice display for the output.
>>>
>>> The reason for using Python syntax is that we also do labs in Jupyter 
>>> notebooks. Our institution has a Jupyter hub with Python and R kernels, but 
>>> no Sage kernel. (We do not have a CoCalc subscription.)
>>>
>>> I know there is a Sage equivalent to init_printing (although I forget 
>>> what it is) but that won't work on the Jupyter side.
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "sage-support" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to sage-support...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/sage-support/0262ca41-4a74-467b-8f46-0af9ad6c4df1n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/0e36f0b7-1114-4031-9a54-0f6527c4ee02n%40googlegroups.com.


Re: [sage-support] init_printing from sympy is no longer working in SageCell

2022-02-02 Thread Sean Fitzpatrick
Here is an example with Sage cells in context:
https://opentext.uleth.ca/Math3410/sec-kernel-image.html#p-283-part2

If I remove the init_printing() line, or change this to 
init_printing(use_latex=False), the code will run, but I lose the 
MathJax-formatted output.

I can't tell if this is a bug in the init_printing() function (to my 
knowledge, there is no recent update to Sympy -- I upgraded my local Python 
installation and everything is still working) or if something is going 
wrong with Sage Cell trying to process the output.

On Wednesday, February 2, 2022 at 12:09:52 PM UTC-7 Sean Fitzpatrick wrote:

> This is in SageMathCell, rather than in a local installation of Sage. I 
> don't think there's much I can do about what is running on here.
> [image: sagecell.png]
>
> On Wednesday, February 2, 2022 at 11:39:40 AM UTC-7 HG wrote:
>
>>  I tried it in sage 9.2 nice printing.
>>
>> But in sage I use show(LatexExpr("r \mu \epsilon))
>>
>> μϵ
>>
>> I am not sure that what you want (and naturaly first command in cell 
>> %display latexin sage)
>>
>> One can even format text in a beautifull latex 
>>
>> show(LatexExpr(r"This \ is \ \mu \ and \ \epsilon"))
>>
>> This is μ and ϵ 
>>
>> best
>>  Best
>>
>> Henri
>> Le 02/02/2022 à 18:38, Sean Fitzpatrick a écrit :
>>
>> I'm teaching a linear algebra course where we use the Sympy Python 
>> package for a lot of the computations. This includes a PreTeXt textbook 
>> where there are Sage Cells throughout, with sample code supplied. 
>>
>> Until today (I think it was working yesterday), I've had no trouble 
>> running code like the following:
>>
>> from sympy import Matrix, init_printing
>> init_printing()
>> A = Matrix([[1,2,3,4],[5,6,7,8],[9,0,1,2]])
>> display(A.rref())
>>
>> The init_printing function from Sympy renders the output in MathJax 
>> rather than pretty-printed plain text, which is nice for teaching. I can 
>> run this with the language set to either Sage or Python. (the 'display' 
>> command is only needed for Python, which is funny, because it is not needed 
>> in Jupyter with a Python kernel.)
>>
>> Right now this code throws about 50 lines of error messages; the main 
>> error is a Type Error:
>>
>> TypeError: Object of type  with value of '(a very, very 
>> long string that I won't reproduce here)' is not JSON serializable
>>
>> Was there a change made today that would cause this error? Maybe in the 
>> Sympy library? If I remove the init_printing() line, everything works, 
>> except that there's no longer nice display for the output.
>>
>> The reason for using Python syntax is that we also do labs in Jupyter 
>> notebooks. Our institution has a Jupyter hub with Python and R kernels, but 
>> no Sage kernel. (We do not have a CoCalc subscription.)
>>
>> I know there is a Sage equivalent to init_printing (although I forget 
>> what it is) but that won't work on the Jupyter side.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-support...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-support/0262ca41-4a74-467b-8f46-0af9ad6c4df1n%40googlegroups.com
>>  
>> 
>> .
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/0ef12103-da63-4a66-a8a9-a613d861b7a9n%40googlegroups.com.


Re: [sage-support] init_printing from sympy is no longer working in SageCell

2022-02-02 Thread Sean Fitzpatrick
This is in SageMathCell, rather than in a local installation of Sage. I 
don't think there's much I can do about what is running on here.
[image: sagecell.png]

On Wednesday, February 2, 2022 at 11:39:40 AM UTC-7 HG wrote:

>  I tried it in sage 9.2 nice printing.
>
> But in sage I use show(LatexExpr("r \mu \epsilon))
>
> μϵ
>
> I am not sure that what you want (and naturaly first command in cell 
> %display latexin sage)
>
> One can even format text in a beautifull latex 
>
> show(LatexExpr(r"This \ is \ \mu \ and \ \epsilon"))
>
> This is μ and ϵ 
>
> best
>  Best
>
> Henri
> Le 02/02/2022 à 18:38, Sean Fitzpatrick a écrit :
>
> I'm teaching a linear algebra course where we use the Sympy Python package 
> for a lot of the computations. This includes a PreTeXt textbook where there 
> are Sage Cells throughout, with sample code supplied. 
>
> Until today (I think it was working yesterday), I've had no trouble 
> running code like the following:
>
> from sympy import Matrix, init_printing
> init_printing()
> A = Matrix([[1,2,3,4],[5,6,7,8],[9,0,1,2]])
> display(A.rref())
>
> The init_printing function from Sympy renders the output in MathJax rather 
> than pretty-printed plain text, which is nice for teaching. I can run this 
> with the language set to either Sage or Python. (the 'display' command is 
> only needed for Python, which is funny, because it is not needed in Jupyter 
> with a Python kernel.)
>
> Right now this code throws about 50 lines of error messages; the main 
> error is a Type Error:
>
> TypeError: Object of type  with value of '(a very, very 
> long string that I won't reproduce here)' is not JSON serializable
>
> Was there a change made today that would cause this error? Maybe in the 
> Sympy library? If I remove the init_printing() line, everything works, 
> except that there's no longer nice display for the output.
>
> The reason for using Python syntax is that we also do labs in Jupyter 
> notebooks. Our institution has a Jupyter hub with Python and R kernels, but 
> no Sage kernel. (We do not have a CoCalc subscription.)
>
> I know there is a Sage equivalent to init_printing (although I forget what 
> it is) but that won't work on the Jupyter side.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/0262ca41-4a74-467b-8f46-0af9ad6c4df1n%40googlegroups.com
>  
> 
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/eef9e934-a6a3-4525-ba95-7dcd04fb9f9fn%40googlegroups.com.


Re: [sage-support] init_printing from sympy is no longer working in SageCell

2022-02-02 Thread Henri Girard

 I tried it in sage 9.2 nice printing.

But in sage I use show(LatexExpr("r \mu \epsilon))

μϵ

I am not sure that what you want (and naturaly first command in cell 
%display latex    in sage)


One can even format text in a beautifull latex

show(LatexExpr(r"This \ is \ \mu \ and \ \epsilon"))

Thisisμandϵ

best

 Best

Henri
Le 02/02/2022 à 18:38, Sean Fitzpatrick a écrit :
I'm teaching a linear algebra course where we use the Sympy Python 
package for a lot of the computations. This includes a PreTeXt 
textbook where there are Sage Cells throughout, with sample code 
supplied.


Until today (I think it was working yesterday), I've had no trouble 
running code like the following:


from sympy import Matrix, init_printing
init_printing()
A = Matrix([[1,2,3,4],[5,6,7,8],[9,0,1,2]])
display(A.rref())

The init_printing function from Sympy renders the output in MathJax 
rather than pretty-printed plain text, which is nice for teaching. I 
can run this with the language set to either Sage or Python. (the 
'display' command is only needed for Python, which is funny, because 
it is not needed in Jupyter with a Python kernel.)


Right now this code throws about 50 lines of error messages; the main 
error is a Type Error:


TypeError: Object of type  with value of '(a very, very 
long string that I won't reproduce here)' is not JSON serializable


Was there a change made today that would cause this error? Maybe in 
the Sympy library? If I remove the init_printing() line, everything 
works, except that there's no longer nice display for the output.


The reason for using Python syntax is that we also do labs in Jupyter 
notebooks. Our institution has a Jupyter hub with Python and R 
kernels, but no Sage kernel. (We do not have a CoCalc subscription.)


I know there is a Sage equivalent to init_printing (although I forget 
what it is) but that won't work on the Jupyter side.

--
You received this message because you are subscribed to the Google 
Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/0262ca41-4a74-467b-8f46-0af9ad6c4df1n%40googlegroups.com 
.


--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/15ade69b-2e09-c25f-60ab-e6b4407becaf%40gmail.com.