-
-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Animate example looks broken #16570
Comments
Attachment: broken-example.gif Current broken state of the example |
This comment has been minimized.
This comment has been minimized.
comment:1
Including image in the ticket description. |
Branch: u/gagern/ticket/16570 |
Commit: |
comment:5
Can you add a comment about frame size in the documentation itself to warn the user of bad examples? Maybe you can even refer to this ticket. |
comment:6
Replying to @ppurka:
Reasonable suggestion, but I'm somewhat uncertain where to put this. I guess it would be best to put this into the docstring of the whole module. There it might go after the warning about the need for ImageMagick or FFmpeg, or as one of the examples, towards the end. As a side note, my code from #16571 introduces a doc test which exhibits the APNG generator complaining about incorrect sizes. Mainly to help people understand the error message issued in this case.
I'd probably word this as follows: “Note that it is your responsibility to provide frames with matching sizes. Otherwise the result is undefined: the animation might fail to save, fail to play back, or simply look strange. Most often you'll want to ensure common coordinate systems as well, so passing Then I'd paste the broken example, but only the construction, without the command to display it. That way there is not much work for the doctests, and we can add checks for common frame size to the implementation later on without breaking that doctest. In the long run, a better alternative might be not to warn users but to avoid the unexpected behavior by choosing a common coordinate system automatically. But that will be more work. I just filed #16654 to keep track of that idea. |
comment:7
This looks good to me -- I wouldn't worry about the additional warning. Unfortunately I won't have time to give it a proper review for some weeks. |
comment:9
I'm about to review this one and have some questions:
do? (I have ImageMagick installed), but nothing happens: nothing is displayed in the notebook and no error occurs.
There is also a (unchanged) line in the doctest Q: what does that mean? What should I look at in addition? |
comment:10
The issue with |
comment:11
If I didn't miss or screw op something, I just checked out the ticket. Probably I should rebase first, or someone else should rebase the ticket? |
comment:12
Let's view testing it and rebasing it as two separate tasks. To test: if your |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
Replying to @sagetrac-jakobkroeker: Thanks for reviewing this. As already mentioned, the |
Reviewer: Jakob Kroeker |
comment:17
good, after I updated the ffmpeg 0.6.5 manually on my machine (Scientific Linux 6.5), the doctests passed! Otherwise ffmpeg 0.6.5. complains about the 'long' parameter argument. This might be a different new(?) issue, since several universities have SL installations. (SL packages are dated) All fixed examples worked as expected. However, there are two other broken animate examples; What also should be changed (maybe also in this ticket, since it is a pretty small change),
There is also one example with unreadable axis labels:
and two examples with unfortunate axis range, but that is probably discussable:
|
comment:26
Replying to @gagern:
Bummer. Thanks for investigating; I will look into this too. |
Changed branch from u/jakobkroeker/ticket/16570 to u/gagern/ticket/16570 |
comment:28
OK, things look good if I simply pass the keywords to the New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:30
Is there any further review needed here? It seems like you all have reviewed each other's work, except maybe the keyword bit, which is fine. Tests pass (I don't have ffmpeg but I don't think anything really changed there.) |
comment:31
Replying to @kcrisman:
As far as I see it, 403a9e6 with the keyword argument handling was the only bit without review. If you consider it fine, feel free to name yourself a reviewer as well, and give this thing a positive review. I'd be glad for it. |
comment:32
I'm not too familiar with sage/python, |
comment:33
Replying to @sagetrac-jakobkroeker:
graphics.save (which is what So what's the conclusion here? As long as a keyword argument is deemed suitable for |
comment:34
In principle, the very first line in
and near the end being
should suffice for that, but if you can think of a way this messes it up, that would be helpful. Edit: looks like Martin and I agree on this. |
Changed reviewer from Jakob Kroeker to Jakob Kroeker, Karl-Dieter Crisman |
comment:36
I have a question related to the
|
comment:37
See this #13368 |
comment:38
Yes, I agree, and now that I look at that again I agree with my former idea this was a bad cut-paste. Let's continue discussion there, if necessary. |
Changed branch from u/gagern/ticket/16570 to |
Changed commit from |
comment:40
Possible bad outcome to this revealed in #18176. |
There is one example used in several places in the documentation of module
animate
:However, at least on my system the individual frames are of slightly different sizes, ranging from 184×84 to 184×90. And the image looks pretty strange as well:
This seems to be mostly due to the fact that the axis range, described by
xmin
andxmax
, doesn't automatically fix a range forx
. Instead, it seems as ifx
will automatically range from-1
to1
, but clipped to approximately the axis range.My suggested remedy is to actually provide a range for
x
, and I'll upload a branch for this. I'll also address some other documentation and testsuite issues in this. Some of the tests take longer than one second, but aren't marked as long. One figure looks so small you can't see anything. And the information a user receives in response toanimate?
is pretty sparse, since most examples are at the module level. So I introduced a cross reference to that.This ticket is a spin-off from some work I did for #16533.
CC: @nilesjohnson
Component: graphics
Author: Martin von Gagern
Branch:
9d9e590
Reviewer: Jakob Kroeker, Karl-Dieter Crisman
Issue created by migration from https://trac.sagemath.org/ticket/16570
The text was updated successfully, but these errors were encountered: