You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Itertools is generating errors in animation.py when saving animations
There is a call to itertools.islice when writing animations. With python 3.6 and matplotlib 2.0.2 this gives an error when the stop argument is of type np.int64 but works fine when the type is int. I'll report this as an issue with itertools well.
The error arises when this code is used (cf line 1553 in animation.new_saved_frame_seq() ):
itertools.islice( [3, 4, 5], np.int64(2) )
but not with this
itertools.islice([3,4,5], 2)
A workaround is to add the following line at the start of animation.new_saved_frame_seq():
self.save_count = int(self.save_count)
Activity
braaannigan commentedon Aug 1, 2017
I created a report for this here:
http://bugs.python.org/issue31097
It turns out to be a known bug - see here http://bugs.python.org/issue30537
Any objections to me preparing a PR with the workaround above? Just for clarity, am proposing adding: self.save_count = int(self.save_count)
anntzer commentedon Aug 1, 2017
Go for it. Please add a link to the CPython bug as a comment next to the relevant line.
dopplershift commentedon Aug 2, 2017
I'd merge the PR. Thanks for offering to make it!
tacaswell commentedon Aug 13, 2017
Closed by #8984