[Debian-science-sagemath] Status of sagemath (and jupyter)
Ximin Luo
infinity0 at debian.org
Sat Jan 21 23:24:00 UTC 2017
Tobias Hansen:
> On 01/21/2017 05:56 PM, Ximin Luo wrote:
>> Ximin Luo:
>>> [..]
>>>
>>> I will see about adding canvas3d to the message, thanks for the suggestion. It's even rotatable, didn't expect that!
>>>
>>> [..]
>>
>> Some help fixing this message up would be good. At the moment we say:
>>
>> in jupyter:
>> Interactive 3D plots do not work in the notebook because JSmol cannot currently be packaged for Debian. [..] You may view a non-interactive plot by giving the option [..]
>>
>> in sageNB:
>> 3D plots do not work in SageNB because JSmol cannot currently be packaged for Debian.
>>
>> So it seems to me both of these are slightly inaccurate (yes, I did write parts of them, whoops). I've never seen JSmol in action before, how interactive is it? I guess it obviously has more functionality than canvas3d if it's upstream Sage's default 3d viewer. But it's also not exactly right to imply canvas3d is non-interactive because one can rotate the plot at least with the mouse.
>>
>> Anyone want to suggest a better message?
>>
>> [..]
>>
>
> I was under the impression that canvas3d works only in sagenb, not in
> jupyter. At least it never worked for me. I never saw JSmol in action
> but I would assume it's like Jmol.
>
>From exploring the source code a bit, it seems you are right. There are various "def supported_output" sprinkled about:
sage/repl/rich_output/backend_ipython.py:
class BackendIPythonNotebook(BackendIPython):
def supported_output(self): (no canvas3d)
OutputSceneJmol,
class BackendIPythonCommandline(BackendIPython):
def supported_output(self):
OutputSceneJmol, OutputSceneWavefront,
sage/repl/rich_output/backend_sagenb.py:
class BackendSageNB(BackendBase):
def supported_output(self):
SageNbOutputSceneJmol,
OutputSceneCanvas3d,
so Canvas3d is only supported in SageNB. I'll go update the messages accordingly.
Interestingly (in a useless way), there seems to be a half-finished "wavefront" viewer:
sage/plot/plot3d/base.pyx:
elif viewer == 'wavefront':
return self._rich_repr_wavefront(**opts)
sage/repl/rich_output/backend_ipython.py:
elif isinstance(rich_output, OutputSceneWavefront):
msg = self.launch_sage3d(rich_output, plain_text.text.get_unicode())
but launch_sage3d isn't defined anywhere, it'll crash if you try to use it. :( There is even a sage3d.jar in SageNB:
$ dpkg -L python-sagenb | grep jar
/usr/lib/python2.7/dist-packages/sagenb/data/sage3d/lib/sage3d.jar
but I have no idea how to run it, and even if it worked it would probably just be an applet.
X
--
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git
More information about the Debian-science-sagemath
mailing list