Skip to content

example_brunel_alpha_topo_exp.py crashes while saving FuncAnimation output #79

@espenhgn

Description

@espenhgn

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'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions