CDAT / jupyter-vcdat

A Jupyter Lab extension based on vCDAT.
BSD 3-Clause "New" or "Revised" License
6 stars 5 forks source link

Creates an "animate" option #139

Closed sterlingbaldwin closed 4 years ago

sterlingbaldwin commented 4 years ago

Creates an "animate" option that animates over the time axis.

sterlingbaldwin commented 4 years ago

There are some things to add:

downiec commented 4 years ago

Hey Sterling, this is really cool!

I think it just needs some polishing and more thorough testing, so we'll have to add it to the next update, but it works pretty nicely so far. Suggestions:

1.) If the animate option is switched on, we should disable 'overlay' and 'sidecar' options, or else include code so that those features are also taken into account. Otherwise user might have sidecar switched 'on' and expect to see the animation in the sidecar display, or think that 'overlay' will work in their plot etc.

2.) We could also change the 'Plot' button color and text to something like an orange/other color 'Animate' button, as a further visual queue to user that they have the animate option selected and are about to generate an animation, not a single plot.

3.) We need to update the install script so that we include 'pip install tqdm', otherwise you'll get 'module not found' which is what I ran into when I first tried this branch.

4.) We'll want to update the intro-tutorial to describe this new feature, and also add some test cases.

5.) Maybe we could create an 'animations' folder where the .mp4 files would be stored? (just an idea, maybe it's better as-is, to save in working directory.

Your other suggested additional features/options would also be cool, but I think it is pretty good as it is now (after we polish it a bit). And we could add those other improvements later on.

sterlingbaldwin commented 4 years ago

Another thing to add, is that the "vcdat_tmp" director used to store the png files should be removed after the animation is finished.

sterlingbaldwin commented 4 years ago

Adds options to allow the user to select what axis to animate over, the frames per second of the animation, and to invert the axis order. Correctly uses the user selected colormap, and creates nice color bars consistent across the animation domain.

downiec commented 4 years ago

Looks like its working pretty well overall! Just a few last minute touches I think will be helpful.

  1. I ran into this error when I tried to do the animation plot before choosing a colormap: Code resulted in errors. Error name: TypeError. Message: checkedRaise() missing 1 required positional argument: 'err'. Not exactly sure why, perhaps something else caused it, but once I selected a colormap the animate feature was working.
  2. It would be good to update the installation scripts and Dockerfile so that 'tqdm' is installed. I had to install it myself when I tried your branch and if a docker image is built, it will be important to have tqdm installed for the animate feature to work in JupyterHub.
  3. I suggest when the animate feature is switched 'on', we should update the 'Plot' button text to show 'Animate', and we should switch the 'overlay' and 'sidecar' options off if they aren't compatible with the animate feature.