Code Monkey home page Code Monkey logo

bluesky's Introduction

CI Coverage PyPI License

Bluesky โ€” An Experiment Specification & Orchestration Engine

Source https://github.com/bluesky/bluesky
PyPI pip install bluesky
Documentation https://bluesky.github.io/bluesky
Releases https://github.com/bluesky/bluesky/releases

Bluesky is a library for experiment control and collection of scientific data and metadata. It emphasizes the following virtues:

  • Live, Streaming Data: Available for inline visualization and processing.
  • Rich Metadata: Captured and organized to facilitate reproducibility and searchability.
  • Experiment Generality: Seamlessly reuse a procedure on completely different hardware.
  • Interruption Recovery: Experiments are "rewindable," recovering cleanly from interruptions.
  • Automated Suspend/Resume: Experiments can be run unattended, automatically suspending and resuming if needed.
  • Pluggable I/O: Export data (live) into any desired format or database.
  • Customizability: Integrate custom experimental procedures and commands, and get the I/O and interruption features for free.
  • Integration with Scientific Python: Interface naturally with numpy and Python scientific stack.

Bluesky Documentation.

The Bluesky Project enables experimental science at the lab-bench or facility scale. It is a collection of Python libraries that are co-developed but independently useful and may be adopted a la carte.

Bluesky Project Documentation.

See https://bluesky.github.io/bluesky for more detailed documentation.

bluesky's People

Contributors

abbiemery avatar arkilic avatar awalter-bnl avatar callumforrester avatar cj-wright avatar cjtitus avatar coretl avatar danielballan avatar dmgav avatar dominicoram avatar ericdill avatar evalott100 avatar genematx avatar gwbischof avatar hhslepicka avatar jklynch avatar jrmlhermitte avatar ke-zhang-rd avatar klauer avatar ksunden avatar licode avatar maffettone avatar mikehart85 avatar mrakitin avatar prjemian avatar stuartcampbell avatar tacaswell avatar untzag avatar vshekar avatar zllentz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bluesky's Issues

Regarding table formatting

It would be interesting to deal with numeric formatting by setting an attribute on the Epics object.

Something like theta.numeric_format = '000.000' will always format theta with three numbers before and three numbers after the decimal. And sclr.numeric_format = 'int' will always format sclr as an integer. These are parameters that need to be decided by the beamline scientists, but this would make formatting the numbers super easy.

Move content from Blue Sky Demo notebook into docs

Most of this has already been salvaged, but at least one thing -- Tom's awesome fly scan plot -- has not. Once we get it all, we should nuke the notebook, which is way behind the current API and not as good a teaching tool as a the docs.

There should be "motors" that are actually lmfit Models

Transposing a one-sided gchat conversation with @tacaswell that he probably hasn't actually seen yet:

There should be set-able, readable objects that wrap lmfit Models. On 'set' they can be passed x and y data; on 'read' they can return a dict of best-fit values. The scan can use these values to decide which x points to sample next.

Center already does this in its way. But by putting Model in a motor-like object, you can easy integration with subscriptions. Like so:

def scan(motor, det, model)
    model = ModelObject(model)  # ModelObject can read and set
    Msg('subscribe', None, LiveModelPlot(x='motor', y='det', model=model)
    ret_mot = Msg('read', motor)
    ret_det = Msg('read', det)
    x = ret_mot['motor']['values']
    y = ret_det['det']['values']
    Msg('set', model, {'x': x, 'y': y})
    best_fit = Msg('read', model)
    Msg('set', motor, best_fit['center'])

When an Event is generated, LiveModelPlot can update the x and y data points and redraw a smooth best-fit curve, sampled more densely in x than the data itself.

Since the Model and its best fit results are driving the scan, best_fit is Level 0 data that belongs in metadatastore. If that sounds like a stretch, consider that some Models and fitting procedures incorporate randomness that would be impossible to replicate after the scan unless output from the fitting were captured as data.

Handle the cancel and timeout exceptions in the main run loop

Right now they will fall through to the default exception handling, we might want to handle one or the other in a way that drops the run into a paused state.

I think around all of the yield from calls at the top level we wrap those with try...except which will snarf and then either re-raise (to let the task really die) or drop it into a paused state to stop the loop and return control.

start up checklist

Make one of the startup files explicitly check all of the connectivity at IPython start time, ex check olog, mds, fs, ...

Callback for filestore validation

First-order: Make sure nothing raises DatumNotFound
Second-order: Validate and then hash contents and save attributes in new FS collection.

Long term: add ability to ask Area Detectors if they are done writing data.

Delay RunStop until all detectors are done. Therefore, all data should be available to validate and we ensure that we don't start a new run and screw up filenames.

For now, act under the assumption that when RunStop is written detector is about done so we can start validating its data in chronological order.

Add start confirmation command

A command that causes main thread to ask the user if they are sure they want to start the scan and wait for input before proceeding. This is maybe a minor variation on hard pause.

Make a list for docs of new features

lots of cool stuff that's easy to forget

a partial list to start:

  • Runs can be paused, aborted, and resumed with controllable checkpoints.
  • In addition to the built-in scans, users to specify custom scans and "macros" in a simple, procedural way. (You can use for loops!) There are many documented examples.
  • You can register new commands with the RunEngine -- say, to control your robot.
  • You can write your own high-level "motors" that control many PVs. Examples include coordinated motion and controllers like XPD's "gas switcher" that don't really map onto a continuous single-axis motor.
  • You can run collection from a Python script, no IPython involved. This will provide easy integration with beamline-specific control GUIs.
  • Optional automatic data export at the end of each run. This paves the way for prompt HPC.
  • Live plotting
  • Adaptive scans (sampling fast-changing regions more). There are ready-to-use functions and examples for writing your own.
  • Automated tests ensure stability of the project going forward.
  • Documentation, including:
    • how to configure new motors and detectors
    • how to write macros
    • how to start agents that pause or abort the run when danger or failure are detected
    • how to use a PV to trigger pause or abort
    • how set up customized live plots
    • how set up in situ analysis on a parallel process

Message validation

Various docstrings and docs claim that certain messages and message sequences are not allowed. We don't actually validate all of them yet, so the RunEngine is likely to fail in nasty ways if users break the rules.

A running list of things to validate:

  • 'checkpoint' must not come between 'create' and 'save
  • 'subscribe' cannot subscribe to 'start'
  • 'save' must follow 'create'
  • 'deconfigure' must follow a 'configure' with the same target

command all the things

Anything you can do to the run engine needs to be a valid command (including creating run start/run stop documents).

One use case is queing up N scans into a mega-scan and still having pause work right and working with the robot to change the sample, so you need to change the sample, which means you need a new run start ect.

Imagine: RE(itertools.chain(ascan, dscan, ct))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.