From 3c336d90808ae1cfdabefc9f1a257bc5165a826e Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 7 Feb 2025 14:22:53 +0100 Subject: [PATCH] docs: Document cluster public interface Minimally, as it is mostly just complying with the standard controller's interface --- src/qibolab/_core/instruments/qblox/cluster.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/qibolab/_core/instruments/qblox/cluster.py b/src/qibolab/_core/instruments/qblox/cluster.py index c8d889332..262d76631 100644 --- a/src/qibolab/_core/instruments/qblox/cluster.py +++ b/src/qibolab/_core/instruments/qblox/cluster.py @@ -43,6 +43,10 @@ class Cluster(Controller): @property def cluster(self) -> qblox.Cluster: + """Ensure cluster object access. + + The object presence results from an existing connection. + """ assert self._cluster is not None return self._cluster @@ -77,9 +81,16 @@ def _channels_by_module(self) -> dict[SlotId, list[tuple[ChannelId, PortAddress] @property def sampling_rate(self) -> int: + """Provide instrument's sampling rate.""" return SAMPLING_RATE + @property + def is_connected(self) -> bool: + """Determine connections status.""" + return self._cluster is not None + def connect(self): + """Connect and initialize the instrument.""" if self.is_connected: return @@ -88,11 +99,8 @@ def connect(self): ) self._cluster.reset() - @property - def is_connected(self) -> bool: - return self._cluster is not None - def disconnect(self): + """Disconnect and reset the instrument.""" assert self._cluster is not None for module in self._modules.values(): @@ -107,6 +115,7 @@ def play( options: ExecutionParameters, sweepers: list[ParallelSweepers], ) -> dict[int, Result]: + """Execute the given experiment.""" results_ = {} log = Logger(configs)