qat.instrument.base module

class CompositeInstrument

Bases: Generic[LInstr], InstrumentConcept

add(component)
property components: dict[str, LInstr]
connect()
disconnect()
property is_connected: bool
playback(*args, **kwargs)
setup(*args, **kwargs)
class ConfigInstrumentBuilder(configs, cinstr_type=None, linstr_type=None)

Bases: InstrumentBuilder

Builds an InstrumentConcept object representing an arbitrary fleet of leaf instruments defined as a list of config dicts.

Parameters:
  • cinstr_type (Optional[type]) – type of Composite Instrument to build

  • linstr_type (Optional[type]) – type of Leaf Instrument to build

build()
Return type:

TypeVar(CInstr, bound= CompositeInstrument)

class CsvInstrumentBuilder(file_path, cinstr_type=None, linstr_type=None)

Bases: InstrumentBuilder

build()

A generic function that builds an InstrumentConcept object representing an arbitrary fleet of leaf instruments defined as CSV.

Parameters:
  • cinstr_type – type of Composite Instrument to build

  • linstr_type – type of Leaf Instrument to build

Return type:

TypeVar(CInstr, bound= CompositeInstrument)

class InstrumentBuilder

Bases: ABC

abstract build(*args, **kwargs)
Return type:

TypeVar(CInstr, bound= CompositeInstrument)

class InstrumentConcept

Bases: ConnectionMixin

The component interface, it defines what an instrument is and what APIs through which customer code can interact with.

connect()
disconnect()
playback(*args, **kwargs)
setup(*args, **kwargs)
class InstrumentModel(**data)

Bases: BaseModel

Used to parse JSON/CSV entries. An instrument has an id, name, and IP address

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

address: IPvAnyAddress
id: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
class LeafInstrument(id, name, address)

Bases: InstrumentConcept

property is_connected: bool