The 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.
I have itango 0.1.6 installed. I mainly use it for auto device and attribute completion. Works great.
[/quote]
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.
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.
import Jupytango as jt
# refresh period in sec
rp = 0.25
jt.open_tango_attribute_monitor("sys/tg_test/1/double_image_ro", rp)
jt.open_tango_attribute_monitor("sys/tg_test/1/double_spectrum_ro", rp)
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:
$ python -m itango.install
[...]
Installing ITango kernelspec for jupyter...
Installed ITango kernelspec in /home/username/.local/share/jupyter/kernels/tango
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).
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.
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.