sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.16k stars 211 forks source link

jupyter/sage: showing animations using anything but the default animate gif format does not work (blocked by upstream) #4589

Open haraldschilly opened 4 years ago

haraldschilly commented 4 years ago

this just produces a text representation. expected is an webm video.

frames = [plot(sin(k*x)) for k in range(5)]
animate(frames).show(format='webm')

there are also other options for "format": http://doc.sagemath.org/html/en/reference/plotting/sage/plot/animate.html

williamstein commented 3 years ago

Still not implemented.

williamstein commented 1 month ago

This doesn't work in jupyterlab either. There's nothing but that text jupyter message:

image

Maybe this is an issue with sage itself not supporting jupyter ie one of the million things that were missed in switching from the sage notebook to jupyter.

Here's exactly what you see in jupyterlab when you run that code and save the ipynb file -- i.e., there's no jupyter messages with the webm file:

  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Animation with 5 frames"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "frames = [plot(sin(k*x)) for k in range(5)]\n",
    "animate(frames).show(format='webm')"
   ]
  },

I searched the sage github issues and this has been broken since 2014: https://github.com/sagemath/sage/issues/16573 There's a mess of related tickets. The problem is entirely upstream.

https://github.com/sagemath/sage/issues/17783 etc.

I'm also changing the title of this, since the problem is not at all us not supporting something. It's that the sage animate command is stuck in 2014 somehow.

I wrote the sage animate command in like 2008, amusingly...

williamstein commented 4 days ago

Removing jupyter tag since this is a bug in sage, not jupyter.