diff --git a/src/qibolab/_core/serialize.py b/src/qibolab/_core/serialize.py index bab6707e1..be1c47f6d 100644 --- a/src/qibolab/_core/serialize.py +++ b/src/qibolab/_core/serialize.py @@ -33,7 +33,14 @@ def ndarray_deserialize(x: Union[str, npt.NDArray]) -> npt.NDArray: PlainValidator(ndarray_deserialize), PlainSerializer(ndarray_serialize, return_type=str), ] -"""Pydantic-compatible array representation.""" +"""Bytes-based array representation.""" + +ArrayList = Annotated[ + npt.NDArray, + PlainValidator(np.array), + PlainSerializer(lambda a: a.tolist(), return_type=list), +] +"""Array representation based on list serialization.""" def eq(obj1: BaseModel, obj2: BaseModel) -> bool: