-
Notifications
You must be signed in to change notification settings - Fork 17
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
Widget support for SoS Notebook. #234
Comments
This is the illustration and we need to think how to insert the SoS kernel in it. https://ipywidgets.readthedocs.io/en/stable/examples/Widget%20Low%20Level.html |
Note that |
Try to organize my thought on what is happening:
The problem with widgets is that the widgets are created with the
It seems necessary to translate the IDs or force the use of |
OK, the frontend
The problem is with 4, because SoS does not actively listen to To solve this problem, the SoS kernel will have to actively check |
Finally, the solution is to add a function that forward all ioPub messages to frontend even when no cell is being evaluated. This allows frontend actions to be handled by the SoS kernel. The function is called by the controller in the controller's messaging loop in a separate thread so it responds a bit slower than the native widgets. |
Hi @BoPeng , thank you for this fix! I can't make it fully working, though. I am able to create the widget in Python3 subkernel and interact with it, but the number below is not updated. It is working fine in the SoS kernel or in vanilla Python3 notebook. It is possible that I am not installing something properly, so I give the sequence of steps below:
|
Update: the same problem if installing from the latest GitHub version (which I should have used):
|
I only tested for classic jupyter and I am testing JupyterLab now. It is likely that |
@BoPeng you are right indeed. If I do not install |
Here with |
After hours of message tracing, I finally understand what is going on here but I am not sure if I can find a solution. Allow me to explain the problem in detail:
This is how widget is supported by SoS Notebook. In JupyterLab, the same messages are sent but the frontend is not updated. Under the hood the following has happened:
So the difference between classic Jupyter and JupyterLab is the |
@ktaletsk I have submitted a patch. Please let me know if widget support is still not working on your side. |
@BoPeng it is working, thank you! |
SoS kernel blocks communication between kernels and frontend so that progress bar and other widgets from subkernels stopped working. We ignored this problem before but should try to address it now.
The following is just an example from tqdm webpage:
The text was updated successfully, but these errors were encountered: