API: The Source Code#

The APSBITS package provides tools and utilities to build Bluesky instruments. The package structure is:

 1docs/source         sphinx documentation source
 2pyproject.toml      project configuration
 3src/               Python source code tree
 4    apsbits/       root of the 'apsbits' package
 5        api/       command-line interfaces for instrument management
 6        core/      core components for Bluesky data acquisition
 7        utils/     utilities for setup and configuration
 8        demo_instrument/  example instrument implementation
 9            startup.py   setup a demo session for Bluesky data acquisition
10            callbacks/  receive and handle info from other code
11            configs/   configuration files
12            devices/   demo instrument's controls
13            plans/    demo instrument's measurement procedures
14            suspenders/  suspender implementations
15            utils/      utility functions and classes
16        demo_qserver/   example queueserver implementation

A Bluesky data acquisition session using the demo instrument begins with:

from apsbits.demo_instrument.startup import *

The apsbits/ package is described in the following sections.

API Documentation#

This section contains detailed API documentation for the APSBITS package.

Core Components#

The core components provide the fundamental building blocks for Bluesky data acquisition:

apsbits.core.best_effort_init

BestEffortCallback: simple real-time visualizations, provides bec.

apsbits.core.catalog_init

Databroker catalog

apsbits.core.run_engine_init

Setup and initialize the Bluesky RunEngine.

Utilities#

The utilities module provides helper functions and tools:

apsbits.utils.aps_functions

APS utility helper functions

apsbits.utils.config_loaders

Configuration management for the instrument.

apsbits.utils.controls_setup

EPICS & ophyd related setup

apsbits.utils.helper_functions

Generic utility helper functions

apsbits.utils.logging_setup

Configure logging for this session.

apsbits.utils.metadata

RunEngine Metadata

apsbits.utils.stored_dict

Storage-backed Dictionary

Demo Components#

Example implementations and templates:

Command-Line Interfaces#

The API module provides command-line interfaces for instrument management:

apsbits.api.create_new_instrument

Create a new instrument from a fixed template.

apsbits.api.delete_instrument

Delete an instrument and its associated qserver configuration.

apsbits.api.run_instrument

Run an instrument's startup module and return the ophyd registry information.