-
Notifications
You must be signed in to change notification settings - Fork 6
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
Cell code selection dropdowns disappear when notebook is reopened #32
Comments
How do you re-open the notebook? Do you mean
|
Also please confirm that you are using JupyterLab 1.0.0 alpha. |
I can confirm I was intrigued by the different options you mentioned for reopening, so I tried them all:
|
I am using this extension right now but could not reproduce the problem. Could you please send me your test notebook? |
It is most likely that SoS failed to add the dropdown box for some reason and stopped adding it to other cells. If you open the browser console (Shift + Right click -> Inspect -> Console for chrome), you might be able to see some error messages, which would be useful for debugging. |
For some reason Chrome wasn't displaying any errors, but I tried Chrome Beta and got the following:
The offending line in selectors.js is
|
Thanks. It looks like SoS tried to syntax highlight your F# cell, and the basemode of F# is not a string. It is troublesome to install F# on a mac so let me try this on a windows machine and see if I can reproduce and fix it. |
The bug initially appeared on a workbook with Bash, F#, and Java cells; I used F# in reporting the bug as a minimal working example. I can try other languages if you think some aren't affected. Thanks for all your efforts 👍 |
It would be easier to spot the problem if your screenshot contains these cells with the dropdown and stops at a F# cell, but I think this should be the culprit. I will fix it soon. BTW, SoS supports Bash, there is a third party language module for Java, but none for F# yet. I have recently updated our tutorial on how to write a language module so I would invite you to write one if you would like to enable data exchange between F# and other kernels. I will be of course happy to help (although I know nothing about F#). |
Ohmm, that particular
I also have just released jupyterlab-sos 0.4.4 with a fix that works only with the trunk of JupyterLab, but you can try to upgrade to this version and try again. |
I seem to be running the version you indicated:
Updating to 0.4.4 using |
This is strange because 0.4.3 contains the fix according to its source code. Anyway, I am glad that it works now and will close the ticket. It is great that you are interesting in contributing a language module for F#, I can set up a framework with basic features in vatlab and invite you to the repo or you can create from scratch in your account. Just let me know how you would like to proceed. |
Inviting to the repo seems the best approach for long term continuity |
Thanks! I have created a repo and invited you. The repo has all the basic stuff and I have confirmed that it provides the
Please also update sos-notebook to the latest version (0.19.6) because it contains an updated |
Got it, will do 😎 |
Is there a recommended testing procedure besides the full blown test suite? I've made a first attempt at Code is: def sessioninfo(self):
response = self.sos_kernel.get_response(
'match System.AppDomain.CurrentDomain.GetAssemblies() |> Seq.map( fun a -> a.GetName()) |> Seq.tryFind( fun name -> name.Name = \"FSharp.Core\") with |Some(x) -> x.ToString()| None -> \"No session information is available\"',
('stream',),
name=('stdout',))[0]
return response[1]['text'] The F# code returns the following string when run from a REPL:
|
If you would like test the F# language module, you can use the selenium-based tests described here, with examples for sos-r and sos-matlab. Although the tests use classic jupyter, it should be enough to test language modules. Note that we are porting the test mechanism to jupyter lab (#31 ). |
Note that we used to test |
Sorry for the delay - this isn't forgotten |
The test suite was designed for classic jupyter, not JupyterLab. Your command line seems to be starting the notebook, so
might not be the source of problem. Chrome should not start if you run pytest without setting
You should see the browser and can hopefully see what has gone wrong. I might be able to see what went wrong if you push your module and tests to https://github.com/vatlab/sos-fsharp. |
Apologies, I deleted the comment and posted a new one, but somehow the second comment did not get saved. I was able to get Chrome working but it seems the problem is that the F# kernel is not getting selected in the dropdown, so all the F# calls are going to the SoS kernel. I've cloned the My code is pushed to branch |
When you see |
which means your statement will not be correctly executed when the ifsharp kernel is loaded.
I can see that the chrome starts, but kernel='F#' fails to switch to the kernel. I am checking what is going on. |
OK, the problem was with the selenium test that tries to select the F# option with a CSS selector that looks something like |
Thank you for being so responsive - I'm sure you're very busy, so I don't expect < 24hrs for a response. I tried to pip install from the trunk with
I've pushed my current |
There are a bunch of loopholes when you have multiple conda environments and versions of sos-notebook etc, and even I sometimes got confused. Please check
For Let me know if your test runs after these steps. |
Also, if you run |
I tried all the above but the kernel is not switching to F# in the test. On a positive note, the
Also, as you suggested, the |
OK, I got it working (though tests are failing). It seemed to be a convoluted problem with my virtualenvs as you suggested. BTW would it make sense to migrate this issue to |
Yes, we should move the discussions there. |
On a clean install, using jupyterlab-sos 0.4.3, code selection dropdowns (on each cell) work properly when a notebook is created.
However, when reopening notebook, all but the first dropdown disappear.
The text was updated successfully, but these errors were encountered: