Code Monkey home page Code Monkey logo

profile_collection's People

Contributors

benjaminocko avatar cryos avatar gfreychet avatar jklynch avatar mrakitin avatar tacaswell avatar

Watchers

 avatar  avatar

Forkers

jmaruland

profile_collection's Issues

Deployment 2020-2.0 checklist

Previsit

  • Make sure that the current latest environments are pushed to all the bl machines
  • Skim the IPython startup files in profile_collection
    • Check if it's safe to start bsui remotely (does it touch any hardware?) - use git grep .put or git grep caput
  • Check for outstanding PRs and issues on beamline repos
  • Check if beamline specific packages pushed to the BL machines
  • (Optional) Enable CI

Housekeeping

  • Add BL staff to the BL GitHub organization as owners
  • Work with BL staff to commit any un-committed changes to their profiles
  • Tag the profile as-found as 2019C3.x
  • Discuss with BL staff which conda envs they want to keep/delete and perform the cleanup
  • Check/update the beamline's inventory with the BL staff (in https://github.com/NSLS-II/playbooks/blob/master/production)

Test deployment

Deployment 2021-1.0 checklist

Previsit

  • Make sure that the current latest environments are pushed to all the bl machines
    conda env list
    
  • Skim the IPython startup files in profile_collection
    • Check if it's safe to start bsui remotely (does it touch any hardware?) - use git grep .put or git grep caput
  • Check for outstanding PRs and issues on beamline repos
  • (Optional) Enable CI

Housekeeping

  • Update conda
    $ su - <your-controls-account>
    $ sudo su -
    # conda activate base  # should be activated by default, but just in case.
    # conda install conda -c https://repo.anaconda.com/pkgs/main/
    
  • Add BL staff to the BL GitHub organization as owners
  • Work with BL staff to commit any un-committed changes to their profiles
  • Tag the profile as-found as 2020C2.1
  • Discuss with BL staff which conda envs they want to keep/delete and perform the cleanup
  • Check/update the beamline's inventory with the BL staff (in https://github.com/NSLS-II/playbooks/blob/master/production)
  • In ~/.bashrc, if necessary, update the logging environment variables to use directory /var/log/bluesky/... and add umask 0002.
    umask u=rwx,g=rwx,o=rx  # 0002
    export BLUESKY_LOG_FILE=/var/log/bluesky/bluesky.log
    export BLUESKY_IPYTHON_LOG_FILE=/var/log/bluesky/bluesky_ipython.log
    
    and (if needed) create that directory with the following permissions and ownership:
    sudo mkdir /var/log/bluesky
    sudo chown -Rv xf12id1:xf12id1 /var/log/bluesky
    sudo chmod -Rv g+rws /var/log/bluesky
    
    Remember to source ~/.bashrc.
  • Remove explicit setting of ophyd logging level from the first startup script
  • Double-check that if there is an open PR removing handlers, it is merged (and tested).
  • Update vendored copy of PersistentDict to bug-fixed version (see the updated gist snippet: https://gist.github.com/jklynch/a4366b8900ec0c03883403455ae711b2).
  • Make sure all repos have the BSD-3-Clause licenses (see NSLS-II-SRX/profile_collection#16 as an example)

Test deployment

  • Run profile against new environment
    • BS_ENV=collection-2021-1.0 bsui
  • Update the profile as needed to run
  • Test databroker v2
    from databroker import catalog
    cat = catalog['beamline_name']
    cat[-1].read()
    
  • Run acceptance tests (if any) and run a representative set of scans for the beamline
  • Tag the updated profile as 2021C1.0
  • Update BSUI via ansible to use the new environment (http://nsls-ii.github.io/deployment/upgrading-beamlines.html#change-bsui-s-default-environment)

make multiple plots in a plan

two quick sketches for how to make use of multiple LivePlots in one scan:

from functools import partial

from ophyd.sim import hw as _hw

from bluesky import RunEngine
from bluesky.plans import scan
from bluesky.callbacks.mpl_plotting import LivePlot
import bluesky.callbacks
import bluesky.preprocessors as bpp


hw = _hw()

bluesky.callbacks.mpl_plotting.initialize_qt_teleporter()

RE = RunEngine({})

def same_axes():
   def get_ax():
       import matplotlib.pyplot as plt
       return plt.figure('my plot').gca()

   lt =  LivePlot('det', 'motor', marker='x', markersize=10, ax=get_ax)
   lt2 =  LivePlot('det1', 'motor', marker='o', markersize=10, ax=get_ax)   
   return (yield from bpp.subs_wrapper(scan([hw.det, hw.det1], hw.motor, -5, 5, 30), [lt, lt2]))


def same_figure():
   def get_ax(i):
       import matplotlib.pyplot as plt
       fig = plt.figure('my plot')
       if len(fig.axes) == 0:
           fig.subplots(1, 2)
       return fig.axes[i]

   lt =  LivePlot('det', 'motor', marker='x', markersize=10, ax=partial(get_ax, i=0))
   lt2 =  LivePlot('det1', 'motor', marker='o', markersize=10, ax=partial(get_ax, i=1))   
   return (yield from bpp.subs_wrapper(scan([hw.det, hw.det1], hw.motor, -5, 5, 30), [lt, lt2]))


RE(same_figure())

In your actual use the hard coded lt and lt2 can be replaced with a loop over the y-values of interest.

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.