8000 MNT: be explicitly strict in FunctionAnimation by tacaswell · Pull Request #6336 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

MNT: be explicitly strict in FunctionAnimation #6336

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

Merged
merged 1 commit into from
Apr 27, 2016

Conversation

tacaswell
Copy link
Member

If the user functions return None, raise RuntimeError.

Suggested in #6332

This was made unintentionally stricter 1.5.0 due to fixing the animated attribute usage.

@tacaswell tacaswell added this to the 1.5.2 (Critical bug fix release) milestone Apr 26, 2016
@@ -1210,6 +1213,9 @@ def _draw_frame(self, framedata):
# Call the func with framedata and args. If blitting is desired,
# func needs to return a sequence of any artists that were modified.
self._drawn_artists = self._func(framedata, *self._args)
if self._blit:
if self._blit and self._drawn_artists:
if self._drawn_artists is None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition will never be True.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, did it one way, and then the other and forgot to remove the old version.

@WeatherGod
Copy link
Member

I think I am fine with this (modulo the comment I made), but I'd want @dopplershift's sign-off on this, too. We have been somewhat relaxed on the treatment of the returns from the user-supplied functions.

If the user functions return None, raise RuntimeError.

Suggested in matplotlib#6332
@tacaswell tacaswell force-pushed the mnt_stricter_animation branch from d42e2e8 to 65507a0 Compare April 26, 2016 14:18
@dopplershift
Copy link
Contributor

👍 from me--all we're doing is turning a confusing TypeError into a RuntimeError; there's no net change (here anyways) in terms of what's acceptable.

@dopplershift dopplershift merged commit 7cb9d1f into matplotlib:v1.5.x Apr 27, 2016
@tacaswell tacaswell deleted the mnt_stricter_animation branch April 27, 2016 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0