Overview¶
The pcdshub python 3 software stack is being developed with the following design goals:
Modules should have a well-defined, restrained scope.
Code should be readable, reusable, and sharable.
Each piece of data should have a canonical source for all applications.
Deployment and testing should be automated.
The open source community should be maximally leveraged.
These design goals result in a matrix of Github repositories and python modules that are individually understandable, but together obscure the bigger picture. The goal of this page is to explain at a high level how each application works and what each repository does.
About this Page¶
This page will explore the applications and modules from pcdshub, as well as some external modules, some of which are developed at SLAC and some which are not.
For each project, this page will explain:
The motivation behind the project: what problem is being solved?
How the project works at a high level
What other projects does this one rely on?
What other projects rely on this one?
Definitions¶
An application is any python code that runs stand-alone to accomplish a task. These may rely on modules to accomplish their goals. A module is code with an importable API and a means to install itself in a python environment. Many repositories are both applications and modules, providing both a stand-alone script and an API for other applications to leverage.
Applications¶
This section will list our applications and explain the motivations behind them, as well as their dependencies. This includes only repositories that are hosted on pcdshub and have a corresponding online documentation page.
Hutch-specific Repositories¶
Repository |
|
How we use it |
We put softlinks like |
Motivation |
We need dedicated landing areas for hutch-specific and experiment-specific code to satisfy the needs of a constantly shifting environment. This can’t go into a module because the module can’t control which python environment you launch it from. |
How it works |
A version file e.g. |
Dependencies |
These may vary between hutches, but all hutches rely on
hutch-python as the launcher and configuration
reader. All of these repositories were created from the
|
hutch-python¶
Repository |
|
How we use it |
Scripts like |
Motivation |
The load process for each hutch is essentially identical. This
should be handled in shared code with simple hooks for
hutch-specific and experiment-specific additions.
This was chosen instead of supporting |
How it works |
A shared startup script is seeded with the contents of the
|
Dependencies |
This is used by the Hutch-specific Repositories to Relies on most of our modules:
|
lightpath¶
Repository |
|
How we use it |
An environment with |
Motivation |
Help the user find which objects are in the beam, and which are not. This can be used to clear the beamline and to check if you expect beam to be incident on your imager. Unlike older software with the same purpose, this is extremely configurable and simple to keep up-to-date using happi. |
How it works |
This uses the z-position and beamline metadata from happi to sort devices by position along the beamline. It relies on the in/out interface from pcdsdevices to determine whether each device is in the beam. |
Dependencies |
|
pmgr¶
Repository |
|
How we use it |
This is the Parameter Manager, |
Motivation |
We need a place to keep track of and restore parameters to ease the deployment and redeployment of motors for changing experimental needs. |
How it works |
|
Dependencies |
|
pcds-envs¶
Repository |
|
How we use it |
This is used to track our shared environment changes, and to anticipate and catch integration problems with bringing all of our packages together. |
Motivation |
We need to do this in a structured, semi-automated way to minimize upkeep and catch mistakes. |
How it works |
|
Dependencies |
This only depends on |
pcds-recipes¶
Repository |
|
How we use it |
This is used to build non-pcdshub Conda packages and make sure they get into the pcds-tag channel. |
Motivation |
It is unsustainable and unstable to rely on special channels for
our conda environments. By limiting to the |
How it works |
Recipes are placed into the repository and |
Dependencies |
This only depends on |
Modules¶
This section will list our modules and explain the motivations behind them, as well as their dependencies. This includes only repositories that are hosted on pcdshub with a corresponding online documentation page.
typhos¶
Repository |
|
How we use it |
To automatically generate screens from ophyd devices. |
Motivation |
We need new pydm screens and these are great starting points. The ophyd device structure is very useful for organizing device properties into logical groups. |
How it works |
Groups device components by kind (e.g. hinted, normal, configuration) and sort into tabs, etc. accordingly. Provides tools on every generated screen. |
Dependencies |
pcdsdevices¶
Repository |
|
How we use it |
To define ophyd device classes that correspond to LCLS PCDS EPICS IOCs. This is also where we put additional logic and CLI niceties for interactive sessions with these devices. |
Motivation |
There must be a common place where these classes are defined
so that all of our |
How it works |
Follows the ophyd rules to record which PVs are associated with each device class. |
Dependencies |
|
transfocate¶
Repository |
|
How we use it |
To define an ophyd device class for the MFX transfocator. |
Motivation |
This is more complicated than a standard device and was being developed parallel to the pcdsdevices repository. |
How it works |
Defines the transfocator’s PVs and some helper methods for putting lens combinations in and out. |
Dependencies |
hxrsnd¶
Repository |
|
How we use it |
To define ophyd device classes and bluesky scanning routines for the XCS split and delay. |
Motivation |
This is more complicated than a standard device and was being developed parallel to the pcdsdevices repository. |
How it works |
Defines the SND’s PVs and some helper methods for running calibration scans and collecting data. |
Dependencies |
pcdsdevices, |
nabs¶
Repository |
|
How we use it |
To define lcls-specific bluesky utilities and to build out the bluesky automation framework. |
Motivation |
We want a cleaner version of the legacy |
How it works |
Defines an API for various plans, preprocessors, etc. |
Dependencies |
pcdsdaq¶
Repository |
|
How we use it |
To define a bluesky-compatible control layer for the LCLS1 data acquisition system (DAQ). |
Motivation |
We need to be able to control the DAQ. Doing it in a bluesky-compatible way means we can include the DAQ in any bluesky plan. |
How it works |
Wraps the |
Dependencies |
happi¶
Repository |
|
How we use it |
To store all of our device metadata in device_config and reload these devices to create identical objects in every application. |
Motivation |
There must be a canonical way to load devices, consistent across all of our python applications. |
How it works |
Defines container objects that represent real objects. These can
be stored in |
Dependencies |
No pcdshub dependencies |
External Modules¶
This section will list some of the more site-specific external modules we use and explain the motivations behind the modules and why we use them.
bluesky¶
Repository |
|
How we use it |
As the scanning, process flow, and automation platform. |
Motivation |
If we do scanning in a structured way, we can write cleaner code
that can continue to be maintained, and we can take advantage
of anything that the |
How it works |
A central |
Dependencies |
No pcdshub dependencies |
ophyd¶
Repository |
|
How we use it |
As the device control abstraction layer. |
Motivation |
We need to have a sane convention for defining devices, and a consistent way to define motion interfaces, callbacks, etc. |
How it works |
|
Dependencies |
No pcdshub dependencies |
pydm¶
Repository |
|
How we use it |
To create/display |
Motivation |
We need to be able to include |
How it works |
This leverages qt |
Dependencies |
No pcdshub dependencies |