Wrapping movie for pyGMT

I wonder if there is interest in wrapping movie in pyGMT. I remember @leouieda telling me that to be Pytonic it would need to accept a python function to do that main plotting. Well, I think the wrapper could do that and then write that function to a temp file. Presumably, the movie module would still need to read that script and then the question is can we do the same thing we do for UNIX and Window shells and create a bunch of include files with parameters and then launch the main (modified) script in a parallelized loop. Naively, this would be system calls like “python main.py 133” which will run frame 133.
If this could work in principle then it seems we just need to deal with the Python representation of the variables ${MOVIE_COL0}, ${MOVIE_FRAME}, etc and what their assignment etc will look like and how the include file mechanism is. If any of the pyGMT developers are interested I would suggest taking the simple globe.sh example on the movie man page, Change -T360 to -T2 (2 frames) and add -Qs so it just makes the scripts then examine the globe directory and consider replacing those short *.sh files with the equivalent *.py files. If that can be done then I think we can (relatively easily) also support *.py files in the movie arguments.
Caveat: Not knowing Python there may be other obstacles I am not aware of here, but since a python script can run pyGMT and make a plot then I don’t see why we cannot make movies.

At least one person is interested - https://github.com/GenericMappingTools/pygmt/issues/1347 :slight_smile:

I think the hard part would be making it work with in-memory Python data objects, since integration with the PyData ecosystem is fundamental to the project philosophy (e.g., https://www.pygmt.org/dev/#project-goals). It would be a cool feature.