#17783: Fix 2d animations
------------------------+----------------------------
Reporter: vbraun | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.5
Component: graphics | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
------------------------+----------------------------
Various things in 2d animations need refactoring
* The `show_path` optional argument should be removed everywhere, and
meaningful return values should be implemented
* (Lack of) return values sometimes contradicts documentation, e.g. in
`Animation.apng()`
* Functions that save should have a mandatory (positional) filename as
argument
* There should be a keyword argument to switch between different output
types in `show()`, similar to `viewer='jmol'` in 3d graphics.
* Make up your mind on whether `Animate._frames` is 2d graphics or input
to `plot()`
{{{
sage: a = animate([sin(x + float(k)) for k in srange(0,2*pi,0.7)])
sage: a._frames
[sin(x),
sin(x + 0.7),
sin(x + 1.4),
sin(x + 2.0999999999999996),
sin(x + 2.8),
sin(x + 3.5),
sin(x + 4.2),
sin(x + 4.9),
sin(x + 5.6000000000000005)]
sage: a.graphics_array()
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
<ipython-input-19-9b519c8280fc> in <module>()
----> 1 a.graphics_array()
/home/vbraun/Code/sage.git/local/lib/python2.7/site-
packages/sage/plot/animate.pyc in graphics_array(self, ncols)
510 if rem > 0:
511 nrows += 1
--> 512 return plot.graphics_array(frame_list, nrows, ncols)
513
514 def gif(self, delay=20, savefile=None, iterations=0,
show_path=False,
/home/vbraun/Code/sage.git/local/lib/python2.7/site-
packages/sage/plot/plot.pyc in graphics_array(array, n, m)
2442 n = int(n)
2443 m = int(m)
-> 2444 array = reshape(array, n, m)
2445 return GraphicsArray(array)
2446
/home/vbraun/Code/sage.git/local/lib/python2.7/site-
packages/sage/plot/plot.pyc in reshape(v, n, m)
2360 if not isinstance(v[0], Graphics):
2361 # a list of lists -- flatten it
-> 2362 v = sum([list(x) for x in v], [])
2363
2364 # Now v should be a single list.
TypeError: 'sage.symbolic.expression.Expression' object is not iterable
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/17783>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.