Command Line Interface

happi

commands available: search, add, edit, load, update, container-registry, transfer

happi [OPTIONS] COMMAND [ARGS]...

Options

--path <path>

Provide the path to happi configuration file.

-v, --verbose

Show the debug logging stream.

-V, --version

Show the version and exit.

add

Add new entries interactively.

happi add [OPTIONS]

Options

--clone <clone>

Copy the fields from an existing container. Provide the name of the item to clone.

benchmark

Compare happi device startup times.

This will generate a table that shows you how long each device took to instantiate.

Repeats for at least the (-d, –duration) arg (default = 0 seconds) and for at least the number of the (-i, –iterations) arg (default = 1 iteration), showing stats and averages.

By default we time only the duration of __init__, but you can also (wait_connected) to see the full time until the device is fully ready to go, presuming the device has a wait_for_connection method.

Search terms are standard as in the same search terms as the search cli function. A blank search term means to load all the devices.

happi benchmark [OPTIONS] [SEARCH_CRITERIA]...

Options

-d, --duration <duration>

Specify how long in seconds to spend per device.

-i, --iterations <iterations>

Specify the number of times to instantiate each device.

-w, --wait-connected

Wait for the devices to be connected.

-t, --tracebacks

Show tracebacks from failing device loads.

-s, --sort-key <sort_key>

Sort the output table. Valid options are name, avg_time, iterations, tot_time, max_time, import_time

--glob, --regex

Use glob style (default) or regex style search terms. Regex requires backslashes to be escaped (eg. at\d.\d)

Arguments

SEARCH_CRITERIA

Optional argument(s)

container-registry

Print container registry

happi container-registry [OPTIONS]

edit

Change an existing entry by applying EDITS of the form: field=value to the item of name NAME.

happi edit [OPTIONS] NAME [EDITS]...

Arguments

NAME

Required argument

EDITS

Optional argument(s)

load

Open IPython terminal with ITEM_NAMES loaded

happi load [OPTIONS] [ITEM_NAMES]...

Arguments

ITEM_NAMES

Optional argument(s)

profile

Per-function startup speed diagnostic.

This will go through the happi loading process and show information about the execution time of all the functions called during the process.

Contains options for picking which devices to check and which part of the loading process to profile. You can choose to profile the happi database loading (-d, –database), the class imports (-i, –import), the object instantiation (-o, –object), or all of the above (-a, –all).

By default this will use whichever profiler you have installed, but this can also be overriden with the (-p, –profiler) option. The priority order is, first, the pcdsutils line_profiler wrapper (–profiler pcdsutils), and second, the built-in cProfile module (–profiler cprofile). More options may be added later.

Search terms are standard as in the same search terms as the search cli function. A blank search term means to load all the devices.

happi profile [OPTIONS] [SEARCH_CRITERIA]...

Options

-d, --database

Profile the database loading.

-i, --import

Profile the module importing.

-o, --object

Profile the object instantiation.

-a, --all

Shortcut for enabling all profile stages.

-p, --profiler <profiler>

Select which profiler to use.

--glob, --regex

Use glob style (default) or regex style search terms. Regex requires backslashes to be escaped (eg. at\d.\d)

Arguments

SEARCH_CRITERIA

Optional argument(s)

transfer

Change the container of an item (NAME) to a new container (TARGET)

happi transfer [OPTIONS] NAME TARGET

Arguments

NAME

Required argument

TARGET

Required argument

update

Update happi db with JSON_DATA payload

happi update [OPTIONS] [JSON_DATA]...

Arguments

JSON_DATA

Optional argument(s)