-
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
Run code line by line #36
Comments
@BoPeng I confirm it works using a MWE simlar to @liu-genomics posted where codes live in different cells: However as you can see the |
Also, see below, line-by-line execution does not seem to work for scripts inside the first |
The first problem is jupyterlab/jupyterlab#6606 , which might or might not be accepted because its negative impact on indent-less languages such as R. Right now you will have to manually select the entire The I could make |
Not sure if I understand this statement. In the context of interactive development we always would expect running the current cell based on content previously executed -- that case I've not seen an issue with persistent
Okay let's wait for the pull request on JupyterLab's end. In the mean time @liu-genomics if you want to do that within scripts you've got to fall back to |
The idea is that
SoS could ignore the line because there is no body of substep, or it could be the last Currently
would fail or print `` for an empty You are right that we usually will not jump between the cells and use |
You could comment on jupyterlab/jupyterlab#6606 if you have some idea what the behavior should be. |
I agree with you that in SoS it does not make sense to access BTW @liu-genomics when I develop workflow using SoS Notebook I often use a language specific kernel to develop the chunk of code in that language; then after it is confirmed to work I cut-paste those into sos cell putting in the workflow bells and whistles. It is slightly more tedious than what you are trying to do (developing all in SoS cell) but to me it is cleaner in a sense. |
Thanks very much Bo and Gao. @gaow Could you please explain a bit more what do you mean by "when I develop workflow using SoS Notebook I often use a language specific kernel to develop the chunk of code in that language". Do you also have variables in this context? For example, in shell script, we could write a |
No. I would hard code input data variables etc to a separate language kernel, test the code make sure it works, then reformat that cell to an SoS workflow step -- this is how I usually work with Python and R; and in my view it is quite straightforward. For developing bash scripts I do use variables but I did not realize it does not work with JupyterLab -- last time I did it was long ago using Jupyter Notebook. I'm afraid for that purpose you've got to use Jupyter Notebook until they accepted our PR. |
Right now in sos you can use parameter |
Thanks! Hopefully Jupyterlab would accept 6606 soon. Would love to have line-by-line execution with variables. |
@gaow It is possible to retain
might work all right, but
would fail miserably because there is no information on number of substeps. I guess the bottomline is that
would not work in the current implement either so it is not going worse. |
Well, at least in my workflows outputs are mostly derived from inputs. I think it is good enough to support this scenario. We did not stress heavily on line-by-line development for SoS Workflows but it is good to see there is a need for it. |
I have pushed some changes to allow persistent I am willing to make the change because it allows easier debugging of actions involving |
Unfortunately jupyterlab/jupyterlab#6606 was rejected so the behavior will be different between classic Jupyter and JupyterLab unless we change the behavior on the classic jupyter end.. |
I think this also gives us an opportunity to fine tune the behavior. That is to say, we can add a property in our language module and limit the "full block" behavior only to Python and SoS. |
@BoPeng is the line-by-line execution feature broken? I cannot seem to get it work now with latest JupyterLab, although Jupyter Notebook works: when I hit ctrl shift enter nothing happens. |
That is now a jupyterlab feature. I think I enabled the shortcut but perhaps I did not. Check if run in console from menu works. |
Sorry I cannot seem to find that "run in console" in menu ... yes it would be nice if we are consistent with Jupyter Notebook IDE for SoS. I'm on the current pip release of Jupyterlab version 1.1.4 |
It appears to be working, but not at first when the SoS kernel has not been started, which by itself could be a bug. |
I am not sure this is related the main issue here but I've noticed a very similar issue to the one @gaow is seeing. It is visible at http://sosworkflows.com/ If you start a new SoS console and type anything, nothing will happen. When running locally, I also see the following error:
I found this solution: create an empty SoS notebook then create the SoS console, and it should work. This seems to be caused by
|
Thanks for the report. I will have a look. |
Great ! Thanks. And thank you for making such a great extension like SoS. |
I pushed a simple fixes and the console appears to be working. However, because the console cannot communicate with the backend to get a list of kernels, it does not have the language dropdown so the console is not fully operational. I suppose with some more work we can get the language dropdown working for this case but maybe it does not worth the trouble. |
Thanks ! |
I am trying to develop some scripts in Jupyterlab-sos so I need to run and test code line by line. I have two blocks of code here. The first one is global variable definition, second one is something I need to run in bash.
When I ran line by line. It seems the variables were not recognized. How should I deal with this situation? I used ctrl+shift+enter to run line by line in a jupyterlab-sos browser interface.
The text was updated successfully, but these errors were encountered: