-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Deprecate attributes and expire deprecation in animation #24131
Conversation
7c7201c
to
173e3c1
Compare
I do not understand the warnings:
These are "new" attributes, in the sense that they are defined in the class rather than in (I know that I've had similar issues with attributes earlier though...) |
I don't think |
Yeah, you are right. Forgot about the purpose a bit in... |
09e467c
to
11de658
Compare
It seems like other parts of the code are relying on I guess that one can protect the line
with a None-check though... |
38434b9
to
bfec3c4
Compare
Um what happens in the infinite case if there's no trim? |
Then I think @anntzer has argued that it keeps running unless you specify |
how do you save an infinitely running movie? |
I guess that there is a file size limit:
|
@story645 is correct that there is an unbounded cache in the case of an inifinte generator that needs to be addressed. The cap on the file size is also only in the jshtml export logic (so we do not make a multi-gigabyte html page 🤣, related if you want to see your browser break build our docs as I pushed some commits that protect against this. There might need to be some more thought around the default value of Also working on the rebase and will add some tests. |
and we are leaving the footcannon of trying to save an infinite generator, we just won't cache the data along the way. I think we have to leave this as it is unlikely we will be able to solve the halting problem. |
04e4255
to
1442dc4
Compare
This prevents a possible run-away unbounded cache!
1442dc4
to
bbeb86f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I pushed a bunch of code to this PR so this should count as half.
I've tried to squash locally, but it just gets messed up. Please squash on merge... |
Feels like I've lost track of this, but I think that everything is considered now. The cleanliness may not be correct (in that case it is added yet again, since it is there). So please squash upon merge... :-) |
You should be able to reset to a point you want to be at, including your remote, and then start cleaning up. git reset --hard origin/animationdeprecations
git rebase -i upstream/main
# clean up
git push --force-with-lease |
ani = animation.FuncAnimation(fig, run, data_gen, interval=100, init_func=init, | ||
save_count=100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed for sphinx-gallery? There isn't otherwise any saving going on in any of these examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, SG saves both a gif thumbnail and a js_html output to embed in the docs.
I'm working on sorting out what is going on with the history here. |
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
acf484c
to
d483a96
Compare
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
I think what happened is I had rebased and force-pushed, then Oscar merged that back into his branch and then added some more changes on top. I started from just before the merge and then cherry-picked the exrta commits on top and force-pushed again. |
Yes, there was a bit of a hassle with commits, especially since I've been using two different computers. Have to learn how to deal with that in a better way... (The main "issue" is that there will be a lot of intermediate conflicts while rebasing although the final diff will not have any conflicts...) Just need to sort out the doc failure then. (And possibly use |
Tried to fix the doc-failure by updating missing references. Seems to make sense since this became a problem for a deprecated attribute that will go away soon anyway. (And it removes a few hundred lines from this file.) |
One trick I use (particuarly if I do not super care about the history or am willing to re-create it later) is to squash everything to one commit and then rebase. |
) | ||
if self._save_count is None and cache_frame_data: | ||
_api.warn_external( | ||
f"{frames=!r} which we can infer the length of, " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to say "which we cannot infer the length of"?
PR Summary
Not sure if the deprecation warning could actually be triggered without setting anim.save_count after creating the animation. Anyway, it's been around from 2.2 so I think this is OK.
The Python bug mentioned seems to have been fixed in 3.8(?): python/cpython#74722
Privatized the save_count attribute as well as the
repeat
attribute. I cannot really see a use case for changing these after creating the animation.PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).