Common to All Modules

Devices, experiments and analyzers are different kinds of module (see The three things you build), but they share the same ground: how they are configured, how they log what they do, and the data types they exchange. This chapter covers that shared ground once, so the chapters on each kind of module do not repeat it.

Where each kind of setting goes

A module is configured in three places. Choose the place by asking who the setting belongs to:

The setting belongs to …

Example

Goes in

Explained in

this computer or this lab, or is secret

an instrument’s address, a server’s port, a password

.env

The .env File

the module itself

motor counts per degree, a hardware speed limit, which devices an experiment uses

config.yaml inside the package

The module configuration: config.yaml

one measurement

the wavelengths to scan, the exposure time

config/*.yaml (experiments only)

The run configuration: config/*.yaml

Getting this right is what lets the same module run in another lab unchanged: only .env differs.

In this chapter

Page

Covers

The .env File

settings that differ per computer, and the variables plesty-lib reads by itself

YAML Configuration

the module’s own config.yaml, and an experiment’s run settings

Logging System

where a module’s log messages go, and how to control them

Data & Metadata Schemas

the data types devices produce, experiments record and analyzers read