semi_cr.core.lab.station.context package¶
Submodules¶
semi_cr.core.lab.station.context.bindings module¶
semi_cr.core.lab.station.context.config module¶
semi_cr.core.lab.station.context.graph module¶
semi_cr.core.lab.station.context.models module¶
- class semi_cr.core.lab.station.context.models.RuntimeBinding(static_id: str, runtime_id: str, runtime_object: Any)[source]¶
Bases:
object
- class semi_cr.core.lab.station.context.models.ContextState(*values)[source]¶
Bases:
Enum- CREATED = 1¶
- LOADED = 2¶
- PARTIALLY_CONNECTED = 3¶
- CONNECTED = 4¶
- classmethod __contains__(value)¶
Return True if value is in cls.
value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members.
- classmethod __getitem__(name)¶
Return the member matching name.
- classmethod __iter__()¶
Return members in definition order.
- classmethod __len__()¶
Return the number of members (no aliases)
semi_cr.core.lab.station.context.runtime module¶
- class semi_cr.core.lab.station.context.runtime.StationContext(station: LabStation, static: StaticStationContext)[source]¶
Bases:
objectRuntime realization of a StaticStationContext.
Construction is intentionally side-effect free.
Lifecycle:
context = StationContext(station, static)
context.load() context.connect()
…
context.disconnect()
- station: LabStation¶
- static: StaticStationContext¶
- property bindings: RuntimeBindingRegistry¶
- resolve_runtime(static_id: str) Any[source]¶
Resolve a static object ID to its runtime realization.
Runtime resolution is available once bindings have been created, including while the context is being connected.
- property instruments: dict[str, Instrument]¶
- property graph: MultiDiGraph¶
- property state: ContextState¶
- property has_connections: bool¶
True when at least one instrument owned by this context is currently connected.
- load() None[source]¶
Load the static configuration into the QCoDeS station.
This does not connect to physical instruments.
- connect(instruments: str | Iterable[str] | None = None) None[source]¶
Connect one, several, or all configured instruments.
- Parameters:
instruments – QCoDeS instrument config name, iterable of config names, or None to connect all configured instruments.
Examples
context.connect() context.connect(“qdac_1”) context.connect([“qdac_1”, “smu”])
- disconnect(instruments: str | Iterable[str] | None = None) None[source]¶
Disconnect one, several, or all runtime instruments instantiated by this context.
QCoDeS configuration remains loaded.
- Parameters:
instruments – Config name, iterable of config names, or None to disconnect all instruments owned by this context.
Examples
context.disconnect() context.disconnect(“qdac_1”) context.disconnect([“qdac_1”, “smu”])
semi_cr.core.lab.station.context.static module¶
- class semi_cr.core.lab.station.context.static.InfrastructureContext(wiring_config: semi_cr.core.lab.station.base.ConfigBundle, electronics_config: semi_cr.core.lab.station.base.ConfigBundle)[source]¶
Bases:
object- wiring_config: ConfigBundle¶
- electronics_config: ConfigBundle¶
- config: ConfigBundle¶
- graph: MultiDiGraph¶
- class semi_cr.core.lab.station.context.static.StaticStationContext(device: ConfigContext, infrastructure: InfrastructureContext)[source]¶
Bases:
objectDescription of the complete station without talking to hardware.
- device: ConfigContext¶
- infrastructure: InfrastructureContext¶
- config: ConfigBundle¶
- instruments: dict[str, InstrumentSpec]¶
- graph: MultiDiGraph¶
Module contents¶
- class semi_cr.core.lab.station.context.ContextState(*values)[source]¶
Bases:
Enum- CREATED = 1¶
- LOADED = 2¶
- PARTIALLY_CONNECTED = 3¶
- CONNECTED = 4¶
- classmethod __contains__(value)¶
Return True if value is in cls.
value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members.
- classmethod __getitem__(name)¶
Return the member matching name.
- classmethod __iter__()¶
Return members in definition order.
- classmethod __len__()¶
Return the number of members (no aliases)
- class semi_cr.core.lab.station.context.InfrastructureContext(wiring_config: semi_cr.core.lab.station.base.ConfigBundle, electronics_config: semi_cr.core.lab.station.base.ConfigBundle)[source]¶
Bases:
object- wiring_config: ConfigBundle¶
- electronics_config: ConfigBundle¶
- config: ConfigBundle¶
- graph: MultiDiGraph¶
- class semi_cr.core.lab.station.context.RuntimeBinding(static_id: str, runtime_id: str, runtime_object: Any)[source]¶
Bases:
object
- class semi_cr.core.lab.station.context.RuntimeBindingRegistry[source]¶
Bases:
object- get_binding(static_id: str) RuntimeBinding[source]¶
- values() Iterator[RuntimeBinding][source]¶
- class semi_cr.core.lab.station.context.StaticStationContext(device: ConfigContext, infrastructure: InfrastructureContext)[source]¶
Bases:
objectDescription of the complete station without talking to hardware.
- device: ConfigContext¶
- infrastructure: InfrastructureContext¶
- config: ConfigBundle¶
- instruments: dict[str, InstrumentSpec]¶
- graph: MultiDiGraph¶
- class semi_cr.core.lab.station.context.StationContext(station: LabStation, static: StaticStationContext)[source]¶
Bases:
objectRuntime realization of a StaticStationContext.
Construction is intentionally side-effect free.
Lifecycle:
context = StationContext(station, static)
context.load() context.connect()
…
context.disconnect()
- station: LabStation¶
- static: StaticStationContext¶
- property bindings: RuntimeBindingRegistry¶
- resolve_runtime(static_id: str) Any[source]¶
Resolve a static object ID to its runtime realization.
Runtime resolution is available once bindings have been created, including while the context is being connected.
- property instruments: dict[str, Instrument]¶
- property graph: MultiDiGraph¶
- property state: ContextState¶
- property has_connections: bool¶
True when at least one instrument owned by this context is currently connected.
- load() None[source]¶
Load the static configuration into the QCoDeS station.
This does not connect to physical instruments.
- connect(instruments: str | Iterable[str] | None = None) None[source]¶
Connect one, several, or all configured instruments.
- Parameters:
instruments – QCoDeS instrument config name, iterable of config names, or None to connect all configured instruments.
Examples
context.connect() context.connect(“qdac_1”) context.connect([“qdac_1”, “smu”])
- disconnect(instruments: str | Iterable[str] | None = None) None[source]¶
Disconnect one, several, or all runtime instruments instantiated by this context.
QCoDeS configuration remains loaded.
- Parameters:
instruments – Config name, iterable of config names, or None to disconnect all instruments owned by this context.
Examples
context.disconnect() context.disconnect(“qdac_1”) context.disconnect([“qdac_1”, “smu”])