Coder Social home page Coder Social logo

nslsii's Introduction

NSLS-II

Repository of tools used for both data collection and analysis at NSLS-II.

This is a home for facility-wide tools: code that is generalized for use at multiple beamlines but not necessarily generalized for use at multiple facilties.

For an overview of the NSLS-II software see the NSLS2 software overview.

nslsii's People

Stargazers

 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

nslsii's Issues

Update the Eurotherm device with a Timer and real lock

There are 2 tasks required to be completed on nslsii.temperature_controllers.Eurotherm

  1. It has been requested to add a threading.Timer instance that runs inside status_indicator to ensure that the status_indicator callback is removed from self.readback after a timeout to prevent hanging.

  2. it has been requested to replace self._set_lock with a threading.Lock instance (I think this is what is meant by 'real lock').

Discussion on pro/cons of moving profile content in repo

My understanding is that we plan to gradually move IPython profile content into this package, such that a beamline's IPython "startup" configuration is reduced to:

from nsls2tools.BEAMLINE.startup import *

IPython profiles can continue to be used for personal customization, which is what IPython intends them for.

In my view, the rationale for this change is:

  • With bluesky and ophyd 1.0 coming up, it's natural time to harden the configurations.
  • The configuration -- including its instance variables names -- is part of a beamline's public API, and it would be nice to be able to write automated integration tests and sphinx documentation against it.
  • Moving the configs into one repo increases the visibility of changes, both to DAMA and to the handful of BL staff who take an interest in facility-wide standardization.

I know @stuwilkins has some additional thoughts, related how to users interact with the profiles, but I'm not I could summarize them well, so I'll leave that to him if he has time.

On the other hand, @tacaswell has some strongly-held concerns that I failed to absorb in initial conversations about this. Tom, would you mind spelling them out here?

Xspress3Channel class

I wish that the Xspress3Channel class in nslsii/detectors/xspress3.py defined an attribute like this near line 433

extra_rois_enabled = Cpt(EpicsSignal, 'PluginControlValExtraROI')

Seems silly to subclass just to add this obviously useful attribute.

SIX devices that should be defined here

Below are listed the devices in the SIX profile that I think should be ifted to nsls-ii

The EPU device defined here, including all of the preceding positioner classes (This EPU is identical to the ESM one and very similar to CSX/IOS versions).

The 2 types of baffle/exit slits defined here, including all of the virtual positioners and Devices. (These are identical to items used at ESM and very similar to some used at CSX/IOS. (NOTE: Six has used pre defined positions class for a few of these, and will likely want to use it for more).

The front end slits defined here, Identical front end slits are used on all beamlines.

All the photon shutter and gatevalves defined here,many versions of two button shutter exist.

There is a lot of Lakeshore 336 stuff here. As the lakeshore 336 is an NSLS-II standard temp controllerthis should be moved to nsls-ii.

A new facility wide PGM IOC is being developed, once that is done we should write a facility PGM class to replace what is here](https://github.com/NSLS-II-SIX/profile_collection/blob/master/startup/84-pgm.py).

Add an enum with the supported asset registry specs.

At least once, we have accidentally misspelled the spec string in a Resource document. It would be smart to import these strings rather than hard-coding them in beamline profiles. This library seems like the right place to put it.

h/t @jklynch whose suggestion this is

Caproto API break for nslsii.iocs.thermo_sim

An attempt to build nslsii v0.2.0 with conda (see conda-forge/nslsii-feedstock#4) resulted in the following error:

import: 'nslsii.iocs.thermo_sim'
Traceback (most recent call last):
  File "/home/conda/feedstock_root/build_artifacts/nslsii_1629837377820/test_tmp/run_test.py", line 50, in <module>
    import nslsii.iocs.thermo_sim
  File "/home/conda/feedstock_root/build_artifacts/nslsii_1629837377820/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/python3.7/site-packages/nslsii/iocs/thermo_sim.py", line 8, in <module>
    class Thermo(PVGroup):
  File "/home/conda/feedstock_root/build_artifacts/nslsii_1629837377820/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/python3.7/site-packages/nslsii/iocs/thermo_sim.py", line 44, in Thermo
    @readback.scan(period=.1, use_scan_field=True)
  File "/home/conda/feedstock_root/build_artifacts/nslsii_1629837377820/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/python3.7/site-packages/caproto/server/server.py", line 1028, in scan
    '`use_scan_field=True` requires `record="..."` to be set'
caproto._utils.CaprotoValueError: `use_scan_field=True` requires `record="..."` to be set

Looks like the API of caproto has changed. I am going to skip that exact test, but we need to fix it in the next release.

LIX devices that should be defined here

Below are listed the devices in the LIX profile that I think should be lifted to nsls-ii

The vacuum equipment defined here. This will be useful when combined with the future pre-defined positions class, as it will allow for automated venting, pump-down, gas dosing, etc. etc. which most beamlines would want.

There are shutters here that should be converted to an nsls-ii standard.

A similar BEST mirror positioner exists at ESM so the class here should be lifted.

There are a number of version of Tiff plugin and StandardProsilica here that we should incorporate into the ophyd versions.

We have a few Pilatus detectors on the floor so the stuff here should be ooked at to see what can and can't be lifted.

We have a few vortex detectors on the floor so the stuff here should be lifted.

[CSX] FE Slits

Write ophyd device for primary (FE) slits, should be relevant to all beamlines

Add loggers aimed at Elasticsearch

We need a Python logging handler that submits data to Elastic. Specifically it should submit at POST request like this:

curl -X "PUT" cmb03.cs.nsls2.local:9200/SOME_SENSIBLE_INDEX_NAME/_doc/1 -d '{"hello": "world"}' -H "Content-Type: application/json" 

There may already be a nice library of StackOverflow snippet for making HTTP requests from Python loggers. If not, I would just roll something using requests.

Devices from FMX that should be defined here

Below are a number of items from the FMX profile_collection that should be defined here.

The undulator defined here should be standardized and defined in nsls-ii.

the front end slits and baffle slits defined here should be standaridzed as they are used in numerous beamlines.

These devices here are also defined in FMX and so should probably be lifted to here.

This BEST mirror motion device is used here at AMX, LIX and ESM and so a standard version should be lifted to nsls-ii.

We have a few Eiger detectors on the floor similar to here that we should standardize and raise to nsls-ii

The powerbrick form here is also used at AMX, we should standardize to one in nsls-ii.

The Zebra found here is also used at AMX so we should standardize to one in nsls-ii

ENH: A new experiment command

Expected Behavior

What will happen after execuate bsui
1.

Welcome to XXX beamline. May I have your name:
>>> 
If you know your gup number, type in below:
>>>
If you know your saf number, type in below:
>>>
  1. Create session.json and store above data, if session.json exist, overwrite it.
  2. init conda and ipython(other bsui task)

After entering bsui(ipython)

  • new_experiment(gup=0, saf=0, name='Def'...) could overwrite session.json
  • list_experiment_info will print session.json
  • end_experiment will delete session.json
  • RE() will check if session.json exist. If it's, load it as equivalent RE.md['saf'] = "123456"

Options
bsui --develop will skip prompt to make development easier
bsui --continue won't overwrite existing session.json

Possible Solution

  1. Three functions in packagenslsii. BMM has a example in 08-user.py
  • new_experiment
  • list_experiment_info
  • end_experiment
  1. Update bsui. A good source of prompt code might be cookiecutter. It's depend on click

  2. A location and format of file session.json, maybe:

{
    'name': "Abc",
    'date': "yyyy-mm-dd HH:mm:ss.SSS",
    'gup': "123456",
    'saf': "123456"
}

Triggering of xspress3 at BMM takes 2.5s for 0.5s exposure

This part of the code seems to be a bottleneck (see the attached picture with the ts_msg_hook-generated output):

def trigger(self):
if self._staged != Staged.yes:
raise RuntimeError("not staged")
self._status = DeviceStatus(self)
self.settings.erase.put(1)
self._acquisition_signal.put(1, wait=False)
trigger_time = ttime.time()
for sn in self.read_attrs:
if sn.startswith('channel') and '.' not in sn:
ch = getattr(self, sn)
self.dispatch(ch.name, trigger_time)
self._abs_trigger_count += 1
return self._status

20200813_155248

gcc related package installed issue with solution

Issue

$ pip install -e .
Obtaining file:///Users/kz2249/nslsii
Requirement already satisfied: bluesky in /Users/kz2249/bluesky (from nslsii==0.0.6+53.g5dbb1ff.dirty) (1.5.0.post6.dev0+g9069d573)
Requirement already satisfied: caproto in /Users/kz2249/caproto (from nslsii==0.0.6+53.g5dbb1ff.dirty) (0.3.0+10.gc00f4a63)
Requirement already satisfied: databroker in /Users/kz2249/databroker (from nslsii==0.0.6+53.g5dbb1ff.dirty) (0.11.2rc1.post2+gfc035b3)
Requirement already satisfied: ipython in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from nslsii==0.0.6+53.g5dbb1ff.dirty) (6.5.0)
Collecting ipywidgets (from nslsii==0.0.6+53.g5dbb1ff.dirty)
  Using cached https://files.pythonhosted.org/packages/30/9a/a008c7b1183fac9e52066d80a379b3c64eab535bd9d86cdc29a0b766fd82/ipywidgets-7.4.2-py2.py3-none-any.whl
Requirement already satisfied: matplotlib in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from nslsii==0.0.6+53.g5dbb1ff.dirty) (3.0.2)
Requirement already satisfied: numpy in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from nslsii==0.0.6+53.g5dbb1ff.dirty) (1.15.4)
Requirement already satisfied: ophyd in /Users/kz2249/ophyd (from nslsii==0.0.6+53.g5dbb1ff.dirty) (1.3.0.post167.dev0+g39811f6)
Collecting psutil (from nslsii==0.0.6+53.g5dbb1ff.dirty)
  Downloading https://files.pythonhosted.org/packages/2f/b8/11ec5006d2ec2998cb68349b8d1317c24c284cf918ecd6729739388e4c56/psutil-5.6.1.tar.gz (427kB)
    100% |████████████████████████████████| 430kB 6.9MB/s 
Collecting pyolog (from nslsii==0.0.6+53.g5dbb1ff.dirty)
  Downloading https://files.pythonhosted.org/packages/6d/6e/78346a1f160a3054bb7c42e74034a6d76d1cebe3171f5eb686012a3f6052/pyOlog-4.4.2-py3-none-any.whl
Requirement already satisfied: requests in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from nslsii==0.0.6+53.g5dbb1ff.dirty) (2.19.1)
Requirement already satisfied: cycler in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from bluesky->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.10.0)
Requirement already satisfied: event-model>=1.5.0 in /Users/kz2249/event-model (from bluesky->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.6.0+12.g3bf2d0c)
Requirement already satisfied: historydict in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from bluesky->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.2.1)
Requirement already satisfied: jsonschema in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from bluesky->nslsii==0.0.6+53.g5dbb1ff.dirty) (2.6.0)
Requirement already satisfied: super_state_machine in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from bluesky->nslsii==0.0.6+53.g5dbb1ff.dirty) (2.0.2)
Requirement already satisfied: toolz in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from bluesky->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.9.0)
Requirement already satisfied: tqdm in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from bluesky->nslsii==0.0.6+53.g5dbb1ff.dirty) (4.22.0)
Requirement already satisfied: attrs in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (18.1.0)
Requirement already satisfied: boltons in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (18.0.0)
Requirement already satisfied: dask in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.17.2)
Requirement already satisfied: doct in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.0.5)
Requirement already satisfied: humanize in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.5.1)
Requirement already satisfied: jinja2 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (2.10)
Requirement already satisfied: mongoquery in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.3.3)
Requirement already satisfied: pandas in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.23.4)
Requirement already satisfied: pims in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.4.1)
Requirement already satisfied: pytz in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (2018.5)
Requirement already satisfied: pyyaml in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (3.12)
Requirement already satisfied: six in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.11.0)
Requirement already satisfied: tifffile in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.14.0)
Requirement already satisfied: tzlocal in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.5.1)
Requirement already satisfied: traitlets>=4.2 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (4.3.2)
Requirement already satisfied: jedi>=0.10 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.12.1)
Requirement already satisfied: backcall in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.1.0)
Requirement already satisfied: pexpect; sys_platform != "win32" in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (4.6.0)
Requirement already satisfied: appnope; sys_platform == "darwin" in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.1.0)
Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.15 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.0.15)
Requirement already satisfied: simplegeneric>0.8 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.8.1)
Requirement already satisfied: pickleshare in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.7.4)
Requirement already satisfied: pygments in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (2.2.0)
Requirement already satisfied: decorator in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (4.3.0)
Requirement already satisfied: setuptools>=18.5 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (40.5.0)
Requirement already satisfied: ipykernel>=4.5.1 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (5.1.0)
Collecting widgetsnbextension~=3.4.0 (from ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty)
  Using cached https://files.pythonhosted.org/packages/8a/81/35789a3952afb48238289171728072d26d6e76649ddc8b3588657a2d78c1/widgetsnbextension-3.4.2-py2.py3-none-any.whl
Requirement already satisfied: nbformat>=4.2.0 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (4.4.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from matplotlib->nslsii==0.0.6+53.g5dbb1ff.dirty) (2.2.0)
Requirement already satisfied: python-dateutil>=2.1 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from matplotlib->nslsii==0.0.6+53.g5dbb1ff.dirty) (2.7.3)
Requirement already satisfied: kiwisolver>=1.0.1 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from matplotlib->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.0.1)
Requirement already satisfied: networkx>=2.0 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ophyd->nslsii==0.0.6+53.g5dbb1ff.dirty) (2.1)
Requirement already satisfied: pyepics in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ophyd->nslsii==0.0.6+53.g5dbb1ff.dirty) (3.3.1)
Requirement already satisfied: idna<2.8,>=2.5 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from requests->nslsii==0.0.6+53.g5dbb1ff.dirty) (2.7)
Requirement already satisfied: certifi>=2017.4.17 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from requests->nslsii==0.0.6+53.g5dbb1ff.dirty) (2018.11.29)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from requests->nslsii==0.0.6+53.g5dbb1ff.dirty) (3.0.4)
Requirement already satisfied: urllib3<1.24,>=1.21.1 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from requests->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.23)
Requirement already satisfied: prettytable in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from doct->databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.7.2)
Requirement already satisfied: MarkupSafe>=0.23 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from jinja2->databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.0)
Requirement already satisfied: slicerator>=0.9.7 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from pims->databroker->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.9.8)
Requirement already satisfied: ipython_genutils in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from traitlets>=4.2->ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.2.0)
Requirement already satisfied: parso>=0.3.0 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from jedi>=0.10->ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.3.1)
Requirement already satisfied: ptyprocess>=0.5 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from pexpect; sys_platform != "win32"->ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.6.0)
Requirement already satisfied: wcwidth in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from prompt-toolkit<2.0.0,>=1.0.15->ipython->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.1.7)
Requirement already satisfied: jupyter_client in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipykernel>=4.5.1->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (5.2.4)
Requirement already satisfied: tornado>=4.2 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from ipykernel>=4.5.1->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (4.5.2)
Collecting notebook>=4.4.1 (from widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty)
  Downloading https://files.pythonhosted.org/packages/0a/d8/4e9521354ed3d730ba6d8a5af440b66c73245ef46be706e51bead71afc21/notebook-5.7.6-py2.py3-none-any.whl (9.0MB)
    100% |████████████████████████████████| 9.0MB 3.1MB/s 
Requirement already satisfied: jupyter_core in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from nbformat>=4.2.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (4.4.0)
Requirement already satisfied: pyzmq>=13 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from jupyter_client->ipykernel>=4.5.1->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (17.1.0)
Requirement already satisfied: prometheus-client in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.3.1)
Requirement already satisfied: Send2Trash in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.5.0)
Requirement already satisfied: terminado>=0.8.1 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.8.1)
Collecting nbconvert (from notebook>=4.4.1->widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty)
  Downloading https://files.pythonhosted.org/packages/b8/39/1e67fea74dc9577cc49f9863fe3ec824e525d1304ab6027d95a94cd586f5/nbconvert-5.4.1-py2.py3-none-any.whl (407kB)
    100% |████████████████████████████████| 409kB 7.2MB/s 
Requirement already satisfied: testpath in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.3.1)
Requirement already satisfied: defusedxml in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.5.0)
Requirement already satisfied: bleach in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (2.1.3)
Requirement already satisfied: pandocfilters>=1.4.1 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.4.2)
Requirement already satisfied: entrypoints>=0.2.2 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.3)
Requirement already satisfied: mistune>=0.8.1 in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.8.3)
Requirement already satisfied: html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (1.0.1)
Requirement already satisfied: webencodings in /Users/kz2249/miniconda3/envs/py3/lib/python3.6/site-packages (from html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre->bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.4.0->ipywidgets->nslsii==0.0.6+53.g5dbb1ff.dirty) (0.5.1)
Building wheels for collected packages: psutil
  Building wheel for psutil (setup.py) ... error
  Complete output from command /Users/kz2249/miniconda3/envs/py3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/b9/sd0d6xvd5tq7k8zt120mrhsr0000gn/T/pip-install-ngft3qsn/psutil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/b9/sd0d6xvd5tq7k8zt120mrhsr0000gn/T/pip-wheel-qukpwrrq --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.7-x86_64-3.6
  creating build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_common.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_compat.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_psaix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_psbsd.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_pslinux.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_psosx.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_psposix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_pssunos.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  copying psutil/_pswindows.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
  creating build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/__main__.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_aix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_bsd.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_connections.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_contracts.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_linux.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_memory_leaks.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_misc.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_osx.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_posix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_process.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_sunos.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_system.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_unicode.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  copying psutil/tests/test_windows.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
  running build_ext
  building 'psutil._psutil_osx' extension
  creating build/temp.macosx-10.7-x86_64-3.6
  creating build/temp.macosx-10.7-x86_64-3.6/psutil
  creating build/temp.macosx-10.7-x86_64-3.6/psutil/arch
  creating build/temp.macosx-10.7-x86_64-3.6/psutil/arch/osx
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/kz2249/miniconda3/envs/py3/include -arch x86_64 -I/Users/kz2249/miniconda3/envs/py3/include -arch x86_64 -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=561 -DPSUTIL_OSX=1 -I/Users/kz2249/miniconda3/envs/py3/include/python3.6m -c psutil/_psutil_common.c -o build/temp.macosx-10.7-x86_64-3.6/psutil/_psutil_common.o
  FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!
  error: command 'gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for psutil
  Running setup.py clean for psutil
Failed to build psutil
Installing collected packages: nbconvert, notebook, widgetsnbextension, ipywidgets, psutil, pyolog, nslsii
  Running setup.py install for psutil ... error
    Complete output from command /Users/kz2249/miniconda3/envs/py3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/b9/sd0d6xvd5tq7k8zt120mrhsr0000gn/T/pip-install-ngft3qsn/psutil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/b9/sd0d6xvd5tq7k8zt120mrhsr0000gn/T/pip-record-gjus6ew6/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.6
    creating build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_common.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_compat.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_psaix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_psbsd.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_pslinux.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_psosx.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_psposix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_pssunos.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    copying psutil/_pswindows.py -> build/lib.macosx-10.7-x86_64-3.6/psutil
    creating build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/__main__.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_aix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_bsd.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_connections.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_contracts.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_linux.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_memory_leaks.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_misc.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_osx.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_posix.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_process.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_sunos.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_system.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_unicode.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    copying psutil/tests/test_windows.py -> build/lib.macosx-10.7-x86_64-3.6/psutil/tests
    running build_ext
    building 'psutil._psutil_osx' extension
    creating build/temp.macosx-10.7-x86_64-3.6
    creating build/temp.macosx-10.7-x86_64-3.6/psutil
    creating build/temp.macosx-10.7-x86_64-3.6/psutil/arch
    creating build/temp.macosx-10.7-x86_64-3.6/psutil/arch/osx
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/kz2249/miniconda3/envs/py3/include -arch x86_64 -I/Users/kz2249/miniconda3/envs/py3/include -arch x86_64 -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=561 -DPSUTIL_OSX=1 -I/Users/kz2249/miniconda3/envs/py3/include/python3.6m -c psutil/_psutil_common.c -o build/temp.macosx-10.7-x86_64-3.6/psutil/_psutil_common.o
    FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/Users/kz2249/miniconda3/envs/py3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/b9/sd0d6xvd5tq7k8zt120mrhsr0000gn/T/pip-install-ngft3qsn/psutil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/b9/sd0d6xvd5tq7k8zt120mrhsr0000gn/T/pip-record-gjus6ew6/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/b9/sd0d6xvd5tq7k8zt120mrhsr0000gn/T/pip-install-ngft3qsn/psutil/
You are using pip version 19.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Solution

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin16/8.2.0/lto-wrapper
Target: x86_64-apple-darwin16
Configured with: /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.2.0/configure --prefix=/opt/local --build=x86_64-apple-darwin16 --enable-languages=c,c++,objc,obj-c++,lto,fortran --libdir=/opt/local/lib/gcc8 --includedir=/opt/local/include/gcc8 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-8 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-8 --with-gxx-include-dir=/opt/local/include/gcc8/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-tls --with-pkgversion='MacPorts gcc8 8.2.0_0'
Thread model: posix
gcc version 8.2.0 (MacPorts gcc8 8.2.0_0) 
$ port select --list gcc
Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
Available versions for gcc:
	mp-gcc8 (active)
	none
$ sudo port select --set gcc none
Password:
Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
Selecting 'none' for 'gcc' succeeded. 'none' is now active.

CMS devices that should be defined here

Below are listed the devices in the SIX profile that I think should be lifted to nsls-ii

The 'blades' defined [here](Below are listed the devices in the SIX profile that I think should be ifted to nsls-ii) are similar to the baffle slits defined in SIX, ESM, CSX and IOS.

We probably should have an nsls-ii class for keithleys as seen here

The shutters and gatevalves here should be converted to an nsls-ii shutter class.

There are a number of vacuum related ophyd object clases in here that we should look to have here instead, these will be useful for most beamlines particularly in conjunction with pre-defined positions which will allow for automated pump-downs etc.

Consider adding a DEBUG-level handler to get_ipython().log

This produces some useful additional output at startup, logging each startup script that is run. It doesn't appear to add much non-useful noise, from a user point of view.

ip = get_ipython()
ip.log.addHandler(...)
ip.log.setLevel(...)  # maybe not needed?

Update to incorporate PersistentDict in line

See https://gist.github.com/jklynch/a4366b8900ec0c03883403455ae711b2

This should probably wait on bluesky/bluesky#1388 being resolved so that we vendor a version of PersistentDict with a fix for that.

  • Vendor a copy of PersistentDict so it may be used if we are in an older version of bluesky.
  • Update this directory to be consistent with the one in the gist.

directory = os.path.expanduser("~/.config/bluesky/md")

qt_kicker doesn't work for all versions of notebooks

from bluesky.utils import install_kicker
install_kicker()

NotImplementedErrorTraceback (most recent call last)
<ipython-input-30-1631198442ac> in <module>()
----> 1 install_kicker()

/opt/conda_envs/collection-2018-1.0/lib/python3.6/site-packages/bluesky/utils.py in install_kicker(loop, update_rate)
    719     else:
    720         raise NotImplementedError("The matplotlib backend {} is not yet "
--> 721                                   "supported.".format(backend))
    722 
    723 

NotImplementedError: The matplotlib backend module://ipykernel.pylab.backend_inline is not yet supported.

This is because install_kicker performs:

    import matplotlib
    backend = matplotlib.get_backend()
    if backend == 'nbAgg':
        install_nb_kicker(loop=loop, update_rate=update_rate)
    elif backend in ('Qt4Agg', 'Qt5Agg'):
        install_qt_kicker(loop=loop, update_rate=update_rate)
    else:
        raise NotImplementedError("The matplotlib backend {} is not yet "
                                  "supported.".format(backend))

and the output of the matplotlib backend is not one of the cases in the if statements:

import matplotlib
backend = matplotlib.get_backend()

backend
Out: 
'module://ipykernel.pylab.backend_inline'

Quick solution :
Add 'module://ipykernel.pylab.backend_inline' to the possible cases in the if statements. But likely we should think more carefully on this.

remove 'modal' classes

from #18

I didn't see this go by last week :/ I am not sure that any of the 'modal' classes should have made it out of the hxntools as they are to support the very specific way that HXN is configured. Any classes we don't need to make the exspress3 work at ex SRX should be deleted.

CHX devices that should be defined here

Below are listed the devices in the CHX profile that I think should be lifted to nsls-ii

The items here are essentially the same as those used for 'baffle slits' or 'blades' at SIX, ESM, CSX, IOS and CMS.

Although not yet installed both SIX and ESM have smarpods, we should probably elevate these clases as a pre-emptive strike. They should all be combined into one 'device' as well.

I think we should also look to have a common IVU class as well, CHX version is here

I suspect that these TIFF plugins and StandardProsilica classes should actually be in nsls-ii as well (I have seen a few version of these in SIX, and CMS already but did not include them in the corresponding issues.)

We have a few Eiger's around, so these and these should be lifted into nsls-ii, or possibly ophyd. There is more Eiger stuff here

There are a few fastshutters on the floor so this should be lifted

Everything here should be using a common shutter/gate-valve class.

There are a few xspress3 detectors around, so the stuff here should be pulled up.

ENH: parametrize TwoButtonShutter

Currently, the TwoButtonShutter class has hard-coded string values for opening/closing the shutter (open_str = 'Open' and close_str = 'Close'):

class TwoButtonShutter(Device):
# TODO: this needs to be fixed in EPICS as these names make no sense
# the value coming out of the PV does not match what is shown in CSS
open_cmd = Cpt(EpicsSignal, 'Cmd:Opn-Cmd', string=True)
open_val = 'Open'
close_cmd = Cpt(EpicsSignal, 'Cmd:Cls-Cmd', string=True)
close_val = 'Not Open'
status = Cpt(EpicsSignalRO, 'Pos-Sts', string=True)
fail_to_close = Cpt(EpicsSignalRO, 'Sts:FailCls-Sts', string=True)
fail_to_open = Cpt(EpicsSignalRO, 'Sts:FailOpn-Sts', string=True)
enabled_status = Cpt(EpicsSignalRO, 'Enbl-Sts', string=True)
# user facing commands
open_str = 'Open'
close_str = 'Close'

SMI needs Insert/Retract combinations.

Some other beamlines may have the same. Maybe SMI can use the same approach as PDF and standardize Open/Close user-facing commands.

Brainstorming things that could go in this repo

A partial list:

  • Ophyd devices for IOCs that are custom to NSLS-II
  • A template IPython profile startup directory that includes such NSLS-II-isms as pyOlog configuration
  • Asset handlers for file layouts custom to NSLS-II
  • Analysis code (perhaps ultimately on its way to scikit-beam, but that requires more community review/approval)

implement a "baton IOC"

Write a (caproto) IOC to hold a "baton" string.

The idea is that:

  • at init the bsui "takes the baton" by writing a unique key to the IOC
  • at call time the RE (via a pre-processor) checks that it "still has the baton" (that is its key is still in the baton PV), if not fail to start
  • provide a method that will "steal the baton" to get control of the beamline again

For complex beamlines with more that one end station shared hardware it may be worth generalizing to a baton per shared Device / endstation.

xref bluesky/bluesky#17

attn @prjemian

[CSX] add EPU mode to EPU device

@stuwilkins
Future implementation of all possible linear polarized light will require a different EPU mode so let's go ahead and put the mode in the read attributes so that we see it in sd.baseline? Or would we rather put this in the configuration attributes?

Devices from AMX that should be defined here

Below are listed the devices in the AMX profile that I think should be lifted to nsls-ii

The undulator definedhere should probalbly be standardized and moved to nsls-ii

All beamlines have the same front end slits, as defined here these should be standardized in nsls-ii

The Tiff plugin and StandardProsilica items defined here should be defined here or in ophyd.

Here is another instance of the best controller used also at LIX and ESM, we should make a standard class for these.

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.