Description
Storing long animations with animation.save()
takes unfortunately a considerable amount of time. Currently, there is (afaik) no possibility to see the progress of the process and it is unclear if the program is running for minutes or hours.
In my opinion it would be very valuable, if there would be some option to enable user feedback / logging information. For example: anim.save(output_path, writer, log_progress=True)
The desired logging information can be added with with a small amount of additional lines:
Original code:
for data in zip(*[a.new_saved_frame_seq() for a in all_anim]):
for anim, d in zip(all_anim, data):
# TODO: See if turning off blit is really necessary
anim._draw_next_frame(d, blit=False)
writer.grab_frame(**savefig_kwargs)
With logging:
frame_number = 0
number_frames = sum([a.save_count for a in all_anim])
for data in zip(*[a.new_saved_frame_seq() for a in all_anim]):
for anim, d in zip(all_anim, data):
# TODO: See if turning off blit is really necessary
anim._draw_next_frame(d, blit=False)
if log_progress and frame_number % 100 == 0:
_log.info('frame ' + str(frame_number) + ' of ' + str(number_frames))
frame_number +=1
writer.grab_frame(**savefig_kwargs)
If this is valuable for others, I can create a pull request.
Please let me know, If this such logging is already possible with some other built-in option.