boulder-opal-scale-up-sdk 1.0.5__py3-none-any.whl → 1.0.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {boulder_opal_scale_up_sdk-1.0.5.dist-info → boulder_opal_scale_up_sdk-1.0.6.dist-info}/METADATA +1 -1
- {boulder_opal_scale_up_sdk-1.0.5.dist-info → boulder_opal_scale_up_sdk-1.0.6.dist-info}/RECORD +27 -21
- boulderopalscaleupsdk/agent/worker.py +15 -2
- boulderopalscaleupsdk/common/dtypes.py +21 -1
- boulderopalscaleupsdk/{stubs/__init__.py → constants.py} +3 -0
- boulderopalscaleupsdk/device/controller/quantum_machines.py +86 -17
- boulderopalscaleupsdk/device/processor/common.py +3 -3
- boulderopalscaleupsdk/errors.py +21 -0
- boulderopalscaleupsdk/experiments/__init__.py +8 -2
- boulderopalscaleupsdk/experiments/cz_spectroscopy_by_bias.py +84 -0
- boulderopalscaleupsdk/experiments/ramsey_ef.py +62 -0
- boulderopalscaleupsdk/experiments/{readout_classifier_calibration.py → readout_classifier.py} +7 -3
- boulderopalscaleupsdk/experiments/readout_optimization.py +57 -0
- boulderopalscaleupsdk/experiments/resonator_spectroscopy_by_bias.py +1 -3
- boulderopalscaleupsdk/experiments/transmon_anharmonicity.py +0 -2
- boulderopalscaleupsdk/grpc_interceptors/error.py +318 -0
- boulderopalscaleupsdk/plotting/dtypes.py +5 -5
- boulderopalscaleupsdk/protobuf/v1/device_pb2.py +57 -49
- boulderopalscaleupsdk/protobuf/v1/device_pb2.pyi +67 -43
- boulderopalscaleupsdk/protobuf/v1/device_pb2_grpc.py +100 -66
- boulderopalscaleupsdk/protobuf/v1/job_pb2.py +47 -0
- boulderopalscaleupsdk/protobuf/v1/job_pb2.pyi +54 -0
- boulderopalscaleupsdk/protobuf/v1/job_pb2_grpc.py +138 -0
- boulderopalscaleupsdk/third_party/quantum_machines/__init__.py +1 -1
- boulderopalscaleupsdk/third_party/quantum_machines/config.py +51 -48
- boulderopalscaleupsdk/stubs/dtypes.py +0 -47
- boulderopalscaleupsdk/stubs/maps.py +0 -18
- {boulder_opal_scale_up_sdk-1.0.5.dist-info → boulder_opal_scale_up_sdk-1.0.6.dist-info}/LICENSE +0 -0
- {boulder_opal_scale_up_sdk-1.0.5.dist-info → boulder_opal_scale_up_sdk-1.0.6.dist-info}/WHEEL +0 -0
@@ -0,0 +1,57 @@
|
|
1
|
+
# Copyright 2025 Q-CTRL. All rights reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Q-CTRL Terms of service (the "License"). Unauthorized
|
4
|
+
# copying or use of this file, via any medium, is strictly prohibited.
|
5
|
+
# Proprietary and confidential. You may not use this file except in compliance
|
6
|
+
# with the License. You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# https://q-ctrl.com/terms
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS. See the
|
12
|
+
# License for the specific language.
|
13
|
+
|
14
|
+
from typing import Literal
|
15
|
+
|
16
|
+
from pydantic import PrivateAttr
|
17
|
+
|
18
|
+
from .common import (
|
19
|
+
CWSIterable,
|
20
|
+
Experiment,
|
21
|
+
HypIterable,
|
22
|
+
LinspaceIterable,
|
23
|
+
RangeIterable,
|
24
|
+
)
|
25
|
+
|
26
|
+
|
27
|
+
class ReadoutOptimization(Experiment):
|
28
|
+
"""
|
29
|
+
Parameters for optimizing the readout classifier.
|
30
|
+
|
31
|
+
Parameters
|
32
|
+
----------
|
33
|
+
transmon : str
|
34
|
+
The reference for the transmon to target.
|
35
|
+
frequencies : list[int] or LinspaceIterable or RangeIterable or CWSIterable or HypIterable
|
36
|
+
The readout frequencies to sweep, in Hz.
|
37
|
+
amplitudes : list[float]
|
38
|
+
The readout amplitudes to sweep.
|
39
|
+
recycle_delay_ns : int
|
40
|
+
The delay between consecutive shots, in nanoseconds. Defaults to 200,000 ns.
|
41
|
+
shot_count : int, optional
|
42
|
+
The number of shots to take. Defaults to 5,000.
|
43
|
+
run_mixer_calibration: bool
|
44
|
+
Whether to run mixer calibrations before running a program. Defaults to False.
|
45
|
+
update : "auto" or "off", optional
|
46
|
+
How the device should be updated after an experiment run. Defaults to auto.
|
47
|
+
"""
|
48
|
+
|
49
|
+
_experiment_name: str = PrivateAttr("readout_optimization")
|
50
|
+
|
51
|
+
transmon: str
|
52
|
+
frequencies: list[int] | LinspaceIterable | RangeIterable | CWSIterable | HypIterable
|
53
|
+
amplitudes: list[float]
|
54
|
+
recycle_delay_ns: int = 200_000
|
55
|
+
shot_count: int = 5000
|
56
|
+
run_mixer_calibration: bool = False
|
57
|
+
update: Literal["auto", "off"] = "auto"
|
@@ -24,8 +24,6 @@ from .common import (
|
|
24
24
|
)
|
25
25
|
from .waveforms import ConstantWaveform
|
26
26
|
|
27
|
-
DEFAULT_BIASES = LinspaceIterable(start=-0.49, stop=0.49, count=21)
|
28
|
-
|
29
27
|
|
30
28
|
class ResonatorSpectroscopyByBias(Experiment):
|
31
29
|
"""
|
@@ -67,7 +65,7 @@ class ResonatorSpectroscopyByBias(Experiment):
|
|
67
65
|
None
|
68
66
|
)
|
69
67
|
biases: list[float] | LinspaceIterable | RangeIterable | CWSIterable | HypIterable = (
|
70
|
-
|
68
|
+
LinspaceIterable(start=-0.49, stop=0.49, count=21)
|
71
69
|
)
|
72
70
|
recycle_delay_ns: int = 1_000
|
73
71
|
shot_count: int = 100
|
@@ -0,0 +1,318 @@
|
|
1
|
+
# Copyright 2025 Q-CTRL. All rights reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Q-CTRL Terms of service (the "License"). Unauthorized
|
4
|
+
# copying or use of this file, via any medium, is strictly prohibited.
|
5
|
+
# Proprietary and confidential. You may not use this file except in compliance
|
6
|
+
# with the License. You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# https://q-ctrl.com/terms
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS. See the
|
12
|
+
# License for the specific language.
|
13
|
+
|
14
|
+
from __future__ import annotations
|
15
|
+
|
16
|
+
import inspect
|
17
|
+
import re
|
18
|
+
from typing import TYPE_CHECKING, Any
|
19
|
+
|
20
|
+
import grpc
|
21
|
+
import grpc.aio
|
22
|
+
|
23
|
+
from boulderopalscaleupsdk.errors import ScaleUpServerError
|
24
|
+
|
25
|
+
if TYPE_CHECKING:
|
26
|
+
from collections.abc import AsyncIterable, AsyncIterator
|
27
|
+
|
28
|
+
# ------------------------
|
29
|
+
# Helpers
|
30
|
+
# ------------------------
|
31
|
+
|
32
|
+
_GRPC_MESSAGE_RE = re.compile(r'grpc_message:"([^"]+)"')
|
33
|
+
|
34
|
+
|
35
|
+
def _extract_peer_message(err: grpc.RpcError) -> str | None:
|
36
|
+
dbg = getattr(err, "debug_error_string", None)
|
37
|
+
if callable(dbg):
|
38
|
+
try:
|
39
|
+
s = dbg()
|
40
|
+
except (AttributeError, TypeError, RuntimeError):
|
41
|
+
return None
|
42
|
+
if isinstance(s, str):
|
43
|
+
m = _GRPC_MESSAGE_RE.search(s)
|
44
|
+
if m:
|
45
|
+
return m.group(1)
|
46
|
+
return None
|
47
|
+
|
48
|
+
|
49
|
+
def _concise_error(err: grpc.RpcError, *, include_code: bool = False) -> str:
|
50
|
+
msg = _extract_peer_message(err) or (err.details() or "An unknown error occurred.")
|
51
|
+
if include_code:
|
52
|
+
try:
|
53
|
+
return f"{err.code().name}: {msg}"
|
54
|
+
except (AttributeError, ValueError):
|
55
|
+
pass
|
56
|
+
return msg
|
57
|
+
|
58
|
+
|
59
|
+
# ------------------------
|
60
|
+
# SYNC wrappers
|
61
|
+
# ------------------------
|
62
|
+
|
63
|
+
|
64
|
+
class _UnaryUnaryCallWrapper:
|
65
|
+
"""Proxy that prettifies errors when .result() is called (sync)."""
|
66
|
+
|
67
|
+
def __init__(self, inner: Any, include_code: bool) -> None:
|
68
|
+
self._inner = inner
|
69
|
+
self._include_code = include_code
|
70
|
+
|
71
|
+
def result(self, timeout: float | None = None) -> Any:
|
72
|
+
try:
|
73
|
+
return self._inner.result(timeout)
|
74
|
+
except grpc.RpcError as e:
|
75
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
76
|
+
|
77
|
+
def __getattr__(self, name: str) -> Any:
|
78
|
+
return getattr(self._inner, name)
|
79
|
+
|
80
|
+
def __bool__(self) -> bool:
|
81
|
+
return bool(self._inner)
|
82
|
+
|
83
|
+
|
84
|
+
class _SyncRespIterWrapper:
|
85
|
+
"""Wrap response-stream iterator to prettify RpcError during iteration (sync)."""
|
86
|
+
|
87
|
+
def __init__(self, inner: Any, include_code: bool) -> None:
|
88
|
+
self._inner = inner
|
89
|
+
self._include_code = include_code
|
90
|
+
|
91
|
+
def __iter__(self):
|
92
|
+
try:
|
93
|
+
yield from self._inner
|
94
|
+
except grpc.RpcError as e:
|
95
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
96
|
+
|
97
|
+
def __getattr__(self, name: str) -> Any:
|
98
|
+
return getattr(self._inner, name)
|
99
|
+
|
100
|
+
|
101
|
+
class _SyncReqIterWrapper:
|
102
|
+
"""Wrap request-stream iterator to prettify RpcError while producing items (sync)."""
|
103
|
+
|
104
|
+
def __init__(self, inner: Any, include_code: bool) -> None:
|
105
|
+
self._inner = inner
|
106
|
+
self._include_code = include_code
|
107
|
+
|
108
|
+
def __iter__(self):
|
109
|
+
try:
|
110
|
+
yield from self._inner
|
111
|
+
except grpc.RpcError as e:
|
112
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
113
|
+
|
114
|
+
def __getattr__(self, name: str) -> Any:
|
115
|
+
return getattr(self._inner, name)
|
116
|
+
|
117
|
+
|
118
|
+
# ------------------------
|
119
|
+
# ASYNC wrappers
|
120
|
+
# ------------------------
|
121
|
+
|
122
|
+
|
123
|
+
class _AioRespAsyncIterWrapper:
|
124
|
+
"""
|
125
|
+
Async iterator proxy that prettifies errors from response streams (async).
|
126
|
+
Accepts the Call object (UnaryStreamCall or StreamStreamCall).
|
127
|
+
"""
|
128
|
+
|
129
|
+
def __init__(self, inner: Any, include_code: bool) -> None:
|
130
|
+
self._inner = inner
|
131
|
+
self._include_code = include_code
|
132
|
+
|
133
|
+
def __aiter__(self) -> AsyncIterator[Any]:
|
134
|
+
async def gen() -> AsyncIterator[Any]:
|
135
|
+
try:
|
136
|
+
async for item in self._inner:
|
137
|
+
yield item
|
138
|
+
except grpc.RpcError as e:
|
139
|
+
raise ScaleUpServerError(
|
140
|
+
_concise_error(e, include_code=self._include_code),
|
141
|
+
) from None
|
142
|
+
|
143
|
+
return gen()
|
144
|
+
|
145
|
+
async def initial_metadata(self) -> Any:
|
146
|
+
try:
|
147
|
+
return await self._inner.initial_metadata()
|
148
|
+
except grpc.RpcError as e:
|
149
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
150
|
+
|
151
|
+
async def trailing_metadata(self) -> Any:
|
152
|
+
try:
|
153
|
+
return await self._inner.trailing_metadata()
|
154
|
+
except grpc.RpcError as e:
|
155
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
156
|
+
|
157
|
+
def cancel(self) -> None:
|
158
|
+
return self._inner.cancel()
|
159
|
+
|
160
|
+
def code(self) -> Any:
|
161
|
+
return self._inner.code()
|
162
|
+
|
163
|
+
def details(self) -> str:
|
164
|
+
return self._inner.details()
|
165
|
+
|
166
|
+
def __getattr__(self, name: str) -> Any:
|
167
|
+
return getattr(self._inner, name)
|
168
|
+
|
169
|
+
|
170
|
+
class _AioReqAsyncIterWrapper:
|
171
|
+
"""
|
172
|
+
Async request iterator wrapper that prettifies errors when producing request items.
|
173
|
+
Takes any AsyncIterable (not necessarily an AsyncIterator).
|
174
|
+
"""
|
175
|
+
|
176
|
+
def __init__(self, inner: AsyncIterable[Any], include_code: bool) -> None:
|
177
|
+
self._inner = inner
|
178
|
+
self._include_code = include_code
|
179
|
+
|
180
|
+
def __aiter__(self) -> AsyncIterator[Any]:
|
181
|
+
async def gen() -> AsyncIterator[Any]:
|
182
|
+
try:
|
183
|
+
async for item in self._inner:
|
184
|
+
yield item
|
185
|
+
except grpc.RpcError as e:
|
186
|
+
raise ScaleUpServerError(
|
187
|
+
_concise_error(e, include_code=self._include_code),
|
188
|
+
) from None
|
189
|
+
|
190
|
+
return gen()
|
191
|
+
|
192
|
+
|
193
|
+
# ------------------------
|
194
|
+
# Unified interceptor (sync + aio)
|
195
|
+
# ------------------------
|
196
|
+
|
197
|
+
|
198
|
+
class ErrorFormatterInterceptor(
|
199
|
+
# sync interfaces
|
200
|
+
grpc.UnaryUnaryClientInterceptor,
|
201
|
+
grpc.UnaryStreamClientInterceptor,
|
202
|
+
grpc.StreamUnaryClientInterceptor,
|
203
|
+
grpc.StreamStreamClientInterceptor,
|
204
|
+
# aio interfaces
|
205
|
+
grpc.aio.UnaryUnaryClientInterceptor,
|
206
|
+
grpc.aio.UnaryStreamClientInterceptor,
|
207
|
+
grpc.aio.StreamUnaryClientInterceptor,
|
208
|
+
grpc.aio.StreamStreamClientInterceptor,
|
209
|
+
):
|
210
|
+
"""
|
211
|
+
Prettifies gRPC errors raised by the server into ScaleUpServerError.
|
212
|
+
|
213
|
+
Works with both sync (grpc) and async (grpc.aio) channels.
|
214
|
+
|
215
|
+
- Detects whether `continuation` is a coroutine function.
|
216
|
+
- In async case, returns a coroutine that yields wrapped awaitable/async-iterable calls.
|
217
|
+
- In sync case, returns wrapped blocking call objects/iterators.
|
218
|
+
"""
|
219
|
+
|
220
|
+
def __init__(self, include_code: bool = False) -> None:
|
221
|
+
self._include_code = include_code
|
222
|
+
|
223
|
+
# ---------- UNARY -> UNARY ----------
|
224
|
+
|
225
|
+
async def _async_unary_unary(self, continuation, client_call_details, request) -> Any:
|
226
|
+
try:
|
227
|
+
call = continuation(client_call_details, request) # awaitable call
|
228
|
+
# Await here so callers receive the *message*, mirroring AuthInterceptor.
|
229
|
+
return await call
|
230
|
+
except grpc.RpcError as e:
|
231
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
232
|
+
|
233
|
+
def _sync_unary_unary(self, continuation, client_call_details, request) -> Any:
|
234
|
+
try:
|
235
|
+
call = continuation(client_call_details, request) # blocking call
|
236
|
+
except grpc.RpcError as e:
|
237
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
238
|
+
return _UnaryUnaryCallWrapper(call, self._include_code)
|
239
|
+
|
240
|
+
def intercept_unary_unary(self, continuation, client_call_details, request): # type: ignore[override]
|
241
|
+
if inspect.iscoroutinefunction(continuation):
|
242
|
+
return self._async_unary_unary(continuation, client_call_details, request)
|
243
|
+
return self._sync_unary_unary(continuation, client_call_details, request)
|
244
|
+
|
245
|
+
# ---------- UNARY -> STREAM ----------
|
246
|
+
|
247
|
+
async def _async_unary_stream(self, continuation, client_call_details, request) -> Any:
|
248
|
+
try:
|
249
|
+
resp_call = continuation(client_call_details, request) # async-iterable call
|
250
|
+
# Do NOT await: return an iterator wrapper that prettifies stream errors.
|
251
|
+
return _AioRespAsyncIterWrapper(resp_call, self._include_code)
|
252
|
+
except grpc.RpcError as e:
|
253
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
254
|
+
|
255
|
+
def _sync_unary_stream(self, continuation, client_call_details, request) -> Any:
|
256
|
+
try:
|
257
|
+
resp_iter = continuation(client_call_details, request) # iterator
|
258
|
+
except grpc.RpcError as e:
|
259
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
260
|
+
return _SyncRespIterWrapper(resp_iter, self._include_code)
|
261
|
+
|
262
|
+
def intercept_unary_stream(self, continuation, client_call_details, request): # type: ignore[override]
|
263
|
+
if inspect.iscoroutinefunction(continuation):
|
264
|
+
return self._async_unary_stream(continuation, client_call_details, request)
|
265
|
+
return self._sync_unary_stream(continuation, client_call_details, request)
|
266
|
+
|
267
|
+
# ---------- STREAM -> UNARY ----------
|
268
|
+
|
269
|
+
async def _async_stream_unary(self, continuation, client_call_details, request_iterator) -> Any:
|
270
|
+
try:
|
271
|
+
wrapped_req = _AioReqAsyncIterWrapper(request_iterator, self._include_code)
|
272
|
+
call = continuation(client_call_details, wrapped_req) # awaitable call
|
273
|
+
# Await and return the *message*.
|
274
|
+
return await call
|
275
|
+
except grpc.RpcError as e:
|
276
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
277
|
+
|
278
|
+
def _sync_stream_unary(self, continuation, client_call_details, request_iterator) -> Any:
|
279
|
+
try:
|
280
|
+
wrapped_req = _SyncReqIterWrapper(request_iterator, self._include_code)
|
281
|
+
call = continuation(client_call_details, wrapped_req) # blocking call
|
282
|
+
except grpc.RpcError as e:
|
283
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
284
|
+
return _UnaryUnaryCallWrapper(call, self._include_code)
|
285
|
+
|
286
|
+
def intercept_stream_unary(self, continuation, client_call_details, request_iterator): # type: ignore[override]
|
287
|
+
if inspect.iscoroutinefunction(continuation):
|
288
|
+
return self._async_stream_unary(continuation, client_call_details, request_iterator)
|
289
|
+
return self._sync_stream_unary(continuation, client_call_details, request_iterator)
|
290
|
+
|
291
|
+
# ---------- STREAM -> STREAM ----------
|
292
|
+
|
293
|
+
async def _async_stream_stream(
|
294
|
+
self,
|
295
|
+
continuation,
|
296
|
+
client_call_details,
|
297
|
+
request_iterator,
|
298
|
+
) -> Any:
|
299
|
+
try:
|
300
|
+
wrapped_req = _AioReqAsyncIterWrapper(request_iterator, self._include_code)
|
301
|
+
resp_call = continuation(client_call_details, wrapped_req) # async-iterable call
|
302
|
+
# Return iterator wrapper.
|
303
|
+
return _AioRespAsyncIterWrapper(resp_call, self._include_code)
|
304
|
+
except grpc.RpcError as e:
|
305
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
306
|
+
|
307
|
+
def _sync_stream_stream(self, continuation, client_call_details, request_iterator) -> Any:
|
308
|
+
try:
|
309
|
+
wrapped_req = _SyncReqIterWrapper(request_iterator, self._include_code)
|
310
|
+
resp_iter = continuation(client_call_details, wrapped_req) # iterator
|
311
|
+
except grpc.RpcError as e:
|
312
|
+
raise ScaleUpServerError(_concise_error(e, include_code=self._include_code)) from None
|
313
|
+
return _SyncRespIterWrapper(resp_iter, self._include_code)
|
314
|
+
|
315
|
+
def intercept_stream_stream(self, continuation, client_call_details, request_iterator): # type: ignore[override]
|
316
|
+
if inspect.iscoroutinefunction(continuation):
|
317
|
+
return self._async_stream_stream(continuation, client_call_details, request_iterator)
|
318
|
+
return self._sync_stream_stream(continuation, client_call_details, request_iterator)
|
@@ -19,7 +19,6 @@ from pydantic import (
|
|
19
19
|
BaseModel,
|
20
20
|
BeforeValidator,
|
21
21
|
ConfigDict,
|
22
|
-
Field,
|
23
22
|
PlainSerializer,
|
24
23
|
ValidationError,
|
25
24
|
)
|
@@ -87,7 +86,7 @@ class PlotConfig(BaseModel):
|
|
87
86
|
report: PlotReport | None = None
|
88
87
|
|
89
88
|
|
90
|
-
@dataclass(config=ConfigDict(arbitrary_types_allowed=True))
|
89
|
+
@dataclass(config=ConfigDict(arbitrary_types_allowed=True, extra="forbid"))
|
91
90
|
class PlotData1D:
|
92
91
|
x: _SerializableArray
|
93
92
|
y: _SerializableArray
|
@@ -113,7 +112,7 @@ class PlotData1D:
|
|
113
112
|
raise ValueError("The shapes of y and y_error must match.")
|
114
113
|
|
115
114
|
|
116
|
-
@dataclass(config=ConfigDict(arbitrary_types_allowed=True))
|
115
|
+
@dataclass(config=ConfigDict(arbitrary_types_allowed=True, extra="forbid"))
|
117
116
|
class HeatmapData:
|
118
117
|
x: _SerializableArray
|
119
118
|
y: _SerializableArray
|
@@ -123,6 +122,7 @@ class HeatmapData:
|
|
123
122
|
|
124
123
|
# Whether to display the heatmap values as text.
|
125
124
|
heatmap_text: bool = False
|
125
|
+
color_map: Literal["sequential", "divergent"] = "sequential"
|
126
126
|
|
127
127
|
def __post_init__(self):
|
128
128
|
if self.x.ndim != 1:
|
@@ -158,12 +158,12 @@ class LinePlot(BaseModel):
|
|
158
158
|
|
159
159
|
config: PlotConfig
|
160
160
|
heatmap: HeatmapData | None = None
|
161
|
-
lines:
|
161
|
+
lines: list[PlotData1D] = []
|
162
162
|
markers: list[Marker] = []
|
163
163
|
vlines: list[VLine] = []
|
164
164
|
|
165
165
|
|
166
|
-
@dataclass(config=ConfigDict(arbitrary_types_allowed=True))
|
166
|
+
@dataclass(config=ConfigDict(arbitrary_types_allowed=True, extra="forbid"))
|
167
167
|
class HistogramData:
|
168
168
|
data: _SerializableArray
|
169
169
|
label: str | None = None
|
@@ -16,7 +16,7 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
|
|
16
16
|
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
17
17
|
|
18
18
|
|
19
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.boulderopalscaleupsdk/protobuf/v1/device.proto\x12!boulderopalscaleupsdk.protobuf.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\"
|
19
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.boulderopalscaleupsdk/protobuf/v1/device.proto\x12!boulderopalscaleupsdk.protobuf.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\"b\n\x12SetSnapshotRequest\x12\x1f\n\x0b\x64\x65vice_name\x18\x01 \x01(\tR\ndeviceName\x12+\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x04\x64\x61ta\"P\n\x13SetSnapshotResponse\x12\x1f\n\x0b\x64\x65vice_name\x18\x01 \x01(\tR\ndeviceName\x12\x18\n\x07version\x18\x02 \x01(\x05R\x07version\"O\n\x12GetSnapshotRequest\x12\x1f\n\x0b\x64\x65vice_name\x18\x01 \x01(\tR\ndeviceName\x12\x18\n\x07version\x18\x02 \x01(\x05R\x07version\"B\n\x13GetSnapshotResponse\x12+\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x04\x64\x61ta\"\x85\x01\n\rCreateRequest\x12\x19\n\x08\x61pp_name\x18\x01 \x01(\tR\x07\x61ppName\x12\x1f\n\x0b\x64\x65vice_name\x18\x02 \x01(\tR\ndeviceName\x12\x38\n\x0b\x64\x65vice_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\ndeviceData\"$\n\x0e\x43reateResponse\x12\x12\n\x04\x64one\x18\x01 \x01(\x08R\x04\x64one\"]\n\x0b\x43opyRequest\x12(\n\x10\x66rom_device_name\x18\x01 \x01(\tR\x0e\x66romDeviceName\x12$\n\x0eto_device_name\x18\x02 \x01(\tR\x0ctoDeviceName\"\"\n\x0c\x43opyResponse\x12\x12\n\x04\x64one\x18\x01 \x01(\x08R\x04\x64one\"L\n\x0eGetDataRequest\x12\x19\n\x08\x61pp_name\x18\x01 \x01(\tR\x07\x61ppName\x12\x1f\n\x0b\x64\x65vice_name\x18\x02 \x01(\tR\ndeviceName\"\xc6\x01\n\x0fGetDataResponse\x12>\n\x0eprocessor_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\rprocessorData\x12@\n\x0f\x63ontroller_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\x0e\x63ontrollerData\x12\x31\n\x07\x64\x65\x66\x63\x61ls\x18\x04 \x03(\x0b\x32\x17.google.protobuf.StructR\x07\x64\x65\x66\x63\x61ls\"\x8b\x01\n\rUpdateRequest\x12\x19\n\x08\x61pp_name\x18\x01 \x01(\tR\x07\x61ppName\x12\x1f\n\x0b\x64\x65vice_name\x18\x02 \x01(\tR\ndeviceName\x12>\n\x0eprocessor_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\rprocessorData\"\x92\x01\n\x0eUpdateResponse\x12>\n\x0eprocessor_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructR\rprocessorData\x12@\n\x0f\x63ontroller_data\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x0e\x63ontrollerData\"K\n\rDeleteRequest\x12\x19\n\x08\x61pp_name\x18\x01 \x01(\tR\x07\x61ppName\x12\x1f\n\x0b\x64\x65vice_name\x18\x02 \x01(\tR\ndeviceName\"$\n\x0e\x44\x65leteResponse\x12\x12\n\x04\x64one\x18\x01 \x01(\x08R\x04\x64one\"5\n\x12GetMetadataRequest\x12\x1f\n\x0b\x64\x65vice_name\x18\x01 \x01(\tR\ndeviceName\"J\n\x13GetMetadataResponse\x12\x33\n\x08metadata\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"\x1e\n\x1cGetAllDevicesMetadataRequest\"V\n\x1dGetAllDevicesMetadataResponse\x12\x35\n\tmetadatas\x18\x01 \x03(\x0b\x32\x17.google.protobuf.StructR\tmetadatas\"\x90\x01\n\x0bMaskRequest\x12\x44\n\x04mode\x18\x01 \x01(\x0e\x32\x30.boulderopalscaleupsdk.protobuf.v1.SelectionModeR\x04mode\x12\x1f\n\x0b\x64\x65vice_name\x18\x02 \x01(\tR\ndeviceName\x12\x1a\n\x08\x65lements\x18\x03 \x03(\tR\x08\x65lements\"\"\n\x0cMaskResponse\x12\x12\n\x04\x64one\x18\x01 \x01(\x08R\x04\x64one\"L\n\rUnmaskRequest\x12\x1f\n\x0b\x64\x65vice_name\x18\x01 \x01(\tR\ndeviceName\x12\x1a\n\x08\x65lements\x18\x02 \x03(\tR\x08\x65lements\"$\n\x0eUnmaskResponse\x12\x12\n\x04\x64one\x18\x01 \x01(\x08R\x04\x64one*a\n\rSelectionMode\x12\x1e\n\x1aSELECTION_MODE_UNSPECIFIED\x10\x00\x12\x18\n\x14SELECTION_MODE_ITEMS\x10\x01\x12\x16\n\x12SELECTION_MODE_ALL\x10\x02\x32\xb8\r\n\x14\x44\x65viceManagerService\x12\x8b\x01\n\x06\x43reate\x12\x30.boulderopalscaleupsdk.protobuf.v1.CreateRequest\x1a\x31.boulderopalscaleupsdk.protobuf.v1.CreateResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\"\x11/v1/device/create:\x01*\x12\x83\x01\n\x04\x43opy\x12..boulderopalscaleupsdk.protobuf.v1.CopyRequest\x1a/.boulderopalscaleupsdk.protobuf.v1.CopyResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\"\x0f/v1/device/copy:\x01*\x12\x97\x01\n\x07GetData\x12\x31.boulderopalscaleupsdk.protobuf.v1.GetDataRequest\x1a\x32.boulderopalscaleupsdk.protobuf.v1.GetDataResponse\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/v1/device/get_device_data:\x01*\x12\x8b\x01\n\x06Update\x12\x30.boulderopalscaleupsdk.protobuf.v1.UpdateRequest\x1a\x31.boulderopalscaleupsdk.protobuf.v1.UpdateResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\"\x11/v1/device/update:\x01*\x12\x83\x01\n\x04Mask\x12..boulderopalscaleupsdk.protobuf.v1.MaskRequest\x1a/.boulderopalscaleupsdk.protobuf.v1.MaskResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\"\x0f/v1/device/mask:\x01*\x12\x8b\x01\n\x06Unmask\x12\x30.boulderopalscaleupsdk.protobuf.v1.UnmaskRequest\x1a\x31.boulderopalscaleupsdk.protobuf.v1.UnmaskResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\"\x11/v1/device/unmask:\x01*\x12\x8b\x01\n\x06\x44\x65lete\x12\x30.boulderopalscaleupsdk.protobuf.v1.DeleteRequest\x1a\x31.boulderopalscaleupsdk.protobuf.v1.DeleteResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\"\x11/v1/device/delete:\x01*\x12\xa7\x01\n\x0bGetMetadata\x12\x35.boulderopalscaleupsdk.protobuf.v1.GetMetadataRequest\x1a\x36.boulderopalscaleupsdk.protobuf.v1.GetMetadataResponse\")\x82\xd3\xe4\x93\x02#\"\x1e/v1/device/get_device_metadata:\x01*\x12\xd1\x01\n\x15GetAllDevicesMetadata\x12?.boulderopalscaleupsdk.protobuf.v1.GetAllDevicesMetadataRequest\x1a@.boulderopalscaleupsdk.protobuf.v1.GetAllDevicesMetadataResponse\"5\x82\xd3\xe4\x93\x02/\"*/v1/device/get_all_devices_metadata_by_org:\x01*\x12\xa0\x01\n\x0bGetSnapshot\x12\x35.boulderopalscaleupsdk.protobuf.v1.GetSnapshotRequest\x1a\x36.boulderopalscaleupsdk.protobuf.v1.GetSnapshotResponse\"\"\x82\xd3\xe4\x93\x02\x1c\"\x17/v1/device/get_snapshot:\x01*\x12\xa0\x01\n\x0bSetSnapshot\x12\x35.boulderopalscaleupsdk.protobuf.v1.SetSnapshotRequest\x1a\x36.boulderopalscaleupsdk.protobuf.v1.SetSnapshotResponse\"\"\x82\xd3\xe4\x93\x02\x1c\"\x17/v1/device/set_snapshot:\x01*B\xaa\x02\n%com.boulderopalscaleupsdk.protobuf.v1B\x0b\x44\x65viceProtoP\x01ZNgithub.com/qctrl/boulder-opal-scale-up/proto/boulderopalscaleupsdk/protobuf/v1\xa2\x02\x03\x42PX\xaa\x02!Boulderopalscaleupsdk.Protobuf.V1\xca\x02!Boulderopalscaleupsdk\\Protobuf\\V1\xe2\x02-Boulderopalscaleupsdk\\Protobuf\\V1\\GPBMetadata\xea\x02#Boulderopalscaleupsdk::Protobuf::V1b\x06proto3')
|
20
20
|
|
21
21
|
_globals = globals()
|
22
22
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -32,58 +32,66 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
32
32
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetData']._serialized_options = b'\202\323\344\223\002\037\"\032/v1/device/get_device_data:\001*'
|
33
33
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Update']._loaded_options = None
|
34
34
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Update']._serialized_options = b'\202\323\344\223\002\026\"\021/v1/device/update:\001*'
|
35
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Mask']._loaded_options = None
|
36
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Mask']._serialized_options = b'\202\323\344\223\002\024\"\017/v1/device/mask:\001*'
|
37
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Unmask']._loaded_options = None
|
38
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Unmask']._serialized_options = b'\202\323\344\223\002\026\"\021/v1/device/unmask:\001*'
|
35
39
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Delete']._loaded_options = None
|
36
40
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['Delete']._serialized_options = b'\202\323\344\223\002\026\"\021/v1/device/delete:\001*'
|
37
|
-
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['ListJobs']._loaded_options = None
|
38
|
-
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['ListJobs']._serialized_options = b'\202\323\344\223\002\031\"\024/v1/device/list_jobs:\001*'
|
39
|
-
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetJob']._loaded_options = None
|
40
|
-
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetJob']._serialized_options = b'\202\323\344\223\002\027\"\022/v1/device/get_job:\001*'
|
41
|
-
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetJobSummary']._loaded_options = None
|
42
|
-
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetJobSummary']._serialized_options = b'\202\323\344\223\002\037\"\032/v1/device/get_job_summary:\001*'
|
43
41
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetMetadata']._loaded_options = None
|
44
42
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetMetadata']._serialized_options = b'\202\323\344\223\002#\"\036/v1/device/get_device_metadata:\001*'
|
45
43
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetAllDevicesMetadata']._loaded_options = None
|
46
44
|
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetAllDevicesMetadata']._serialized_options = b'\202\323\344\223\002/\"*/v1/device/get_all_devices_metadata_by_org:\001*'
|
47
|
-
_globals['
|
48
|
-
_globals['
|
49
|
-
_globals['
|
50
|
-
_globals['
|
51
|
-
_globals['
|
52
|
-
_globals['
|
53
|
-
_globals['
|
54
|
-
_globals['
|
55
|
-
_globals['
|
56
|
-
_globals['
|
57
|
-
_globals['
|
58
|
-
_globals['
|
59
|
-
_globals['
|
60
|
-
_globals['
|
61
|
-
_globals['
|
62
|
-
_globals['
|
63
|
-
_globals['
|
64
|
-
_globals['
|
65
|
-
_globals['
|
66
|
-
_globals['
|
67
|
-
_globals['
|
68
|
-
_globals['
|
69
|
-
_globals['
|
70
|
-
_globals['
|
71
|
-
_globals['
|
72
|
-
_globals['
|
73
|
-
_globals['
|
74
|
-
_globals['
|
75
|
-
_globals['
|
76
|
-
_globals['
|
77
|
-
_globals['
|
78
|
-
_globals['
|
79
|
-
_globals['
|
80
|
-
_globals['
|
81
|
-
_globals['
|
82
|
-
_globals['
|
83
|
-
_globals['
|
84
|
-
_globals['
|
85
|
-
_globals['
|
86
|
-
_globals['
|
87
|
-
_globals['
|
88
|
-
_globals['
|
45
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetSnapshot']._loaded_options = None
|
46
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['GetSnapshot']._serialized_options = b'\202\323\344\223\002\034\"\027/v1/device/get_snapshot:\001*'
|
47
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['SetSnapshot']._loaded_options = None
|
48
|
+
_globals['_DEVICEMANAGERSERVICE'].methods_by_name['SetSnapshot']._serialized_options = b'\202\323\344\223\002\034\"\027/v1/device/set_snapshot:\001*'
|
49
|
+
_globals['_SELECTIONMODE']._serialized_start=2016
|
50
|
+
_globals['_SELECTIONMODE']._serialized_end=2113
|
51
|
+
_globals['_SETSNAPSHOTREQUEST']._serialized_start=145
|
52
|
+
_globals['_SETSNAPSHOTREQUEST']._serialized_end=243
|
53
|
+
_globals['_SETSNAPSHOTRESPONSE']._serialized_start=245
|
54
|
+
_globals['_SETSNAPSHOTRESPONSE']._serialized_end=325
|
55
|
+
_globals['_GETSNAPSHOTREQUEST']._serialized_start=327
|
56
|
+
_globals['_GETSNAPSHOTREQUEST']._serialized_end=406
|
57
|
+
_globals['_GETSNAPSHOTRESPONSE']._serialized_start=408
|
58
|
+
_globals['_GETSNAPSHOTRESPONSE']._serialized_end=474
|
59
|
+
_globals['_CREATEREQUEST']._serialized_start=477
|
60
|
+
_globals['_CREATEREQUEST']._serialized_end=610
|
61
|
+
_globals['_CREATERESPONSE']._serialized_start=612
|
62
|
+
_globals['_CREATERESPONSE']._serialized_end=648
|
63
|
+
_globals['_COPYREQUEST']._serialized_start=650
|
64
|
+
_globals['_COPYREQUEST']._serialized_end=743
|
65
|
+
_globals['_COPYRESPONSE']._serialized_start=745
|
66
|
+
_globals['_COPYRESPONSE']._serialized_end=779
|
67
|
+
_globals['_GETDATAREQUEST']._serialized_start=781
|
68
|
+
_globals['_GETDATAREQUEST']._serialized_end=857
|
69
|
+
_globals['_GETDATARESPONSE']._serialized_start=860
|
70
|
+
_globals['_GETDATARESPONSE']._serialized_end=1058
|
71
|
+
_globals['_UPDATEREQUEST']._serialized_start=1061
|
72
|
+
_globals['_UPDATEREQUEST']._serialized_end=1200
|
73
|
+
_globals['_UPDATERESPONSE']._serialized_start=1203
|
74
|
+
_globals['_UPDATERESPONSE']._serialized_end=1349
|
75
|
+
_globals['_DELETEREQUEST']._serialized_start=1351
|
76
|
+
_globals['_DELETEREQUEST']._serialized_end=1426
|
77
|
+
_globals['_DELETERESPONSE']._serialized_start=1428
|
78
|
+
_globals['_DELETERESPONSE']._serialized_end=1464
|
79
|
+
_globals['_GETMETADATAREQUEST']._serialized_start=1466
|
80
|
+
_globals['_GETMETADATAREQUEST']._serialized_end=1519
|
81
|
+
_globals['_GETMETADATARESPONSE']._serialized_start=1521
|
82
|
+
_globals['_GETMETADATARESPONSE']._serialized_end=1595
|
83
|
+
_globals['_GETALLDEVICESMETADATAREQUEST']._serialized_start=1597
|
84
|
+
_globals['_GETALLDEVICESMETADATAREQUEST']._serialized_end=1627
|
85
|
+
_globals['_GETALLDEVICESMETADATARESPONSE']._serialized_start=1629
|
86
|
+
_globals['_GETALLDEVICESMETADATARESPONSE']._serialized_end=1715
|
87
|
+
_globals['_MASKREQUEST']._serialized_start=1718
|
88
|
+
_globals['_MASKREQUEST']._serialized_end=1862
|
89
|
+
_globals['_MASKRESPONSE']._serialized_start=1864
|
90
|
+
_globals['_MASKRESPONSE']._serialized_end=1898
|
91
|
+
_globals['_UNMASKREQUEST']._serialized_start=1900
|
92
|
+
_globals['_UNMASKREQUEST']._serialized_end=1976
|
93
|
+
_globals['_UNMASKRESPONSE']._serialized_start=1978
|
94
|
+
_globals['_UNMASKRESPONSE']._serialized_end=2014
|
95
|
+
_globals['_DEVICEMANAGERSERVICE']._serialized_start=2116
|
96
|
+
_globals['_DEVICEMANAGERSERVICE']._serialized_end=3836
|
89
97
|
# @@protoc_insertion_point(module_scope)
|