libera_utils.footprint_matching.sources.require_mode_reader_keys#

libera_utils.footprint_matching.sources.require_mode_reader_keys(mode: OperationalMode, keys: Iterable[str], argument: str) → None#

Check that keys are exactly the readers active in mode.

A source left out would leave its product columns at fill and score coverage over fewer sources than the product declares; a source the mode does not use would aggregate variables the product does not carry.

Parameters:
  • mode (OperationalMode) – Operational mode whose active readers the keys must match.

  • keys (collections.abc.Iterable[str]) – Reader registry keys a caller supplied.

  • argument (str) – Name of the caller’s argument that holds the keys, for the error message.

Raises:

KeyError – If keys holds a key for a source mode does not use, or is missing a reader active in mode.