#17783: Fix 2d animations
-----------------------------------------+------------------------
       Reporter:  vbraun                 |        Owner:
           Type:  defect                 |       Status:  new
       Priority:  major                  |    Milestone:  sage-6.5
      Component:  graphics               |   Resolution:
       Keywords:                         |    Merged in:
        Authors:                         |    Reviewers:
Report Upstream:  N/A                    |  Work issues:
         Branch:                         |       Commit:
   Dependencies:  #7298, #16573, #17234  |     Stopgaps:
-----------------------------------------+------------------------
Changes (by gagern):

 * cc: gagern (added)
 * dependencies:  #17234 => #7298, #16573, #17234


Comment:

 Replying to [ticket:17783 vbraun]:
 > * The `show_path` optional argument should be removed everywhere, and
 meaningful return values should be implemented

 I had, at some point in the past, myself proposed to return path names
 from all the file creation functions. That's #16573 which I wrote at a
 time when animations were even more severely broken. Since noone seemed to
 care about it, and I was mostly happy again once notebook worked all right
 again, I left it at that.

 > * (Lack of) return values sometimes contradicts documentation, e.g. in
 `Animation.apng()`

 The APNG inconsistency is in a certain sense a consequence of that: back
 in #16533 I had code which got refactored to #16573 about returning paths
 and to #16571 for APNG support. The latter went forward, the former was
 left to rot, and I didn't adjust the docs properly. Sorry there.

 > * Functions that save should have a mandatory (positional) filename as
 argument

 Mandatory positional file name arguments would break backwards
 compatibility. At the moment, it is perfectly all right for a notebook
 user to write `a.gif()` resp. `a.ffmpeg()` in order to view an animation
 `a` in a given format. The documentation seems to encourage that behavior.
 So if we follow the
 [http://www.sagemath.org/doc/developer/coding_in_python.html#deprecation
 deprecation guideline], we have to first spit out warnings for a year
 before we really make this mandatory. The `gif` method has a different
 order of arguments at the moment, so a positional argument there would
 already have a different meaning. We would have to make positional use of
 `delay` deprecated, either at the same time (using the type of the
 argument to distinguish between backward-compatible delay and forward-
 compatible file name) or sequentially. If we'd do it sequentially, i.e.
 first deprecate the `delay` (in my opinion preferrably using #16607) and
 then deprecate the lack of a file name, then it would take two years. Or
 you are of the opinion that animations are so generally broken that you
 don't care about graceful deprecation, and have to convince some other
 devs to agree to that view. I wouldn't feel comfortable giving a positive
 review to such a change.

 > * There should be a keyword argument to switch between different output
 types in `show()`, similar to `viewer='jmol'` in 3d graphics.

 #7298 introduced a keyword argument for `show` which I called `format`. I
 suggest we continue discussion of format switching in that ticket.

 > * Make up your mind on whether `Animate._frames` is 2d graphics or input
 to `plot()`

 I had the impression that one should be able to provide plot input as an
 argument to `animate` for the sake of simplicity, and that one should be
 able to provide a generator instead of a list for the sake of memory
 efficiency. So having `_frames` contain either of these, or even a
 mixture, seems hard to avoid at the moment. That said, there obviously
 should be no exceptions due to such mixtures. I'd say we introduce a
 method which returns an iterator over graphics objects, moving the logic
 from the `png` method into that.

 I feel I could write a branch for the APNG documentation and the `_frames`
 handling which would be ready for inclusion very soon. If I include the
 `show_path` issue, I could deal with all of that in a new branch for
 #16573. The mandatory positional file name argument issue needs some
 discussion first, I think. Do you want this ticket here focused on that
 issue, or do you want to open a new one exclusively about that and close
 this here as duplicate of all of these others?

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