#9238: J. Gutow's update to Jmol in the notebook...
---------------------------------------------------------------+------------
Reporter: gutow |
Owner: gutow
Type: enhancement |
Status: needs_review
Priority: major |
Milestone: sage-4.7.2
Component: notebook |
Keywords: sd31, sd32
Work_issues: |
Upstream: N/A
Reviewer: Jason Grout, Karl-Dieter Crisman, William Stein |
Author: Jonathan Gutow
Merged: |
Dependencies:
---------------------------------------------------------------+------------
Comment(by strogdon):
Replying to [comment:173 gutow]:
> First, take note of the first paragraph of this ticket. Because this
involves working with the notebook interface all development since June
2011 has been on the Flask notebook version. That means the package and
patches here have not been updated since about 4.7.1. They are up
primarily so that people using 4.7.1 and older can get the controls that
allow changing the display of surfaces. Development has been limited to
the Flask version of the notebook. I have very limited time to work on
this (I'm a chemistry professor), but if the Flask notebook is going to be
severely delayed could try to package a version to work with the older
notebook.
No problem relative to time since things are rather busy here now too.
> If you really want to test this you should test it in a Flask install
(see the appropriate tickets). That said your concerns about the patch
warnings are valid. I did not know that any of it had been folded into
4.7.2. This is odd. The pop-up warnings are because your server
connection is relatively slow.
I believe the server (desktop) is fast enough. The pop-ups seem to be
associated with an inability to put certain applets in a sleep state. This
code
{{{
x,y=var('x y'); plot3d( 4*x*exp(-x^2-y^2), (x,-2,2), (y,-2,2) )
}}}
generates an applet that can be put in a sleep state. If I replicate the
code, say ten times, in a worksheet then I have no problem loading the
saved worksheet with and without the async patch. I get four active
applets and six that are sleeping. However, things are faster without the
patch. The following code
{{{
x, y = var('x y');W = plot3d(sin(pi*((x)^2+(y)^2))/2,(x,-1,1),(y,-1,1),
frame=False,color='purple', opacity=0.8);S = sphere((0,0,0),size=0.3,
color='red', aspect_ratio=[1,1,1]);show(W + S, figsize=8)
}}}
generates an applet that cannot put in a sleep state, at least here it
can't. The 'frame=False' option seems to be controlling the inability to
do this. I get pop-ups with just one applet in a worksheet, even though
the applet appears to have loaded within a second or two. Of course there
are no pop-ups without the async patch. If I replicate the code, say six
times, in a worksheet then loading the worksheet is extremely tedious with
the async patch since for each applet I eventually get two pop-ups. As I
mentioned, I don't believe the desktop is slow. Without the patch the
applets load immediately, particularly when 'Action -> Evaluate All' is
used; but only four or so of them can be re-evaluated if done
individually. Then, I get a pop-up with
{{{
TypeError: stateStr.match(re_modelinline) is null
}}}
> The notebook now allows about 15 seconds for an applet to load. If it
hasn't loaded by that time, one of these warnings pops up. The idea is to
provide some feedback when it takes a long time to load. The reason for
the async load code is that worksheets with lots of applets in them can
overwhelm the browsers if too many applets try to load simultaneously.
This code requires them to load sequentially and limits worksheets to 4
running Jmol applets at a time. Those that are not running are replaced
with a picture and a button to wake them. The primary reason for this is
constraints on the memory available for applets within browsers. The
async code is for all browsers. There are warnings associated with
specific browsers that we have had difficulty with (e.g. MS IE and certain
versions of FF and Safari). If your worksheets worked without the async
code, that suggests you were: 1) lucky; 2) had only one or very few
applets in your worksheet.
Lucky, perhaps but I certainly have more than a few applets. I can't see
where the second chunk of code would be associated with slowness. Perhaps
the 'frame=False' option is triggering something it shouldn't?
> If your worksheet did not work at all with the async code could you
package it up so that we could test it in the latest code? Thanks.
I would be nice to know if the same behavior is present in the flask-
notebook. I could do this but it would take some time. Hopefully, the code
I've provided can be easily tested by someone that has the flask stuff in
place.
> Does this answer your questions? I think the key message is that
without more work on my part the enhanced Jmol interface may be tied to
the Flask notebook.
Thanks for your feedback. It has caused me to look more carefully at what
I've been doing. FWIW, the jmol issue surfaced in using the sage-on-gentoo
port of Sage. There jmol has been outside the notebook for some time. But
only recently, with jmol-12.0.45 and the patches of this ticket, have
things started to act up. There is, not yet, a flask-notebook in sage-on-
gentoo. And I'm guessing it won't be in sage-on-gentoo until it appears in
Sage first. Therefore my ramblings here have been an attempt to determine
whether vanilla Sage with the present notebook has the same issues as I
have with sage-on-gentoo. It seems it does.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9238#comment:174>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.