plesty.pow_pl.__main__

Entry point for running the power-PL experiment as a standalone process.

Device addresses and the shared disk are deployment facts and come from the environment: HWP_ADDRESS, SPEC_ADDRESS, PM_ADDRESS — which the bench serving each device gives the run, see setup.yaml — and PLESTY_DATA. Measurement tuning lives in config/default.yaml. Typical use:

python -m plesty.pow_pl                             # run with config/default.yaml
python -m plesty.pow_pl --config config/local/x.yaml
python -m plesty.pow_pl --dry-run                   # print the plan, connect nothing
python -m plesty.pow_pl --resume <run_id>           # continue an interrupted run

ExperimentCLI owns everything that is the same for every experiment — --config, --resume, --run-root, --dry-run and --manifest, the preflight, the event loop, and the graceful stop. This module declares only what differs: SCHEMA, what the run reads from the environment, and how the rig and the experiment are built.

MANIFEST is the contract. python -m plesty.pow_pl --manifest prints it, and a console builds this experiment’s settings form from it. It and config/default.yaml must declare the same keys — gate e3 checks that they do.

Attributes

SCHEMA

MANIFEST

cli

_logger

Functions

build_devices(→ plesty.pow_pl.rig.PowPlRig)

Build the rig, without the powermeter when the run takes no power reference.

build_experiment(→ plesty.lib.experiment.Experiment)

Build the experiment on the rig.

Module Contents

plesty.pow_pl.__main__.SCHEMA: dict[str, list[plesty.lib.device.params.ConfigParameter]]
plesty.pow_pl.__main__.MANIFEST
plesty.pow_pl.__main__.cli
plesty.pow_pl.__main__._logger
plesty.pow_pl.__main__.build_devices(args: Any, config: dict[str, Any], skip: frozenset[str]) → plesty.pow_pl.rig.PowPlRig

Build the rig, without the powermeter when the run takes no power reference.

Each sub-device’s address is read from its own <NAME>_ADDRESS variable. Called again on every start-up retry, so an edited .env or a server started in the meantime is picked up.

Parameters:
  • args (Any) – The parsed command line.

  • config (dict[str, Any]) – The measurement configuration.

  • skip (frozenset[str]) – Optional sub-devices to build the rig without.

Return type:

plesty.pow_pl.rig.PowPlRig

plesty.pow_pl.__main__.build_experiment(args: Any, config: dict[str, Any], run_root: str | None, devices: Any) → plesty.lib.experiment.Experiment

Build the experiment on the rig.

A rig the operator let start without its powermeter measures spectra only, so the powermeter block leaves the configuration the plan freezes.

Parameters:
  • args (Any) – The parsed command line.

  • config (dict[str, Any]) – The measurement configuration, frozen into the run’s plan.

  • run_root (Optional[str]) – Where this run’s directory goes.

  • devices (Any) – The connected rig, or None for --dry-run.

Return type:

plesty.lib.experiment.Experiment