Amazing Jupyter
|
|
---|---|
Here is an example [1] of what can be done today with python, jupyter, ipywidgets, bokeh and a very few lines of JavaScript code (scan area tool). This is a POC for a tool dedicated to our continuous scanning platform called flyScan. Hope you'll enjoy it. [1] supposed to be read by any recent video player |
|
|
---|---|
It looks great! Are you planning to share the sources? Also, did you give the ITango jupyter kernel a try? You can install it using:
Then ITango should appear in the kernel list. |
|
|
---|---|
Vincent MThe interesting part here is the asynchronous refresh of the plots (and/or the widgets). You can have your data periodically updated while working in another cell. That's pretty cool. Another nice feature is the ability to route any output to the "initial cell" (instead of having it displayed into the 'current' or 'active' cell). The code is closely linked to our flyScan API but it could at as a starting point. I will attach it to this post ASAP. Vincent MI have itango 0.1.6 installed. I mainly use it for auto device and attribute completion. Works great. |
|
|
---|---|
nleclercq I'm a bit confused… I noticed in your video that you're using the python 2 kernel, so how do you import the itango features into jupyter? |
|
|
---|---|
Vincent M Well, I didn't even know that itango is not python 2 compatible. The fact is that it works perfectly under both python 2 & 3. I'm using jupyter core 4.2.1. |
|
|
---|---|
Vincent, Attached is a light version of the code providing a tango attribute monitor for Jupyter. Despite the fact that it's a POC, the code is quite clean and stable. Part of it, could be more pythonic may be :) For usage, please have a look to this live demo. This movie show what's happen when the device die and show up again.
|
|
|
---|---|
nleclercq Sorry I wasn't so clear, itango is compatible with python 2 and 3. ITango is mainly an IPython profile, but it also provides a jupyter kernel using this same profile since itango-0.1.4. If you want to give it a try, first make sure you have ipykernel>=4.4 installed. Then run: ITango should appear in the jupyter kernel list, so you can use the itango features inside jupyter:The kernel is displayed on the top-right corner of the window: This feature is still undocumented, I'll have to update the docs at some point. |
|
|
---|---|
I get ITango in the kernel menu in both python 2 & 3. ITango 0.1.6 actually works with python 2.7.12 and ipykernel 4.5.2 (that's what I got from the latest miniconda2). |
|
|
---|---|
Dear Nicolas + Vincent, the demos are really cool. Would it be possible to write a how to install your extension. It look really very useful and I can imagine a number of places where we could use this. Thanks in advance. Andy |
|
|
---|---|
Andy, In my mind, the code I attached to one of my previous posts is an example of what could be done to add a 'dynamic monitor' to itango. It mainly illustrates how to solve all the asynchronous constraints you face when you want to periodically refresh a plot (or some widgets) located in a specific notebook cell or want to redirect an output to a specific cell. The idea is just to save Vincent's time in case he plans to integrate this kind of features in itango. Vincent's would certainly want to switch to an events based implementation of the monitor. In this case the provided code will help him to focus on the Tango aspects - the Jupyter/ipywidgets/bokeh part being already solved. Hope I'm clear. |