bluesky / bluesky-enhancement-proposals

0 stars 4 forks source link

Enhance IPython integration #18

Open danielballan opened 4 years ago

danielballan commented 4 years ago

From the start, we have heard the concern that bluesky is verbose compared to predecessors such as SPEC. (Indeed, many rooms' full of oxygen have been spent on this subject.) We would like to avoid inventing a custom language for bluesky. If users type valid Python when the use bluesky, then they can Google their questions, and the knowledge that they gain will be generally useful extending beyond bluesky into data analysis as well. To some SPEC users, bluesky's choice to use a "real language" is an obviously-good thing; to others, the extra verbosity is a real sticking point.

How can we satisfy users and beamline staff without undercutting that goal? A theme advocated by @tacaswell in https://github.com/bluesky/bluesky/issues/1238 exploit the IPython front-end, which offers pluggable tab completion, input transformation, and magics. Some beamlines have experimented in this area. In this issue I would like to collect links to what has been tried so far and work toward moving some of it upstream into an "official" repo supported by the bluesky collaboration, including any interested beamline staff.

One example I know of, from @bruceravel:

https://nsls-ii-bmm.github.io/BeamlineManual/intro.html#getting-help-at-the-command-line

https://github.com/NSLS-II-BMM/profile_collection/blob/master/startup/95-magic.py

%se, %w %m are the ones I use the most in user ops. %ut is handy for maintenance.

%se is not properly documented yet. It has to do with providing relevant feedback related to changing absorption edges (i.e. I was measuring Ti, now I want to measure Cu...)