#16570: Animate example looks broken
-------------------------------------+-------------------------------------
       Reporter:  gagern             |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  minor              |    Milestone:  sage-6.4
      Component:  graphics           |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Martin von Gagern  |    Reviewers:  Jakob Kroeker
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jakobkroeker/ticket/16570        |  9df42a472cd18d9f7b0eaa3cf820c515f74e54a6
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by gagern):

 Replying to [comment:23 nbruin]:
 > […] this behaviour is a regression. I happened to try the example in
 5.10 and there the animation appeared as one would expect. So it seems
 that xmin and xmax were used as bounds for x at some point before.

 After almost two days of bisecting, I got the culprit: it's #12827 –
 again.

 
[http://git.sagemath.org/sage.git/commit/?id=9eddf99b572caa0c28ffa40dd154ad9c8f952255
 9eddf99] broke the example, causing error messages instead. By
 
[http://git.sagemath.org/sage.git/commit/?id=5a10336948b7befec35c0c0d99defbceb348e5d9
 5a10336] the example could be executed again, but looked broken as
 described. Looking at
 
[http://git.sagemath.org/sage.git/diff/?id2=0c6fcdf462e329c80eeaf2841ac1659308aad90c&id=5a10336948b7befec35c0c0d99defbceb348e5d9
 the changes in between] the issue becomes apparent. The `__init__` method
 is changed like this:

 {{{
 -        w = []
 -        for x in v:
 -            if not isinstance(x, sage.plot.graphics.Graphics):
 -                x = plot.plot(x, (kwds.get('xmin',0), kwds.get('xmax',
 1)))
 -            w.append(x)
 -        if len(w) == 0:
 -            w = [sage.plot.graphics.Graphics()]
 -        self._frames = w
 +        ##
 +        ## code for type-checking input -- seems like a bad idea
 +        ##
 +        # if typecheck_input:
 +        #     w = []
 +        #     for x in v:
 +        #         if not is_graphic(x):
 +        #             x = plot.plot(x, (kwds.get('xmin',0),
 kwds.get('xmax', 1)))
 +        #         w.append(x)
 +        #     if len(w) == 0:
 +        #         w = [plot.Graphics()]
 +        # else:
 +        #     w = v
 +        self._frames = v
          self._kwds = kwds
 }}}

 and as a replacement we get the new `make_image` method:

 {{{
 +        p = plot.plot(frame)
 +        p.save_image(filename, **kwds)
 }}}

 If I move the `**kwds` from the `sage_image` call to the `plot` call, the
 example looks nice again. I guess I'll try this change and see how the
 rest of the animate test suite behaves for this.

--
Ticket URL: <http://trac.sagemath.org/ticket/16570#comment:24>
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.

Reply via email to