error?

34 views
Skip to first unread message

David Guichard

unread,
Sep 18, 2013, 11:51:09 PM9/18/13
to sage-...@googlegroups.com
I just went back to a worksheet in the cloud that worked in June. Now I get this:

> attach('functions.sage')
Error in lines 1-1
Traceback (most recent call last):
  File "/mnt/home/HMMiXbxv/.sagemathcloud/sage_server.py", line 528, in execute
    exec compile(block+'\n', '', 'single') in namespace, locals
  File "", line 1, in <module>
  File "lazy_import.pyx", line 313, in sage.misc.lazy_import.LazyImport.__call__ (sage/misc/lazy_import.c:2475)
  File "/usr/local/sage/sage-5.11/local/lib/python2.7/site-packages/sage/misc/attached_files.py", line 344, in attach
    load(filename, globals(), attach=True)
  File "/usr/local/sage/sage-5.11/local/lib/python2.7/site-packages/sage/misc/preparser.py", line 1764, in load
    execfile(preparse_file_named(fpath), globals)
  File "/mnt/home/HMMiXbxv/.sage/temp/compute1a/1941/functions.sageSTztzy.py", line 5, in <module>
    _sage_const_2 = Integer(2); _sage_const_1 = Integer(1); _sage_const_0 = Integer(0)
NameError: name 'Integer' is not defined

functions.sage contains a few simple functions, but it seems to be choking on "_sage_const_2 = Integer(2)" which is automatically generated in producing
"/mnt/home/HMMiXbxv/.sage/temp/compute1a/1941/functions.sageSTztzy.py"

Help?

William Stein

unread,
Sep 19, 2013, 2:51:04 AM9/19/13
to sage-...@googlegroups.com
Hi,

Unfortunately, I haven't implemented an "attach" yet that works
properly in cloud worksheets, and it's catching the one that comes
with Sage. If you use load instead, it should work fine, e.g.,

load('functions.sage')

or

%load functions.sage

I'll implement a proper attach for worksheets soon, since not having
it bugs me all the time.

By the way, when I wasn't looking, somebody deprecated, then
completely changed the behavior of "%load" on the Sage command line to
something else entirely... to be the same as what it is now in
IPython. I don't think what it is in IPython is named well, and
disagree with this change... Sigh. Anyways, load (and attach) were
one of the very first things I ever added to sage, and I designed them
to be like the analogues commands in Magma.

Personally, I like using load('functions.sage') the best -- no need to
do anything magic -- it's just a normal function call.

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 post to this group, send email to sage-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-cloud.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cloud/ef67fd77-393a-4a58-9307-e30bcfaf73c9%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Jason Grout

unread,
Sep 19, 2013, 8:08:58 AM9/19/13
to sage-...@googlegroups.com
On 9/19/13 1:51 AM, William Stein wrote:
> By the way, when I wasn't looking, somebody deprecated, then
> completely changed the behavior of "%load" on the Sage command line to
> something else entirely... to be the same as what it is now in
> IPython. I don't think what it is in IPython is named well, and
> disagree with this change... Sigh. Anyways, load (and attach) were
> one of the very first things I ever added to sage, and I designed them
> to be like the analogues commands in Magma.

That was me, in the move to IPython 1.0. It was an effort to unify the
two communities, to ease migration back and forth, but I'm less certain
of the change now (I'm not sure how many people actually will be moving
back and forth, and the cost of the switch does seem pretty high).
Anyways, given that it's just deprecated, not actually changed yet, we
could undeprecate and just keep around the %runfile replacement command
as an alias for IPython compatibility, and because some people have
switched to it.

FYI, the IPython %load actually loads the contents of the file into the
current prompt, so you can edit it. It makes sense in the interactive
console IPython if a file is small, but huge files get really unwieldy.
It would be interesting to see how many people actually use %load in
the IPython community.

I should have probably asked for a vote on sage-devel before. I'll ask
for a vote on sage-devel about switching back for the move to IPython 1.0.

Thanks,

Jason

David Guichard

unread,
Sep 19, 2013, 10:33:17 AM9/19/13
to sage-...@googlegroups.com
Thanks William, that did it.

-- David




--
You received this message because you are subscribed to a topic in the Google Groups "sage-cloud" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-cloud/9JT6o0q74Gk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-cloud+unsubscribe@googlegroups.com.

To post to this group, send email to sage-...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-cloud.
Reply all
Reply to author
Forward
0 new messages