Ask Your Question
1

'module' object has no attribute 'graphics_filename'

asked 2012-12-07 07:44:40 +0200

AndreWin gravatar image

updated 2012-12-07 08:02:35 +0200

kcrisman gravatar image

Hello everybody! I typed at Sage Notebook:

a = animate([circle((i,i), 1-1/(i+1), hue=i/10) for i in srange(0,2,0.2)], xmin=0,ymin=0,xmax=2,ymax=2,figsize=[2,2])
a.show()

I got the message:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_9.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("YSA9IGFuaW1hdGUoW2NpcmNsZSgoaSxpKSwgMS0xLyhpKzEpLCBodWU9aS8xMCkgZm9yIGkgaW4gc3JhbmdlKDAsMiwwLjIpXSwgeG1pbj0wLHltaW49MCx4bWF4PTIseW1heD0yLGZpZ3NpemU9WzIsMl0pCmEuc2hvdygp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>

File "/tmp/tmpWYgSDe/___code___.py", line 4, in <module>
    exec compile(u'a.show()
File "", line 1, in <module>

File "/home/andrei/sage-5.4/local/lib/python2.7/site-packages/sage/plot/animate.py", line 458, in show
    self.gif(delay = delay, iterations = iterations)
 File "/home/andrei/sage-5.4/local/lib/python2.7/site-packages/sage/plot/animate.py", line 381, in gif
    savefile = sage.misc.misc.graphics_filename(ext='gif')
AttributeError: 'module' object has no attribute 'graphics_filename'

Please help me to understand what went wrong. What is missing? Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-12-07 08:15:50 +0200

kcrisman gravatar image

updated 2012-12-07 08:22:49 +0200

This works for me at the command line, but you are right that in the notebook it doesn't, and there definitely isn't graphics_filename() in sage.misc.misc. This must be a recent regression, I think, as it works in Sage 5.3. The bug is at line 457 of the animate file, where it calls the gif method in the notebook, which is clearly wrong now. (Line 557 also calls this nonexistent function.)

For now, I'd suggest doing

sage: a.save(filename='circle.gif')

which works for me on sagenb.org.

Edit: the fix will be easy enough, see Trac ticket 13807.

edit flag offensive delete link more

Comments

Thanks a lot! I will check it on my work computer on Monday.

AndreWin gravatar imageAndreWin ( 2012-12-07 11:35:55 +0200 )edit

Notice that #13807 now has positive review, and if we're lucky will get into Sage 5.5.

kcrisman gravatar imagekcrisman ( 2012-12-09 20:02:59 +0200 )edit
1

It's work now (sage 5.9)! Thanks!

AndreWin gravatar imageAndreWin ( 2013-06-01 07:47:29 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-12-07 07:44:40 +0200

Seen: 969 times

Last updated: Dec 07 '12