Skip to content

Commit

Permalink
docs: Document cluster public interface
Browse files Browse the repository at this point in the history
Minimally, as it is mostly just complying with the standard controller's interface
  • Loading branch information
alecandido committed Feb 7, 2025
1 parent 78983fc commit 3c336d9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/qibolab/_core/instruments/qblox/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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():
Expand All @@ -107,6 +115,7 @@ def play(
options: ExecutionParameters,
sweepers: list[ParallelSweepers],
) -> dict[int, Result]:
"""Execute the given experiment."""
results_ = {}
log = Logger(configs)

Expand Down

0 comments on commit 3c336d9

Please sign in to comment.