Skip to content
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

example_brunel_alpha_topo_exp.py crashes while saving FuncAnimation output #79

Open
espenhgn opened this issue Sep 23, 2022 · 0 comments
Assignees
Labels

Comments

@espenhgn
Copy link
Contributor

Describe the bug
The example script example_brunel_alpha_topo_exp.py is crashing in case ffmpeg is not available:

MovieWriter ffmpeg unavailable; using Pillow instead.
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
File ~/Repositories/hybridLFPy/examples/example_brunel_alpha_topo_exp.py:745
    741     # plt.show()
    744 if RANK == 0:
--> 745     network_activity_animation(PS, networkSim, save_anim=True)
    746     # plt.show()
    748 if RANK == 0:

File ~/Repositories/hybridLFPy/examples/example_brunel_alpha_topo_exp.py:554, in network_activity_animation(PS, networkSim, T, kernel, save_anim)
    552 ani = FuncAnimation(fig, update, frames=tbins.size, interval=1)
    553 if save_anim:
--> 554     ani.save(os.path.join(PS.savefolder, 'NetworkTopo.mp4'),
    555              fps=15, writer='ffmpeg',
    556              extra_args=['-b:v', '5000k', '-r', '25', '-vcodec', 'mpeg4'],)

File ~/miniforge3/envs/mesocircuit/lib/python3.10/site-packages/matplotlib/animation.py:1049, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)
   1046         writer_cls = PillowWriter  # Always available.
   1047         _log.warning("MovieWriter %s unavailable; using Pillow "
   1048                      "instead.", writer)
-> 1049     writer = writer_cls(fps, **writer_kwargs)
   1050 _log.info('Animation.save using %s', type(writer))
   1052 if 'bbox_inches' in savefig_kwargs:

TypeError: AbstractMovieWriter.__init__() got an unexpected keyword argument 'extra_args'
@espenhgn espenhgn added the bug label Sep 23, 2022
@espenhgn espenhgn self-assigned this Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant