problem running sage -t

19 views
Skip to first unread message

davidp

unread,
Jun 2, 2009, 10:35:18 PM6/2/09
to sage-support
I would like to run the doctests in my file, "sandpile.sage", but get
the following error message:

++++++++++++++++++++++++++++++++++===
xyzzy> sage -t sandpile.sage
sage -t "sandpile.sage"
/usr/local/sage-devel/local/bin/sage-preparse: File file_name is
missing
Traceback (most recent call last):
File "./sandpile.py", line 18, in <module>
from sandpile import *
File "/home/davidp/math/sandpile/sage/sage-sandpile1.4/sandpile.py",
line 167, in <module>
class Sandpile(DiGraph):
NameError: name 'DiGraph' is not defined

[1.6 s]
exit code: 1024

----------------------------------------------------------------------
The following tests failed:


sage -t "sandpile.sage"
Total time for all tests: 1.6 seconds
++++++++++++++++++++++++++++++++++++++++++++++++++++++

I tried adding

from sage.graphs.graph import DiGraph

to the file but got the same error message.

Any suggestions?

Thanks,
Dave

Marshall Hampton

unread,
Jun 4, 2009, 5:46:39 PM6/4/09
to sage-support
What happens if you rename it "sandpile.py"? I'm not sure that will
help but there are some funny differences between running .py
and .sage files.

-Marshall

davidp

unread,
Jun 4, 2009, 9:07:13 PM6/4/09
to sage-support
Same problem:

sage -t "sandpile.py"
Traceback (most recent call last):
File "./sandpile.py", line 18, in <module>
from sandpile import *
File "/home/davidp/math/sandpile/sage/sage-sandpile1.4/sandpile.py",
line 167, in <module>
class Sandpile(DiGraph):
NameError: name 'DiGraph' is not defined

[1.4 s]
exit code: 1024

----------------------------------------------------------------------
The following tests failed:


sage -t "sandpile.py"
Total time for all tests: 1.4 seconds

Marshall Hampton

unread,
Jun 4, 2009, 10:10:58 PM6/4/09
to sage-support
If you email me your sandpile.sage file I could try to figure it out.
I made a file with a class definition inheriting from DiGraph and
everything tested OK, so I can't reproduce this. The only thing I can
think of is that perhaps your command "sage" is calling an older
version of sage that doesn't have DiGraphs - ? I don't know the graph
theory code well enough to know how likely that is.

Cheers,
Marshall
Reply all
Reply to author
Forward
0 new messages