Re: [sage-devel] Typeset output in non-Sage modes in Sage Notebook

131 views
Skip to first unread message

William Stein

unread,
Apr 26, 2015, 8:49:44 PM4/26/15
to sage-devel, sage-cloud
On Sun, Apr 26, 2015 at 5:40 PM, Bill Page <bill...@newsynthesis.org> wrote:
> For example, if I start a cell with
>
> %fricas
>
> or
>
> %maxima
>
> the result is formatted by the external program and displayed as
> preformatted ascii text. Some external programs can generate LaTeX or
> MathML code. Is there a way to tell the worksheet to render code
> between $$ ... $$ as MathJax or have MathML markup rendered by the
> browser instead of being treated simply as text?

You'll have to write a new mode called something like

%fricas2

say. Then you can do pretty much anything. I could explain, but I
don't have the time right now (I will later).

Can you provide a very simple example of input to provide to fricas to
get latex output, at least?

Thanks,

William

>
> --
> 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+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.



--
William (http://wstein.org)

Bill Page

unread,
Apr 26, 2015, 10:49:04 PM4/26/15
to sage-...@googlegroups.com, sage-devel
On 26 April 2015 at 20:49, William Stein <wst...@gmail.com> wrote:
> On Sun, Apr 26, 2015 at 5:40 PM, Bill Page <bill...@newsynthesis.org> wrote:
> ...
>> Is there a way to tell the worksheet to render code
>> between $$ ... $$ as MathJax or have MathML markup rendered by
>> the browser instead of being treated simply as text?
>
> You'll have to write a new mode called something like
>
> %fricas2
>
> say. Then you can do pretty much anything. I could explain, but I
> don't have the time right now (I will later).
>

OK, thanks. Any pointers to documentation of "modes" in the Sage
worksheet would be fine too.

> Can you provide a very simple example of input to provide to fricas to
> get latex output, at least?
>

Sure. A worksheet cell with the contents

%fricas
)set output algebra off
)set output tex on
sqrt(2)

currently displays following output

$
sqrt {2}
leqno(10)
$

"algebra" is what FriCAS calls it's ascii output mode. "tex" is
actually the LaTeX mode (at least it is mostly LaTeX mod a few custom
commands). The actual output generated by Fricas is

$$
\sqrt {2}
\leqno(10)
$$

I do not know why the first character of each line is not shown in the
worksheet. Perhaps the current %fricas mode is trimming this first
character?

)set output tex off
)set output mathml on
sqrt(2)

produces the following MathML code

<math xmlns="http://www.w3.org/1998/Math/MathML" mathsize="big" display="block">
<msqrt><mrow><mn>2</mn></mrow></msqrt>
</math>

Getting MathJax to process FriCAS's LaTeX dialect might require some
extra work on the part of a new %fricas-latex mode, so I guess what I
would like most is a mode such as

%fricas-mml

that allows me to inject FriCAS-generated MathML into the worksheet output.

William Stein

unread,
Apr 27, 2015, 12:20:35 AM4/27/15
to sage-cloud, sage-devel
On Sun, Apr 26, 2015 at 7:49 PM, Bill Page <bill...@newsynthesis.org> wrote:
> On 26 April 2015 at 20:49, William Stein <wst...@gmail.com> wrote:
>> On Sun, Apr 26, 2015 at 5:40 PM, Bill Page <bill...@newsynthesis.org> wrote:
>> ...
>>> Is there a way to tell the worksheet to render code
>>> between $$ ... $$ as MathJax or have MathML markup rendered by
>>> the browser instead of being treated simply as text?
>>
>> You'll have to write a new mode called something like
>>
>> %fricas2
>>
>> say. Then you can do pretty much anything. I could explain, but I
>> don't have the time right now (I will later).
>>
>
> OK, thanks. Any pointers to documentation of "modes" in the Sage
> worksheet would be fine too.

There's no documentation yet. However, you might find this example
worksheet useful:

https://cloud.sagemath.com/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/files/support/2015-04-26-211601-fricas.sagews

William
> --
> You received this message because you are subscribed to the Google Groups "sage-cloud" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-cloud+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/CAC6x94QmDAcDakv%3DAiqHzCmW%3DN_0QOnEx1mw2FkvfZRVKzqRSg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
William Stein
Founder/CEO of SageMath, Inc. (http://sagemath.com)
206-419-0925

Bill Page

unread,
Apr 27, 2015, 10:00:28 AM4/27/15
to sage-...@googlegroups.com, sage-devel
On 27 April 2015 at 00:20, William Stein <wst...@sagemath.com> wrote:
> On Sun, Apr 26, 2015 at 7:49 PM, Bill Page <bill...@newsynthesis.org> wrote:
>>
>> OK, thanks. Any pointers to documentation of "modes" in the Sage
>> worksheet would be fine too.
>
> There's no documentation yet. However, you might find this example
> worksheet useful:
>
> https://cloud.sagemath.com/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/files/support/2015-04-26-211601-fricas.sagews
>

# a mode in SageMathCloud is just a function that takes as input a
string. That's pretty much it (there's more, but).
# For example, this takes whatever the cells input is, executes the
code in Fricas,
# then takes the output and displays it using Markdown.
def fricas2(s):
t = fricas.eval(s)
md(t, hide=False)

Thanks. Yes that is very useful, in particular the part about how to
display something in markdown (or other format?) from a program. Are
there several functions similar to 'md' ?

# it seems that the fricas mode itself is not outputing two $$'s. I
don't know...
)set output algebra off
)set output tex on
fricas.eval("sqrt(2)")

'$\r\r\nsqrt {2} \r\r\nleqno(15)\r\r\n$\r\r\n\r\n

Actually the first character of each line of FriCAS output is missing.
Also I am not sure what is up with the extra carriage return \r
characters. It looks like 'eval' in the fricas interface is broken.

What's a good way to debug the fricas interface in SageMathCloud? Can
I just copy and then import the code into a worksheet? I.e. avoid
having to rebuild Sage just to test?

Bill.

Dima Pasechnik

unread,
Apr 27, 2015, 10:23:35 AM4/27/15
to sage-...@googlegroups.com, sage-...@googlegroups.com
fricas interface is in Python, so you would just have to run 'sage -b', in a "normal"
Sage setting; and this is almost instant. (E.g. if you use your own copy of Sage in an SMC project).
 

Bill.

Bill Page

unread,
Apr 27, 2015, 10:31:50 AM4/27/15
to sage-...@googlegroups.com, sage-devel
On 27 April 2015 at 10:23, Dima Pasechnik <dim...@gmail.com> wrote:
>
> On Monday, 27 April 2015 15:00:30 UTC+1, Bill Page wrote:
>> ...
>> What's a good way to debug the fricas interface in SageMathCloud? Can
>> I just copy and then import the code into a worksheet? I.e. avoid
>> having to rebuild Sage just to test?
>
>
> fricas interface is in Python, so you would just have to run 'sage -b', in a
> "normal"
> Sage setting; and this is almost instant. (E.g. if you use your own copy of
> Sage in an SMC project).
>

Oh. Is it easy to use my own copy of Sage in SMC? Brief how-to?

Bill.

Bill Page

unread,
Apr 27, 2015, 10:33:59 AM4/27/15
to sage-...@googlegroups.com, sage-devel
OK, from a teminal session I know. But how to use my own copy of Sage
from a Sage Notebook in SMC?

William Stein

unread,
Apr 27, 2015, 10:36:17 AM4/27/15
to sage-devel, sage-cloud
See

https://github.com/sagemath/cloud/wiki/FAQ#-question-i-want-to-use-my-own-sage-binary-takes-2-minutes


But you should also be able to somehow use a copy of the fricas/axiom
file from the source code, though that may be more difficult...

>
> --
> 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+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.



--
William (http://wstein.org)

Dima Pasechnik

unread,
Apr 27, 2015, 10:38:18 AM4/27/15
to sage-...@googlegroups.com, sage-...@googlegroups.com
Oh.  Is it easy to use my own copy of Sage in SMC?  Brief how-to? #

Open terminal in an SMC project, install Sage. :-)


Probably a binary install will do for you (as you only need to change Python, not compile
anything)


Bill.

Dima Pasechnik

unread,
Apr 27, 2015, 10:46:27 AM4/27/15
to sage-...@googlegroups.com, sage-...@googlegroups.com


On Monday, 27 April 2015 15:36:17 UTC+1, William Stein wrote:
On Mon, Apr 27, 2015 at 7:33 AM, Bill Page <bill...@newsynthesis.org> wrote:
> On 27 April 2015 at 10:31, Bill Page <bill...@newsynthesis.org> wrote:
>> On 27 April 2015 at 10:23, Dima Pasechnik <dim...@gmail.com> wrote:
>>>
>>> On Monday, 27 April 2015 15:00:30 UTC+1, Bill Page wrote:
>>>> ...
>>>> What's a good way to debug the fricas interface in SageMathCloud?  Can
>>>> I just copy and then import the code into a worksheet?  I.e. avoid
>>>> having to rebuild Sage just to test?
>>>
>>>
>>> fricas interface is in Python, so you would just have to run 'sage -b', in a
>>> "normal"
>>> Sage setting; and this is almost instant. (E.g. if you use your own copy of
>>> Sage in an SMC project).
>>>
>>
>> Oh.  Is it easy to use my own copy of Sage in SMC?  Brief how-to?
>>
>
> OK, from a teminal session I know. But how to use my own copy of Sage
> from a Sage Notebook in SMC?

See

https://github.com/sagemath/cloud/wiki/FAQ#-question-i-want-to-use-my-own-sage-binary-takes-2-minutes


the URL to download the binary is outdated there.
the link
does not give any UW locations (even no USA locations!), so it's going to be a slower download...

Dima Pasechnik

unread,
Apr 27, 2015, 10:53:59 AM4/27/15
to sage-...@googlegroups.com, sage-...@googlegroups.com


On Monday, 27 April 2015 15:46:27 UTC+1, Dima Pasechnik wrote:


On Monday, 27 April 2015 15:36:17 UTC+1, William Stein wrote:
On Mon, Apr 27, 2015 at 7:33 AM, Bill Page <bill...@newsynthesis.org> wrote:
> On 27 April 2015 at 10:31, Bill Page <bill...@newsynthesis.org> wrote:
>> On 27 April 2015 at 10:23, Dima Pasechnik <dim...@gmail.com> wrote:
>>>
>>> On Monday, 27 April 2015 15:00:30 UTC+1, Bill Page wrote:
>>>> ...
>>>> What's a good way to debug the fricas interface in SageMathCloud?  Can
>>>> I just copy and then import the code into a worksheet?  I.e. avoid
>>>> having to rebuild Sage just to test?
>>>
>>>
>>> fricas interface is in Python, so you would just have to run 'sage -b', in a
>>> "normal"
>>> Sage setting; and this is almost instant. (E.g. if you use your own copy of
>>> Sage in an SMC project).
>>>
>>
>> Oh.  Is it easy to use my own copy of Sage in SMC?  Brief how-to?
>>
>
> OK, from a teminal session I know. But how to use my own copy of Sage
> from a Sage Notebook in SMC?

See

https://github.com/sagemath/cloud/wiki/FAQ#-question-i-want-to-use-my-own-sage-binary-takes-2-minutes


the URL to download the binary is outdated there.
the link
does not give any UW locations (even no USA locations!), so it's going to be a slower download...

the following does work in SMC:



(of course in the long run FAQ should have  a persistent link there...)

William Stein

unread,
Apr 27, 2015, 11:00:14 AM4/27/15
to sage-cloud, sage-devel
There might not be any official USA hosts for Sage binaries right now.
That won't be available for long.

-- William

>
> (of course in the long run FAQ should have a persistent link there...)
>
>>
>>>
>>> But you should also be able to somehow use a copy of the fricas/axiom
>>> file from the source code, though that may be more difficult...
>
>
>
>>>
>>>
>>> >
>>> > --
>>> > 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+...@googlegroups.com.
>>> > To post to this group, send email to sage-...@googlegroups.com.
>>> > Visit this group at http://groups.google.com/group/sage-devel.
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> --
>>> William (http://wstein.org)
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-cloud" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-cloud+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cloud/d78c0b45-f80b-4b09-baff-679f7bc340c6%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--

Dima Pasechnik

unread,
Apr 27, 2015, 11:01:41 AM4/27/15
to sage-...@googlegroups.com, sage-...@googlegroups.com
OK, I just edited the FAQ to reflect this. 

Dima Pasechnik

unread,
Apr 27, 2015, 11:11:40 AM4/27/15
to sage-...@googlegroups.com, sage-...@googlegroups.com
how about having an SMC-only filestore or an http server for this kind of things?
(just to save bandwidth...)

Dima Pasechnik

unread,
Apr 27, 2015, 11:31:24 AM4/27/15
to sage-...@googlegroups.com, sage-...@googlegroups.com
it seems that the current SMC quota settings do not allow this on an ordinary project.
At least I was unable to untar the sage binary into a relatively empty project
(project id: 42c646bc-c7fc-41d8-b50d-efc995e3cd08)

Rob Beezer

unread,
Apr 27, 2015, 11:50:11 AM4/27/15
to sage-...@googlegroups.com
Dear Dima,

Could you see if copying one of these into a project with 3 GB free will result
in a useable binary version for you?

https://cloud.sagemath.com/projects/53b77207-8614-4086-a032-432af4b4cdbd/files/sage-dev-images/

I think new projects will have enough room.

I'll publicize this once I get a firm report of somebody besides myself getting
a working copy. I have one report of it not working. Details in the README.

Rob

William Stein

unread,
Apr 27, 2015, 12:00:24 PM4/27/15
to sage-cloud, sage-devel
On Mon, Apr 27, 2015 at 8:11 AM, Dima Pasechnik <dim...@gmail.com> wrote:
>> That won't be available for long.
>
>
> how about having an SMC-only filestore or an http server for this kind of
> things?
> (just to save bandwidth...)

Maybe later -- I don't know. Harald tried posting binaries and paying
for the bandwidth on Google, and it cost over $50 in one day. So
that's not an option right now. Maybe a different hosting provider
would work for that purpose.

SMC won't be able to provide that sort of hosting for free, that's for sure.

> I think new projects will have enough room.

As of right now they do. However, I have to move everything out of UW
asap, so I can't promise anything at all regarding quotas of free
projects, since even free projects will cost the company
significantly. I can't even promise SMC will be around in a year.
It all depends on whether I am good enough at programming, and enough
people are willing to pay. This remains to be seen.

-- William
> https://groups.google.com/d/msgid/sage-cloud/7b759e9e-3b6e-4c30-8edd-43cc4bb245af%40googlegroups.com.

Dima Pasechnik

unread,
Apr 27, 2015, 12:14:45 PM4/27/15
to sage-...@googlegroups.com, sage-...@googlegroups.com


On Monday, 27 April 2015 17:00:26 UTC+1, help wrote:
On Mon, Apr 27, 2015 at 8:11 AM, Dima Pasechnik <dim...@gmail.com> wrote:
>> That won't be available for long.
>
>
> how about having an SMC-only filestore or an http server for this kind of
> things?
> (just to save bandwidth...)

Maybe later -- I don't know.  Harald tried posting binaries and paying
for the bandwidth on Google, and it cost over $50 in one day.  So
that's not an option right now.   Maybe a different hosting provider
would work for that purpose.

github does allow binary downloads within their releases.
Not sure whether one can host much this way, but perhaps
a couple of gigabytes is possible.

William Stein

unread,
Apr 27, 2015, 12:18:09 PM4/27/15
to sage-cloud, sage-devel
On Mon, Apr 27, 2015 at 9:14 AM, Dima Pasechnik <dim...@gmail.com> wrote:
>
>
> On Monday, 27 April 2015 17:00:26 UTC+1, help wrote:
>>
>> On Mon, Apr 27, 2015 at 8:11 AM, Dima Pasechnik <dim...@gmail.com> wrote:
>> >> That won't be available for long.
>> >
>> >
>> > how about having an SMC-only filestore or an http server for this kind
>> > of
>> > things?
>> > (just to save bandwidth...)
>>
>> Maybe later -- I don't know. Harald tried posting binaries and paying
>> for the bandwidth on Google, and it cost over $50 in one day. So
>> that's not an option right now. Maybe a different hosting provider
>> would work for that purpose.
>
>
> github does allow binary downloads within their releases.
> Not sure whether one can host much this way, but perhaps
> a couple of gigabytes is possible.
>



That's a great idea! It seems to solve the problem completely. See
https://help.github.com/articles/distributing-large-binaries/
which says:

"We don't limit the total size of your binary release files, nor
the bandwidth used to deliver them. However, each individual file must
be under 1GB in size."
> https://groups.google.com/d/msgid/sage-cloud/2a7274e4-41c9-4b5a-ae1d-2f546d7c87f9%40googlegroups.com.

Bill Page

unread,
Apr 27, 2015, 12:23:50 PM4/27/15
to sage-...@googlegroups.com, sage-devel
On 27 April 2015 at 12:00, William Stein <wst...@sagemath.com> wrote:
> ...
> SMC won't be able to provide that sort of hosting for free, that's for sure.
>
>> I think new projects will have enough room.
>
> As of right now they do. However, I have to move everything out of
> UW asap, so I can't promise anything at all regarding quotas of
> free projects, since even free projects will cost the company
> significantly. I can't even promise SMC will be around in a year.
> It all depends on whether I am good enough at programming, and
> enough people are willing to pay. This remains to be seen.
>

The topic has drifted a little ... but obviously it would be great
pity of all of your hard work on Sage Math Cloud comes to naught. I
assume that your main paying target market would be universities
interested in the compute platform for research and easy availability
of Sage for classroom use? I suppose that you can't really get as much
advantage from free accounts as Google gets for gmail, for example,
but still it does amount to some form of marketing expense.

>>> >>> --
>>> >>> William (http://wstein.org)
>>> >
>>> --
>>> William Stein
>>> Founder/CEO of SageMath, Inc. (http://sagemath.com)
>>> 206-419-0925

On the original point of this thread: Is there anything wrong with
just grabbing the 'fricas.py' source from somewhere, changing it, and
then importing it into an SMC/Sage worksheet?

Bill.

Dima Pasechnik

unread,
Apr 27, 2015, 12:31:05 PM4/27/15
to sage-...@googlegroups.com, sage-...@googlegroups.com
IMHO the problem is actually in axiom.py, where eval stuff is defined. 
fricas interface inherits from there. 
So you'll have to modify the corresponding function from axiom.py, so that
it overwrites the one inherited.

Presumably you can overwrite the any Python function/class in an SMC worksheet, 
but I never tried this. Seems error-prone to me :-)


Bill.

Dima Pasechnik

unread,
Apr 27, 2015, 12:39:56 PM4/27/15
to sage-...@googlegroups.com, sage-...@googlegroups.com, har...@schil.ly


On Monday, 27 April 2015 17:18:09 UTC+1, help wrote:
On Mon, Apr 27, 2015 at 9:14 AM, Dima Pasechnik <dim...@gmail.com> wrote:
>
>
> On Monday, 27 April 2015 17:00:26 UTC+1, help wrote:
>>
>> On Mon, Apr 27, 2015 at 8:11 AM, Dima Pasechnik <dim...@gmail.com> wrote:
>> >> That won't be available for long.
>> >
>> >
>> > how about having an SMC-only filestore or an http server for this kind
>> > of
>> > things?
>> > (just to save bandwidth...)
>>
>> Maybe later -- I don't know.  Harald tried posting binaries and paying
>> for the bandwidth on Google, and it cost over $50 in one day.  So
>> that's not an option right now.   Maybe a different hosting provider
>> would work for that purpose.
>
>
> github does allow binary downloads within their releases.
> Not sure whether one can host much this way, but perhaps
> a couple of gigabytes is possible.
>



That's a great idea!  It seems to solve the problem completely.  See
https://help.github.com/articles/distributing-large-binaries/
which says:

   "We don't limit the total size of your binary release files, nor
the bandwidth used to deliver them. However, each individual file must
be under 1GB in size."
 
we'd have to see if this will work well; they might have bandwidth throttling to 
make downloads of such files too slow to be practical.
But we should try. The most natural would be to add binary downloads to 

Harald, can you try this?

Dima

William Stein

unread,
Apr 27, 2015, 12:48:14 PM4/27/15
to sage-cloud
On Mon, Apr 27, 2015 at 9:23 AM, Bill Page <bill...@newsynthesis.org> wrote:
> On 27 April 2015 at 12:00, William Stein <wst...@sagemath.com> wrote:
>> ...
>> SMC won't be able to provide that sort of hosting for free, that's for sure.
>>
>>> I think new projects will have enough room.
>>
>> As of right now they do. However, I have to move everything out of
>> UW asap, so I can't promise anything at all regarding quotas of
>> free projects, since even free projects will cost the company
>> significantly. I can't even promise SMC will be around in a year.
>> It all depends on whether I am good enough at programming, and
>> enough people are willing to pay. This remains to be seen.
>>
>
> The topic has drifted a little ... but obviously it would be great
> pity of all of your hard work on Sage Math Cloud comes to naught. I
> assume that your main paying target market would be universities
> interested in the compute platform for research and easy availability
> of Sage for classroom use? I suppose that you can't really get as much
> advantage from free accounts as Google gets for gmail, for example,
> but still it does amount to some form of marketing expense.

(removing sage-devel since has drifted) Yes, I completely agree. I
definitely want to have lots of free accounts (probably most of them
are free, as with gmail), and do consider it a very valuable service
and marketing expense.

William

>
>>>> >>> --
>>>> >>> William (http://wstein.org)
>>>> >
>>>> --
>>>> William Stein
>>>> Founder/CEO of SageMath, Inc. (http://sagemath.com)
>>>> 206-419-0925
>
> On the original point of this thread: Is there anything wrong with
> just grabbing the 'fricas.py' source from somewhere, changing it, and
> then importing it into an SMC/Sage worksheet?
>
> Bill.
>
> --
> You received this message because you are subscribed to the Google Groups "sage-cloud" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-cloud+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/CAC6x94TrQDDveY9861F9NzQTe2NW924SYbWubothQ_cdwNJaBA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



Dima Pasechnik

unread,
Apr 27, 2015, 1:01:40 PM4/27/15
to sage-...@googlegroups.com, sage-...@googlegroups.com, har...@schil.ly

Harald Schilly

unread,
Apr 27, 2015, 1:55:04 PM4/27/15
to sage-...@googlegroups.com
On Mon, Apr 27, 2015 at 6:39 PM, Dima Pasechnik <dim...@gmail.com> wrote:
>> each individual file must
>> be under 1GB in size."
> Harald, can you try this?

Sorry, I'm not really motivated to do this. Of course, I've looked
into this, but there are at least two issues which aren't addressed by
this. There are also files above 1GB, one of them is the most
frequently downloaded one … and I don't want to risk triggering
fair-use thresholds.
So, in my eyes, this does only add work and cannot be automated.

There is some historical baggage regarding the mirrors. We had to
change the DNS entry because of that. Hence, all mirrors are suddenly
broken because they sync from the old address. I went through my
emails since about 2009 and collected about 50 contact email addresses
for servers around the world and sent them the new URL. Of course,
many do not exist any more ... I also don't know why US-based ones are
rather silent so far.

If someone has contacts to universities or other entities to help
hosting sage files, please tell me about it. I can do the emailing and
configuration, but knowing someone to talk to is the important first
step. [1]

Right now, my vision is to further unify how the infrastructure is
setup. There is an unhealthy split in the infrastructure, which does
give me and others like volker headaches. I am confident, that after
doing this for 6 or 7 years, that I can anticipate all the problems.
Throwing this github file hosting into the mix just adds fragmentation
and maintenance overhead.

Said that, there is a new service for large file storage on github.
That sounds interesting and I'm of course already signed up to get
early access (hopefully soon).
https://github.com/blog/1986-announcing-git-large-file-storage-lfs

-- harald

[1] if you came this far, you can get inspired by going through the
mirror list of other projects. e.g.
http://cran.r-project.org/mirrors.html
https://launchpad.net/ubuntu/+cdmirrors

Dima Pasechnik

unread,
Apr 27, 2015, 4:18:56 PM4/27/15
to sage-...@googlegroups.com, har...@schil.ly


On Monday, 27 April 2015 18:55:04 UTC+1, Harald Schilly wrote:
On Mon, Apr 27, 2015 at 6:39 PM, Dima Pasechnik <dim...@gmail.com> wrote:
>> each individual file must
>> be under 1GB in size."
> Harald, can you try this?

Sorry, I'm not really motivated to do this. Of course, I've looked
into this, but there are at least two issues which aren't addressed by
this. There are also files above 1GB, one of them is the most
frequently downloaded one … and I don't want to risk triggering
fair-use thresholds.

Fair-use thresholds at GitHub? Never heard of.

William Stein

unread,
Apr 27, 2015, 4:43:15 PM4/27/15
to sage-cloud
On Mon, Apr 27, 2015 at 1:18 PM, Dima Pasechnik <dim...@gmail.com> wrote:
>
>
> On Monday, 27 April 2015 18:55:04 UTC+1, Harald Schilly wrote:
>>
>> On Mon, Apr 27, 2015 at 6:39 PM, Dima Pasechnik <dim...@gmail.com> wrote:
>> >> each individual file must
>> >> be under 1GB in size."
>> > Harald, can you try this?
>>
>> Sorry, I'm not really motivated to do this. Of course, I've looked
>> into this, but there are at least two issues which aren't addressed by
>> this. There are also files above 1GB, one of them is the most
>> frequently downloaded one … and I don't want to risk triggering
>> fair-use thresholds.
>
>
> Fair-use thresholds at GitHub? Never heard of.

Read their terms of service. Basically if one user X has usage that
"significantly exceeds" the average usage of all users, they may
throttle user X significantly as a result. This applies even to
paying accounts. If it applies differently to paying accounts
though, Harald, you might try hosting on the sagemathinc github
project page [1], as that is slightly nonfree (as opposed to
sagemath).

[1] https://github.com/sagemathinc

-- William

Bill Page

unread,
Apr 27, 2015, 9:27:20 PM4/27/15
to sage-...@googlegroups.com, sage-devel
On 27 April 2015 at 12:31, Dima Pasechnik <dim...@gmail.com> wrote:
> ...
Yes you are right. The problem was in the original axiom.py. Here is a
patch that corrects the problem:

https://github.com/billpage/sage/commit/237df92ef4e6b5117654f3a3ff71b4aa10b0aa36#diff-60c84efff9cc620d4d8bbd8110321ffd

>
> Presumably you can overwrite the any Python function/class in an
> SMC worksheet, but I never tried this. Seems error-prone to me :-)
>

This worked fine for me. In addition to fricas.py and axiom.py I also
had to copy expect.py, cleaner.py and quit.py (imports of axiom.py)
into the same directory.

See:

https://cloud.sagemath.com/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/files/2015-04-23-150720.sagews

Bill.

Dima Pasechnik

unread,
Apr 27, 2015, 11:52:03 PM4/27/15
to sage-...@googlegroups.com, sage-...@googlegroups.com


On Tuesday, 28 April 2015 02:27:21 UTC+1, Bill Page wrote:
On 27 April 2015 at 12:31, Dima Pasechnik <dim...@gmail.com> wrote:
> ...
> On Monday, 27 April 2015 17:23:50 UTC+1, Bill Page wrote:
>>
>> On the original point of this thread:  Is there anything wrong with
>> just grabbing the 'fricas.py' source from somewhere, changing it,
>> and then importing it into an SMC/Sage worksheet?
>
> IMHO the problem is actually in axiom.py, where eval stuff is defined.
> fricas interface inherits from there.
> So you'll have to modify the corresponding function from axiom.py,
> so that it overwrites the one inherited.
>

Yes you are right. The problem was in the original axiom.py. Here is a
patch that corrects the problem:

https://github.com/billpage/sage/commit/237df92ef4e6b5117654f3a3ff71b4aa10b0aa36#diff-60c84efff9cc620d4d8bbd8110321ffd


this patch should go into Sage proper, as it also fixes the same as with SMC issue with Sage's notebook. 

Bill Page

unread,
Apr 28, 2015, 4:17:42 PM4/28/15
to sage-devel, sage-...@googlegroups.com
On 27 April 2015 at 23:52, Dima Pasechnik <dim...@gmail.com> wrote:
>
> On Tuesday, 28 April 2015 02:27:21 UTC+1, Bill Page wrote:
>>
>> Yes you are right. The problem was in the original axiom.py. Here is a
>> patch that corrects the problem:
>>
>> https://github.com/billpage/sage/commit/237df92ef4e6b5117654f3a3ff71b4aa10b0aa36#diff-60c84efff9cc620d4d8bbd8110321ffd
>>
>
> this patch should go into Sage proper, as it also fixes the same as with SMC
> issue with Sage's notebook.
>

Sure. What is the best way to make that happen?

Dima Pasechnik

unread,
Apr 29, 2015, 7:30:53 AM4/29/15
to sage-...@googlegroups.com, sage-...@googlegroups.com

the usual way is via trac.sagemath.org
(for instance using git trac extension: http://sagemath.org/doc/developer/git_trac.html#chapter-git-trac,
but bare git would do, too; you need an account on trac.sagemath.org for this, anyway)

there is also an experimental github way, but I don't really know how it works.

Dima

PS. I can only speak about fricas mode, as I don't have other axiom(s) installed, and cannot test there.
Can you?

PPS. if you really are pressed for time, I can submit this patch instead...


 

Bill Page

unread,
Apr 29, 2015, 6:17:18 PM4/29/15
to sage-...@googlegroups.com, sage-devel


On Apr 29, 2015 7:30 AM, "Dima Pasechnik" <dim...@gmail.com> wrote:

>> >
>> > this patch should go into Sage proper, as it also fixes the same as with SMC
>> > issue with Sage's notebook.
>> >
>>
>> Sure.  What is the best way to make that happen?
>
> the usual way is via trac.sagemath.org
> (for instance using git trac extension: http://sagemath.org/doc/developer/git_trac.html#chapter-git-trac,
> but bare git would do, too; you need an account on trac.sagemath.org for this, anyway)
>
> there is also an experimental github way, but I don't really know how it works.
>

Sorry but sage-trac looks like a big hammer for a small nut :)

>
> PS. I can only speak about fricas mode, as I don't have other axiom(s) installed, and cannot test there.
> Can you?
>

No I only have FriCAS installed.

> PPS. if you really are pressed for time, I can submit this patch instead...
>

Thanks I would really appreciate that.

Dima Pasechnik

unread,
Apr 30, 2015, 5:09:56 AM4/30/15
to sage-...@googlegroups.com, sage-...@googlegroups.com


On Wednesday, 29 April 2015 23:17:19 UTC+1, Bill Page wrote:


On Apr 29, 2015 7:30 AM, "Dima Pasechnik" <dim...@gmail.com> wrote:

>> >
>> > this patch should go into Sage proper, as it also fixes the same as with SMC
>> > issue with Sage's notebook.
>> >
>>
>> Sure.  What is the best way to make that happen?
>
> the usual way is via trac.sagemath.org
> (for instance using git trac extension: http://sagemath.org/doc/developer/git_trac.html#chapter-git-trac,
> but bare git would do, too; you need an account on trac.sagemath.org for this, anyway)
>
> there is also an experimental github way, but I don't really know how it works.
>

Sorry but sage-trac looks like a big hammer for a small nut :)

>
> PS. I can only speak about fricas mode, as I don't have other axiom(s) installed, and cannot test there.
> Can you?
>

No I only have FriCAS installed.


I thought that on SMC in a Sage worksheet you can do %axiom
and this will call a system-wide Axiom. Currently SMC is hanging for me, so I can't check.
 

> PPS. if you really are pressed for time, I can submit this patch instead...
>

Thanks I would really appreciate that.

a proper patch would include a doctest for the issue, you know, that's why sage-trac is not too a hammer :-)
Did you check that your patch doesn't break things like SMC's show(axiom('...')) ?

 

Dima Pasechnik

unread,
Apr 30, 2015, 5:29:24 AM4/30/15
to sage-...@googlegroups.com, sage-...@googlegroups.com


On Thursday, 30 April 2015 10:09:55 UTC+1, Dima Pasechnik wrote:


On Wednesday, 29 April 2015 23:17:19 UTC+1, Bill Page wrote:


On Apr 29, 2015 7:30 AM, "Dima Pasechnik" <dim...@gmail.com> wrote:

>> >
>> > this patch should go into Sage proper, as it also fixes the same as with SMC
>> > issue with Sage's notebook.
>> >
>>
>> Sure.  What is the best way to make that happen?
>
> the usual way is via trac.sagemath.org
> (for instance using git trac extension: http://sagemath.org/doc/developer/git_trac.html#chapter-git-trac,
> but bare git would do, too; you need an account on trac.sagemath.org for this, anyway)
>
> there is also an experimental github way, but I don't really know how it works.
>

Sorry but sage-trac looks like a big hammer for a small nut :)

>
> PS. I can only speak about fricas mode, as I don't have other axiom(s) installed, and cannot test there.
> Can you?
>

No I only have FriCAS installed.


I thought that on SMC in a Sage worksheet you can do %axiom
and this will call a system-wide Axiom. Currently SMC is hanging for me, so I can't check.

OK, one can start axiom in an SMC  terminal, by typing axiom
it is
(1) -> )version
 
Value = "Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17 "

My understanding is that %axiom invokes this instance of Axiom.


Bill Page

unread,
Apr 30, 2015, 11:59:55 AM4/30/15
to sage-...@googlegroups.com, sage-devel
On 30 April 2015 at 05:29, Dima Pasechnik <dim...@gmail.com> wrote:
> ...
>>
>> I thought that on SMC in a Sage worksheet you can do %axiom
>> and this will call a system-wide Axiom. Currently SMC is hanging for me,
>> so I can't check.
>
>
> OK, one can start axiom in an SMC terminal, by typing axiom
> it is
> (1) -> )version
>
> Value = "Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17 "
>
> My understanding is that %axiom invokes this instance of Axiom.
>

Yes I think you are right however when I try

%axiom
)version

in a Sage worksheet on SMC I get the following Python error message:

UnboundLocalError: local variable 'out' referenced before assignment

So I guess this has not been tested for a while.

Bill Page

unread,
Apr 30, 2015, 12:11:39 PM4/30/15
to sage-...@googlegroups.com, sage-devel
On 30 April 2015 at 05:29, Dima Pasechnik <dim...@gmail.com> wrote:
No I did not check. I still think that sage-trac is a very heavy and
complex solution to a simple problem.

<rant>
This is just a personal opinion but contrary to common intuition I do
not see any real evidence that the Sage developer emphasis on "doc
tests" has resulted in any fewer errors or problems in Sage in
comparison to other systems. I am not sure why this is, but my
personal experience is that Sage is just as hard to use and just as
likely to return an obscure error message as any of the other open
source computer algebra systems that I have used. My prior experience
with commercial systems is not that much better,

Anyway, in spite of being very happy to use Sage and to try to fix
problems I encounter if/when I have sufficient time, I am very
reluctant to invest the extra amount of time to learn and over come my
distaste for the Sage development model in general.
</rant>

Bill Page

unread,
Apr 30, 2015, 1:12:00 PM4/30/15
to sage-...@googlegroups.com, sage-devel
I just tested the patch and now I get the following in a Sage worksheet on SMC:

axiom.eval(")version")

'alue = "Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17 "\r\n'

%sage
from axiom import axiom

axiom.eval(")version")

'Value = "Axiom Axiom (May 2012) built on Friday July 25, 2014 at
23:34:17 "\r\n'

%axiom
)version

Value = "Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17 "

--

This looks correct with the patch.

Dima Pasechnik

unread,
Apr 30, 2015, 1:29:43 PM4/30/15
to sage-...@googlegroups.com, sage-...@googlegroups.com


On Thursday, 30 April 2015 18:12:00 UTC+1, Bill Page wrote:
I just tested the patch and now I get the following in a Sage worksheet on SMC:

axiom.eval(")version")

'alue = "Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17 "\r\n'

%sage
from axiom import axiom

axiom.eval(")version")

'Value = "Axiom Axiom (May 2012) built on Friday July 25, 2014 at
23:34:17 "\r\n'

%axiom
)version

Value = "Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17 "

How about

%axiom
f:=x/(x^3-1)

%sage
show(axiom('f'))


Dima Pasechnik

unread,
Apr 30, 2015, 1:34:08 PM4/30/15
to sage-...@googlegroups.com, sage-...@googlegroups.com

well, for rants we have a special newsgroup called sage-flame.

sorry for teaching you a part of sage development process against your will :-)
 

Bill Page

unread,
Apr 30, 2015, 3:37:20 PM4/30/15
to sage-devel, sage-...@googlegroups.com
On 30 April 2015 at 13:34, Dima Pasechnik <dim...@gmail.com> wrote:
> On Thursday, 30 April 2015 17:11:39 UTC+1, Bill Page wrote:
> ...
> well, for rants we have a special newsgroup called sage-flame.
>

Yes, although I consider what I wrote more of an inconvenient
statement of fact so maybe I used the wrong tag.

> sorry for teaching you a part of sage development process against your
> will :-)

Not at all. In fact you already offered to do it for me - what could
be easier for me than that!

Cheers,
Bill.

Bill Page

unread,
Apr 30, 2015, 3:51:23 PM4/30/15
to sage-...@googlegroups.com, sage-devel
On 30 April 2015 at 13:29, Dima Pasechnik <dim...@gmail.com> wrote:
> On Thursday, 30 April 2015 18:12:00 UTC+1, Bill Page wrote:
>>
>> I just tested the patch and now I get the following in a Sage worksheet on
>> SMC:
>>
>> axiom.eval(")version")
>>
>> 'alue = "Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17
>> "\r\n'
>>
>> %sage
>> from axiom import axiom
>>
>> axiom.eval(")version")
>>
>> 'Value = "Axiom Axiom (May 2012) built on Friday July 25, 2014 at
>> 23:34:17 "\r\n'
>>
>> %axiom
>> )version
>>
>> Value = "Axiom Axiom (May 2012) built on Friday July 25, 2014 at 23:34:17
>> "
>>
> How about
>

Not withstanding that in several attempts just to use Axiom, both with
and without the patch, I got error messages like:

Axiom crashed -- automatically restarting.

...

See for example:
https://cloud.sagemath.com/projects/16529ab7-418b-4e51-b7db-bfa3dc760a1b/files/Testing%20Axiom%20Interface.sagews

The commands

> %axiom
> f:=x/(x^3-1)
>
> %sage
> show(axiom('f'))
>

produced the expected results. If there is anyone out there who has
used Axiom on SMC or under Sage Notebook it would be interested in to
hear about their experience so far. I would be glad to add anyone's
name to the list of collaborators on this project.

In any case I think this shows that the patch does not make things worse.

William Stein

unread,
Apr 30, 2015, 4:07:39 PM4/30/15
to sage-devel, sage-cloud
On Thu, Apr 30, 2015 at 12:34 PM, Bill Page <bill...@newsynthesis.org> wrote:
> On 30 April 2015 at 13:34, Dima Pasechnik <dim...@gmail.com> wrote:
>> On Thursday, 30 April 2015 17:11:39 UTC+1, Bill Page wrote:
>> ...
>> well, for rants we have a special newsgroup called sage-flame.
>>
>
> Yes, although I consider what I wrote more of an inconvenient
> statement of fact so maybe I used the wrong tag.

You stated 'that the Sage developer emphasis on "doc tests" has
resulted in any fewer errors or problems in Sage in comparison to
other systems.' I'm not sure if I should respond to this, but I'm
going to. Note that Sage is mostly *interpreted* so having extensive
doctests is critical to maintain any possibility of sanity over time
and with a large number of developers (512 people listed at
http://trac.sagemath.org/ right now). I won't claim that Sage's
doctests make Sage have "fewer errors or problems" than the other
systems you use (they surely have their own approaches to testing).
However, I absolutely claim -- and I'm sure anybody with nontrivial
Sage development experience will agree -- that the Sage testing
standards are critical to Sage having any chance of survival and
usability at all. It's entirely an internal issue. Please also
note that Sage is mostly interpreted and not statically compiled like
some software, which further increases the need for extensive testing.

Also, the testing in Sage serves an important dual purpose -- it makes
it easier for people to actually use Sage -- instead of trying to read
documentation and deduce via logic how to compute something, you have
the option to try an example that does work, and adapt it to your
problem. In contrast, I just tried browsing the FRICAS api
documentation [1], and couldn't find a single example. If I wanted to
just play around a little to see how things work following [1], it
would be incredibly difficult for me.

There are also many people who have contributed massively to Sage by
working on porting, valgrinding, etc., who simply wouldn't have been
able to contribute anything of value without the test suite existing.

[1] http://fricas.github.io/api/genindex.html

William

>
>> sorry for teaching you a part of sage development process against your
>> will :-)
>
> Not at all. In fact you already offered to do it for me - what could
> be easier for me than that!
>
> Cheers,
> Bill.
>

Bill Page

unread,
Apr 30, 2015, 5:52:27 PM4/30/15
to sage-...@googlegroups.com, sage-devel
On 30 April 2015 at 16:06, William Stein <wst...@gmail.com> wrote:
> On Thu, Apr 30, 2015 at 12:34 PM, Bill Page <bill...@newsynthesis.org> wrote:
>> ...
> You stated 'that the Sage developer emphasis on "doc tests" has
> resulted in any fewer errors or problems in Sage in comparison to
> other systems.' I'm not sure if I should respond to this, but I'm
> going to.

Yes, I guess we do so at our own risk. :) My intention was not to
flame but rather just expressing my reaction after reading

http://sagemath.org/doc/developer/git_trac.html#chapter-git-trac

and considering the possible fate of my 3 line patch if I don't find
the time to do things this way. It just occurred to me that for such
simple things there should be simple solutions. And I guess there is:
find some else to do it. I am serious that perhaps this is not such a
bad thing provided of course that there are enough people willing to
do this.

> Note that Sage is mostly *interpreted* so having extensive
> doctests is critical to maintain any possibility of sanity over time
> and with a large number of developers (512 people listed at
> http://trac.sagemath.org/ right now).

I am (or at least once was) one of these people registered trac but I
was never comfortable with the workflow and review process. As a
system for reporting bugs and submitting patches it seemed OK but now
things seem more complicated. It is a good thing that Sage has
attracted enough developers who are fluent in this process.

> I won't claim that Sage's
> doctests make Sage have "fewer errors or problems" than the other
> systems you use (they surely have their own approaches to testing).
> However, I absolutely claim -- and I'm sure anybody with nontrivial
> Sage development experience will agree -- that the Sage testing
> standards are critical to Sage having any chance of survival and
> usability at all. It's entirely an internal issue.

OK. I don't doubt your sincerity but like a lot of things in software
development I find it hard to imagine how your claim could be
evaluated objectively.

> Please also note that Sage is mostly interpreted and not statically compiled like
> some software, which further increases the need for extensive testing.
>
> Also, the testing in Sage serves an important dual purpose -- it makes
> it easier for people to actually use Sage -- instead of trying to read
> documentation and deduce via logic how to compute something, you
> have the option to try an example that does work, and adapt it to
> your problem. In contrast, I just tried browsing the FRICAS api
> documentation [1], and couldn't find a single example.

That's true however this web site is only the result of one FriCAS
developers effort to make FriCAS documentation more accessible. To
really learn to use FriCAS I think it is important to learn to use the
built-in FriCAS browser (hyperdoc) and of course to read the book.

> If I wanted to just play around a little to see how things work
> following [1], it would be incredibly difficult for me.

Sure but I still experience exactly the same feeling when I sit down
to try to do something in Sage.

>
> There are also many people who have contributed massively to Sage by
> working on porting, valgrinding, etc., who simply wouldn't have been
> able to contribute anything of value without the test suite existing.

I am certainly not arguing against the concept of testing or the
importance of a test suite. My reaction was just in how it is treated
as an integral part of the sage-trac process.

>
> [1] http://fricas.github.io/api/genindex.html
>

Bill.

William Stein

unread,
Apr 30, 2015, 5:59:02 PM4/30/15
to sage-cloud, sage-devel
On Thu, Apr 30, 2015 at 2:52 PM, Bill Page <bill...@newsynthesis.org> wrote:
>> I won't claim that Sage's
>> doctests make Sage have "fewer errors or problems" than the other
>> systems you use (they surely have their own approaches to testing).
>> However, I absolutely claim -- and I'm sure anybody with nontrivial
>> Sage development experience will agree -- that the Sage testing
>> standards are critical to Sage having any chance of survival and
>> usability at all. It's entirely an internal issue.
>
> OK. I don't doubt your sincerity but like a lot of things in software
> development I find it hard to imagine how your claim could be
> evaluated objectively.

I've seen many examples that strongly support my claim that "the Sage
testing standards are critical to Sage having any chance of survival
and usability at all." In particular, I've seen code bitrot and die
that wasn't properly tested. If it ain't tested, it is broken. (It's
probably broken anyways, but that's another problem..)


>> There are also many people who have contributed massively to Sage by
>> working on porting, valgrinding, etc., who simply wouldn't have been
>> able to contribute anything of value without the test suite existing.
>
> I am certainly not arguing against the concept of testing or the
> importance of a test suite. My reaction was just in how it is treated
> as an integral part of the sage-trac process.

I had the impression you were arguing against the importance of a test
suite, and I'm glad you're not. Some people do sincerely argue
against it. For example, we have had at least one developer in the
past (e.g., Joel Mohler) quit doing Sage development explicitly
because of our 100% doctest requirements as the reason.

William

Dima Pasechnik

unread,
May 9, 2015, 6:05:19 AM5/9/15
to sage-...@googlegroups.com, har...@schil.ly


On Monday, 27 April 2015 18:55:04 UTC+1, Harald Schilly wrote:
On Mon, Apr 27, 2015 at 6:39 PM, Dima Pasechnik <dim...@gmail.com> wrote:
>> each individual file must
>> be under 1GB in size."
> Harald, can you try this?

Sorry, I'm not really motivated to do this. Of course, I've looked
into this, but there are at least two issues which aren't addressed by
this. There are also files above 1GB, one of them is the most
frequently downloaded one … and I don't want to risk triggering
fair-use thresholds.
So, in my eyes, this does only add work and cannot be automated. y

On Windows people are used to downloading split files and joining them using rar.
One can install rar on Linux and use it to split that most frequently downloaded file,
and then on the receiving end run rar to join them.

So this is really a non-issue.

Dima

 
Reply all
Reply to author
Forward
0 new messages