Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ sudo: false
env:
global:
- OFFICIAL_REPO="pcdshub/jet_tracking"
# Doctr deploy key for pcdshub/jet_tracking
- secure: "vUuAt00AjoyYdCEfrqDiYEBN/0j5Rg0YF4er9fwbtgzlb/q9eHjyEI1XZm+WrTZE1k6U3RHM4SLct7FWMYVMrJ5nDehZF2iaFbDMjSBbANe3+zj7iaBZsLRDh9tivALv1pqavtVivZ98ypiX/GGwvGgtruOeFAsYdCAabPpsRHzsMZzWYr5vkm+ylUtncsJBRuqaHEczf3NMIL7TdO5B3Qwsws1ohgMQfedby2DI4cgZ8jLcJ5ZVnfS0gshy1RNpWc+lY0xb6/dIHW2V6Ca+YAl6VcN8uiF6RD4XgaDvzoZTfwWI5BcvgBULS1w1/aUzSWAWYARVEwA0v/QJ/ftFmx602a9yvFWje67TEPuCYR0uDU/osDYywnkEZNVZuv5CGO8KncBi12zBUGRW+aPpr+59cUOpQhkoRfJAFXRBwsCrKrXSYubNv1K64S+C6SkuPOIdGJdurh7naMPK4S3yUQmJ4I/samGq5MCy560YcKqj7KtDiRwgqXa5ho6meoaFKBCsfFpcF8flcygsSTCIa0WaKm4s79HcbiqJEO/CwZvWAjpz2DDuxApebM2uRWBa5S0AyY9vCQMAojyP67wd6z/RoZenDMl3Vrc197+RRbbujvpI/XkTS1SOV/9K2/+lX+Tj0Xv5XImiBTIdq8LPo2QgyMna7H7HmJ1uDeqXlGM="

matrix:
include:
Expand Down
11 changes: 10 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
import sphinx_rtd_theme
import datetime
import matplotlib
matplotlib.use('Agg')


module_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),'../../')
sys.path.insert(0,module_path)



# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand All @@ -44,7 +46,6 @@
'IPython.sphinxext.ipython_directive',
'IPython.sphinxext.ipython_console_highlighting',
'matplotlib.sphinxext.mathmpl',
'matplotlib.sphinxext.only_directives',
'matplotlib.sphinxext.plot_directive',
# 'sphinx.ext.autosectionlabel'
'sphinx.ext.viewcode',
Expand All @@ -55,6 +56,14 @@
'sphinx.ext.mathjax',
]

try:
Comment thread
teddyrendahl marked this conversation as resolved.
import matplotlib.sphinxext.only_directives
except ImportError:
...
else:
extensions.append('matplotlib.sphinxext.only_directives')


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down
4 changes: 1 addition & 3 deletions docs/source/control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Jet Control Overview
####################

.. currentmodule:: jet_control
.. currentmodule:: jet_tracking.jet_control

To start ipython for cxi hutch-python3.

Expand Down Expand Up @@ -38,5 +38,3 @@ Attributes
JetControl.calibrate
JetControl.jet_calculate
JetControl.jet_move


13 changes: 6 additions & 7 deletions docs/source/devices.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _devices:

.. currentmodule:: jet_control
.. currentmodule:: jet_tracking.jet_control

Jet Tracking Classes
####################
Expand All @@ -9,7 +9,7 @@ Base classes used in jet tracking and control.
JetControl Class
----------------

.. autoclass:: jet_control.JetControl
.. autoclass:: JetControl

.. autosummary::

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this render the autosummary table for all the stuff below? Never done it quite this way.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm updating these at the request of @koglin and keeping them as close as possible to what he originally had.

We should definitely standardize/overhaul this at some point down the line.

:toctree: generated/
Expand All @@ -23,20 +23,19 @@ JetControl Class
Injector Class
--------------

.. autoclass:: devices.Injector
.. autoclass:: jet_tracking.devices.Injector

Questar Class
-------------

.. autoclass:: devices.Questar
.. autoclass:: jet_tracking.devices.Questar

Parameters Class
----------------

.. autoclass:: devices.Parameters
.. autoclass:: jet_tracking.devices.Parameters

Diffract Class
--------------

.. autoclass:: devices.Diffract

.. autoclass:: jet_tracking.devices.Diffract
12 changes: 6 additions & 6 deletions docs/source/sample_delivery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,37 @@ API
Sample Delivery System Class
----------------------------

.. autoclass:: devices.SDS
.. autoclass:: jet_tracking.devices.SDS


Selector Class
--------------

.. autoclass:: devices.Selector
.. autoclass:: jet_tracking.devices.Selector


CoolerShaker Class
------------------

.. autoclass:: devices.CoolerShaker
.. autoclass:: jet_tracking.devices.CoolerShaker


HPLC Class
----------

.. autoclass:: devices.HPLC
.. autoclass:: jet_tracking.devices.HPLC


PressureController Class
------------------------

.. autoclass:: devices.PressureController
.. autoclass:: jet_tracking.devices.PressureController


FlowInegrator Class
-------------------

.. autoclass:: devices.FlowIntegrator
.. autoclass:: jet_tracking.devices.FlowIntegrator



9 changes: 2 additions & 7 deletions docs/source/shared_memory.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _shared_memory:

.. currentmodule:: psana2epics
.. currentmodule:: jet_tracking.psana

Jet Tracking Shared Memory Application
######################################
Expand Down Expand Up @@ -62,9 +62,4 @@ API
:nosignatures:
:toctree: generated/

psana2epics.output_cspad_sum





output_cspad_sum
1 change: 1 addition & 0 deletions github_deploy_key_pcdshub_jet_tracking.enc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gAAAAABbzgZ0wRAYI2ZyFtnTpQf5GWFW19Z2gPS8Nwlxg_NQAvnnxG_6sbNGmXv7tsP6TgHTIE3OEInJtV-M6n7BCjfXIpfhPWmrlaRiNxZMpKr5KXNLZFtYsfT2kL1_e1X_h8yIo7u8kEMSD-Fp2ndpEEEJM5tL7BEyweYJ_mp7C8dVFpiW7BZhQ5MiYMw5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KAwxV7Ld46cnWGomEgOd1eNuG4INN9mXf_vE2WxpySPuhqzx5IMxsc6JOxXIUjZwqouPCdYqSDJ6rERWDc5QpnA4cGsG52UqHY5oU_TJfPnbM7grdsS2L0E_wBmdjW7qwgIDxg7-a-eyYFaQsi7Ub1g5gVD6Nx3K28_8yMD5CLQDOwtM3HrUTr7mHQcC-jxZswbUPV6KsrLFUvC-rIpCRRFFNF1Mz9VA7tkbM5u9HOX5wulJ5JYGN684pwIoaADxxQ1OvzWFivPoz_a04wiKa1V3n-wQcptWxMsozI_xwSbvHAs5FMWskddagjRzDb-VWc5nsCRsQPIuKMwCuYL9Aq0o-RKgIOqCsEHimB4XwmVsmRQV2BaTwlTKgiy7w5Hez8irNPB6pAJ7_vSyEXSsmcw7eEJeZQrZU1AoOem97olig4hCwKW6rFyipD349JdpBgjJK9WMLEv-b_7Hxhtt1CPJjeebrNBAkNyVGDSFPzpriw4kAhRDSIO9ItIn01te3BoUg215nbbxfP1bc7JP9aqWJo_NtF0znG5zp2Zgl1O24Nwd78p_2AnjVY0MEKJlvsbQBImLaG4WMvNeDtYxymenmVQCvTiFs_Nd11Z_fTNRjcFNSF5hulFPqx_rMPcDsZt0Lv0ms88uSwlAEhZ7cMCCVGvZykVwZ5c016uhP31xWDG2vxUo_6qNloGzlVyM0F4BbZ1hPmh7Otke92IltuGwBaLz43IaYceaiNQC_CzLZewr1VQmCifuiXCj2fBBf6pfe9sAxwWPWPUxVXkAd2JxtTSXV9CW-8sFymBbpXb9TUOCHlKjIhCrug3eEPNHbuySvsxEVvl9j3KjM2fqUl9HJE9isa0flTjWwgcn_jqh8StrcEh9i715VYRnQepffrC_iyXaIT-RKKFaCAtIjLkbnIWWqoHvMSUNexrYvzFHatAHDC-b-PiQKsnSUNXum2TtIOYyA2am-GsrDL1bMCbBWZZQbJvB6NvTFSFxcC_lIOvkQbr3lcomAM0XynwD4t-ncHEutnFow==
8 changes: 8 additions & 0 deletions jet_tracking/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions


from . import jet_control # noqa

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__all__ instead of noqa? Or just ignore this specific flake8 violation in setup.cfg?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__all__ would be for from .jet_control import * - which we probably don't want.

noqa, once flake8 checks are re-enabled, will make it exempt from flake8 checking. Without it, flake8 would complain that jet_control is imported but unused.

from . import devices # noqa
from . import cam_utils # noqa
from . import jet_tracking # noqa
from . import move_motor # noqa
from . import signal_config # noqa
85 changes: 45 additions & 40 deletions jet_tracking/devices.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pandas as pd
import epics

from ophyd.device import Device, FormattedComponent as FCpt, Component as Cpt
from ophyd.signal import EpicsSignal
Expand All @@ -19,7 +20,7 @@ def __init__(self, *args, **kwargs):
def _update_descriptions(self):
adesc = {}
for name, signal in self._signals.items():
adesc[name] = EpicsSignal(signal._read_pv.pvname + '.DESC').get()
adesc[name] = epics.caget(signal.pvname + '.DESC')
self._descriptions = adesc

@property
Expand All @@ -33,8 +34,8 @@ def table(self):
atable = {}
for name, signal in sorted(self._signals.items()):
atable[name] = {
'value': signal._read_pv.value,
'units': signal._read_pv.units,
'value': signal.read()[signal.name]['value'],
'units': signal.describe()[signal.name].get('units', ''),
'desc': self._descriptions.get(name),
}

Expand Down Expand Up @@ -318,7 +319,7 @@ class HPLC(Device, _TableMixin):

pressure = FCpt(EpicsSignal, '{self._pressure}')
pressure_units = FCpt(EpicsSignal, '{self._pressure_units}')
set_max_pressure = FCpt(EpicsSignal, '{self._set_max_pressure')
set_max_pressure = FCpt(EpicsSignal, '{self._set_max_pressure}')
max_pressure = FCpt(EpicsSignal, '{self._max_pressure}')

clear_error = FCpt(EpicsSignal, '{self._clear_error}')
Expand Down Expand Up @@ -596,41 +597,45 @@ def __init__(self, name,


class SDS:
'''Sample delivery system

Parameters
----------
devices : dict
A dictionary of dictionaries containing the devices to be made and their PV names
Key: str
Type of device to be made. Valid keys are 'selector', 'cooler_shaker', 'hplc',
'pressure_controller', and 'flow_integrator'
Value: str dict
Dictionary of PVs of the device
'''
Sample delivery system

Attributes
----------
SDS_devices : list
List containing all the devices that are in the sample delivery system
'''
Parameters
----------
devices : dict
A dictionary of dictionaries containing the devices to be made and
their PV names. The dictionary key is a string, one of the following:
{'selector', 'cooler_shaker', 'hplc', 'pressure_controller',
'flow_integrator'}
The values of the dictionary, are also dictionaries. These are passed
to the new device, allowing parameters such as PV names to be
specified.

SDS_devices = []
Attributes
----------
SDS_devices : list
List containing all the devices that are in the sample delivery system
'''

device_types = {
'selector': Selector,
'cooler_shaker': CoolerShaker,
'hplc': HPLC,
'pressure_controller': PressureController,
'flow_integrator': FlowIntegrator,
}

def __init__(self, devices):
self.SDS_devices = [
self.device_types[dev](**kwargs)
for dev, kwargs in devices.items()
if dev in self.device_types
]

for device in devices:
if device == 'selector':
self.SDS_devices.append(Selector(**devices[device]))
elif device == 'cooler_shaker':
self.SDS_devices.append(CoolerShaker(**devices[device]))
elif device == 'hplc':
self.SDS_devices.append(HPLC(**devices[device]))
elif device == 'pressure_controller':
self.SDS_devices.append(PressureController(**devices[device]))
elif device == 'flow_integrator':
self.SDS_devices.append(FlowIntegrator(**devices[device]))
else:
print(f'{device} is not a valid device')
invalid_devices = [dev for dev in devices
if dev not in self.device_types]
for device in invalid_devices:
print(f'WARNING: {device} is not a valid device type')


class Offaxis(PCDSDetector):
Comment thread
teddyrendahl marked this conversation as resolved.
Expand All @@ -653,9 +658,9 @@ class Offaxis(PCDSDetector):
Stats on ROI of original rate image
'''

ROI = FCpt(ROIPlugin, '{self.prefix}:{self._ROI_port}')
ROI_stats = FCpt(StatsPlugin, '{self.prefix}:{self._ROI_stats_port}')
ROI_image = FCpt(ImagePlugin, '{self.prefix}:{self._ROI_image_port}')
ROI = FCpt(ROIPlugin, '{self.prefix}:{self._ROI_port}:')
ROI_stats = FCpt(StatsPlugin, '{self.prefix}:{self._ROI_stats_port}:')
ROI_image = FCpt(ImagePlugin, '{self.prefix}:{self._ROI_image_port}:')

def __init__(self, ROI_port,
ROI_stats_port,
Expand Down Expand Up @@ -695,9 +700,9 @@ class Questar(PCDSDetector):
Stats on ROI of original rate image
'''

ROI = FCpt(ROIPlugin, '{self.prefix}:{self._ROI_port}')
ROI_stats = FCpt(StatsPlugin, '{self.prefix}:{self._ROI_stats_port}')
ROI_image = FCpt(ImagePlugin, '{self.prefix}:{self._ROI_image_port}')
ROI = FCpt(ROIPlugin, '{self.prefix}:{self._ROI_port}:')
ROI_stats = FCpt(StatsPlugin, '{self.prefix}:{self._ROI_stats_port}:')
ROI_image = FCpt(ImagePlugin, '{self.prefix}:{self._ROI_image_port}:')

def __init__(self, ROI_port,
ROI_stats_port,
Expand Down
Loading