-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
J. Gutow's update to Jmol in the notebook... #9238
Comments
Attachment: Jmol javascript updates.zip jmol notebook javascript updates |
comment:1
Did you update the version of jmol in Sage as well? |
comment:2
Replying to @jasongrout:
Jason, Thanks!!! I forgot about that. Yes, for all of this to work you need to use Jmol 11.8. The latest release. Should I add a .zip of the necessary applet files to the trac? Jonathan |
This comment has been minimized.
This comment has been minimized.
comment:4
We should make a new spkg. Is that what you did? If not, then I can try to update the spkg to include the newest jmol if it's just a drop-in replacement for the old java files. |
comment:5
On the other hand, I didn't realize that jmol was just included in the sagenb spkg, so it'll probably be easier to update. I'm CCing Tim, who has done some of the recent sagenb releases. Yes, can you attach the updated jmol files as well, then (or if they're more than a megabyte or so, can you post a link to them?) Thanks for all of this work! Jason |
comment:6
OK, I've posted a .zip archive with all the necessary Jmol stuff. The link is now included in the trac ticket. Sorry I forgot about that. Jonathan |
This comment has been minimized.
This comment has been minimized.
comment:7
That zip file has a lot of __MACOSX and .DS_Store files... |
comment:8
Replying to @jasongrout:
Oops...It will still work, but I will clean it up and post an update later today. People can try it with this, but look for a clean file tomorrow. Jonathan |
comment:9
If you replace the existing jmol directory with the above zip, then you delete the "jmol" file inside that directory, which is necessary for the spkg to work. The jmol file is:
Is that file still needed? I think it probably makes jmol work from the command line for us. |
comment:10
Hmmm...good eye! I think you are correct. I have never used Jmol from the command line. It does look like the application is used. I can certainly include that in the package as well as the shell script. I thought that was the old Jmol linux shell script...I didn't even look inside....My bad. When I clean things up I will get the necessary files for command line back in there. I will do that this evening. Let me know if you notice anything else. Jonathan
|
comment:11
I've make a new sagenb-0.8.p3.spkg file that includes Jonathan's changes above (as an applied mercurial patch), plus the new jmol. So to test this, all a person should have to do is:
It seems to work pretty well for me. I wish the default was Medium Size instead of "small" |
comment:12
Let's take some votes on the default size. The problem with medium is that some people are still using screens as small as 800 x 600. A 400 x 400 applet is likely to use more screen space than the user has allotted to the browser. Maybe we should add a place where the user can set the default Jmol size in their notebook preferences? At present it is just a variable set when jmol_lib.js is loaded. We could certainly set it somewhere else in the web page. Jonathan
|
comment:13
Replying to @gutow:
I agree. |
comment:14
The link to jmol.zip now leads to a clean zip archive (no .DS_Store files), with the jmol file (shell script) and the Jmol.jar application file. Jason, I also wonder about your spkg name. Wasn't the .py2.6 indicative of the python version? Jonathan |
comment:15
Where is there a missing .py2.6? I don't think I deleted anything with that name. It's possible that whatever you are seeing happens at install time, rather in the source of the spkg, but I'm not sure what file you're talking about. |
comment:16
I'm talking about this: sagenb-0.8-py2.6.egg Jonathan Replying to @jasongrout:
|
comment:17
Ah. What I did is create a new spkg, like in sage/spkg/standard/sagenb-0.8.p2.spkg. When it installs into the python directory (using the "sage -f" command), the py2.6 egg stuff will be taken care of. |
comment:18
Jason, Once you've incorporated the new jmol.zip file, I suggest you update the description to include instructions on using your .spkg to test right near the top. Or are your and I the only two who are going to look at this? Jonathan |
comment:19
No, you won't - pesky "someone else has already edited this page"!!! Jonathan, Sweet. Great work! Some comments upon a very small amount of testing (which is all I have time for right now). I apologize for their telegraphic nature. Popup 3dviewer is great. Functions tab did not immediately have something in it, I had to click "request...", which is nonintuitive. I understand if that step is necessary, but the message could be better; as it is, the person using it wouldn't necessarily realize that this would give mesh etc. info for each object (nice to do it separately, so so so nice). Colorpicker in Functions tab: awesome. Initial size Small might be good for iPhone (if Jmol even works there?) but is a little on the small side for normal laptop/PC web browsing. Can the browsing thing be detected for this? There is an awful lot of space given to the info, not so much to the actual graphic. Would it be possible to put that stuff below the image as opposed to on the right? In fact, that stuff should not necessarily resize with the graphic... State is cool for those of us who might want to access it, but it should default (when clicked upon) to creating a slider or something, or "click here for full" or something like that. Otherwise the potential for really upsetting work flow is there, it changes the window size so much. Sleep/Wake works great, might be nice to CSS those words into something less \texttt{}-ish. Note that "Arbitrarily resizable in own window Get static image to save" looks like one command; maybe some Didn't break any old worksheets, though they all have this new little Jmol double window now, which makes sense. This may be unrelated, but the axes seem to be in the wrong spots, at least in
I did not get to test having billions of applets open at the same time, unfortunately, but will be happy to do so if no one else can over the next week or two. One really interesting thing is this. We had complaints about the snappiness of 3D interacts recently, but now I get almost instantaneous recomputation with 'small', which is great. However
occurs if I change the size in an interact, and then move the slider. Obviously, other things don't stay the same with an interact - say if I change one function to green, it goes back to blue after moving the slider, but there shouldn't be the error message (ideally). But thank you! This would be a big improvement. Looking forward to being able to evaluate it properly - clearly a big change needs big testing. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:22
Replying to @kcrisman:
Glad you like it.
You are correct that I could not originally get the information from Jmol on load because of timing issues. I have an idea about this and will work on it a little. In the meantime, I think you are correct that we need better instructions in this tab.
We use it for other Jmol stuff, but it was originally inspired by the needs of SAGE.
I believe we can get the surrounding window size. I will look into that. Maybe it should default to no more than 405 of width or height, whichever is higher?
I can play with the table formatting a little. I don't see any problems off the top of my head with it not resizing. I think underneath is a problem as the applet can be big enough that the controls will be off screen.
Eventually I want it hidden. But I think I can set it up to be scrolling....
These are formatting issues that I can deal with easily.
Good!
That is likely to be a SAGE python bug as Jmol just draws lines where SAGE tells it to. I will double check the parsing, but since the axes look correct for everything I've tried, I'm guessing something funny is passed to Jmol.
This is because I switched to using the incrementally loaded applet. Thus only the parts needed are loaded. This significantly reduces load time. However
Is that completely reproducible? I've seen it occasionally when javascript gets executed before the applets are completely loaded. However, I've never seen any ill effects since things get reset later. If it causes problems and you can pin it down, let me know. Thanks for the initial testing. Jonathan |
This comment has been minimized.
This comment has been minimized.
comment:165
Sorry to be dense, but what is the relation between this and #11503? (I mean does one depend on the other?) |
comment:166
I don't think that's dense. It is confusing. This ticket reflects the development before the Flask notebook. As I was told we were switching over to Flask ASAP, I stopped working on things in the old version of the notebook. However, I think this ticket belongs for people who want to incorporate an updated Jmol into pre-Flask versions of Sage. Plus, I think it is good to lead people to the Flask version. The .spkgs here would not install Jmol properly for setups that have made modifications as per #11503. Should we say something about that? Replying to @kcrisman:
|
comment:167
Well, in the meantime we aren't switching to Flask asap, so I might actually have time to test this over the next week or two and finally get it in. Or are we just going to say we won't update Jmol and your nice changes until then? I think that having instructions (for instance, that #11503 can be done after this, but not the other way around) would be appropriate... |
comment:168
In about 1.5 weeks I'll have time to look at this again. I should be able to put together an spkg and the appropriate patches to make everything work without moving to Flask. As we are ramping up for the semester, I don't think I will get to it before then. Can we sit tight until then? We've already missed 4.7.1 haven't we? |
This comment has been minimized.
This comment has been minimized.
comment:170
I talked with Rado the other day, and it seems like he's making a big push to get a lot of new stuff in and the bugs worked out while he has time before October. My guess is that we'll see the flask notebook stabilize in mid- to late-September. |
Changed keywords from sd31 to sd31, sd32 |
comment:172
I've tested some of the features of this ticket on vanilla sage-4.7.2.alpha2 and I have some questions. I installed Jmol_for_SageNoteBook-1.1.6.spkg and applied the patches
The add-help patch would not apply with the response that a JmolHelp.html file already existed. I did not attempt to apply the IE patches. After applying the patches I issued "sage -b" and started sage and the notebook. Now when I load a worksheet that has Jmol applets I get pop-ups. If there are numerous applets, I get numerous pop-ups. These pop-ups seem to be triggered by the follow alerts in trac_9238_jmol_lib_async.patch
since the quoted expressions in the alerts appear in the pop-ups. Loading the applets is extremely slow and the pop-ups have to be "clicked" before loading continues. Now if I do not install trac_9238_jmol_lib_async.patch then I do not get the pop-ups and the loading of the applets is much faster. I have used Firefox 3 and Firefox 6 with the same result. Are the pop-ups a feature or is the jmol_lib_async only intended for safari browsers? |
comment:173
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. 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. 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. 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. 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. Replying to @strogdon:
|
comment:174
Replying to @gutow:
No problem relative to time since things are rather busy here now too.
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
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
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
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?
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.
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. |
comment:175
Replying to @strogdon: Thanks for the code snippets. I have run them through a system with most of our latest patches in the flask version. They do not seem to be problematic. I had no trouble with a worksheet using your second (no-frame) example with 12 duplicates in a worksheet. It does take a while to work its way back to the top from the 12th applet (about 25 seconds using my slow home connection). This was a relatively severe test as the whole connection is encrypted as well, which slows things down further. I did get a warning pop-up while the system was waiting for me to OK trusting the applet over the encrypted connection when I evaluated the first cell. Once this was done things worked rapidly each time I evaluated an additional cell, because the applet was cached. Does that sound like I checked everything? Based on this test, I think I need to try to create a version of the patches that match the latest changes incorporated into the flask notebook, but can be applied to 4.7.2. I may have time this weekend. |
comment:176
Replying to @strogdon: I just found something. Is this what you are describing? I don't see it all the time, but I did manage to make it happen once, so should be able to trace it.
a) select "delete all output", then select "evaluate all" b) select "evaluate all" without first deleting the output
|
comment:177
Replying to @gutow:
This sounds good. If you get 12 applets to load in 25 seconds with the (no-frame) option then the flask implementation is definitely an improvement. With the async patch I'm able to load 12 applets, with frames, over nfs in about 40 seconds. I get one sequence of pop-ups after everything has loaded relative to trouble loading jmol Applet #0. However, with the (no-frame) option I get a sequence of pop-ups for each loading Applet. The odd behavior with "TypeError" in a pop-up seems to occur only if the async patch isn't applied. With the async patch and with frames doing either of a) select "delete all output", then select "evaluate all" gives the above behavior of one sequence of pop-ups relative to loading jmol Applet #0. For the several times I've tried, all Applets do load. |
This comment has been minimized.
This comment has been minimized.
comment:179
Hi Jonathan, I've managed to get the Flask notebook installed in one of my development Sage installs, apparently, and it's summer, so I'd like to review #12299 so that it's ready to go in with the new notebook (likely in Sage 5.2, says jdemeyer). Can you go through all the things here and maybe pick out any obvious things that should be hyper-tested, and put them on #12299? I can't be sure, but reading through the comments it seems like most of the issues (including the command-line and Safari issues) were already resolved before this ticket became superseded by the new one? |
comment:180
I think everything that was discussed above has been resolved. The issues that are left are to get some tests from people other than me to find what else I've missed. I've been running these modifications on the server I use for classes since last year, so I'm cautiously optimistic. For all practical purposes, I think this ticket is closed and completely superseded by #12299. |
Changed author from Jonathan Gutow to none |
comment:181
Okay, that sounds good. |
Changed reviewer from Jason Grout, Karl-Dieter Crisman, William Stein to Jason Grout, Karl-Dieter Crisman, William Stein, Jonathan Gutow |
NOTE: This ticket has been replaced by #12299
Ready for testing.
For inclusion in new Flask notebook see enhanced Jmol in Flask. Note that all fixes and enhancements to the Jmol interface from SageDays 31 are in the Flask version and not this ticket. The Jmol changes for the Flask notebook should be included in the Flask spkg soon. See #11080.
Setting this up on your own copy of Sage requires two steps. Starting with a clean Sage 4.6.2 (for 4.7+ skip step 1):
./sage -f "http://www.uwosh.edu/faculty_staff/gutow/Jmol_for_SageNoteBook-1.1.6.spkg"
./sage -b
.I have addressed the following issues (let me know if I've missed anything):
Happy testing and thank you to those who do test!
Note: This ticket has been replaced by #12299.
CC: @TimDumol @kcrisman @rkirov
Component: notebook
Keywords: sd31, sd32
Reviewer: Jason Grout, Karl-Dieter Crisman, William Stein, Jonathan Gutow
Issue created by migration from https://trac.sagemath.org/ticket/9238
The text was updated successfully, but these errors were encountered: