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

Edited 7 years ago
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:
$ pip install itango
$ python -m itango.install

Then ITango should appear in the kernel list.
Edited 7 years ago
Vincent M
Are you planning to share the sources?
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.

Vincent M
Also, did you give the ITango jupyter kernel a try?
I have itango 0.1.6 installed. I mainly use it for auto device and attribute completion. Works great.

nleclercq
I have itango 0.1.6 installed. I mainly use it for auto device and attribute completion. Works great.

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
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?

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.

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)
Edited 7 years ago
nleclercq
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.

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.
Edited 7 years ago
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).


Edited 7 years ago
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.

Edited 7 years ago
 
Register or login to create to post a reply.