From 67197da4032f2dbc37bc40e14618111312f11883 Mon Sep 17 00:00:00 2001 From: HGSilveri Date: Tue, 19 Nov 2024 13:38:45 +0100 Subject: [PATCH] Fix typing issues --- pulser-core/pulser/backend/state.py | 4 ++-- pulser-pasqal/pulser_pasqal/pasqal_cloud.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pulser-core/pulser/backend/state.py b/pulser-core/pulser/backend/state.py index 1dcc27fa..48c6f78a 100644 --- a/pulser-core/pulser/backend/state.py +++ b/pulser-core/pulser/backend/state.py @@ -17,11 +17,11 @@ from abc import ABC, abstractmethod from collections import Counter from collections.abc import Sequence -from typing import Generic, Literal, Type, TypeVar +from typing import Generic, Literal, Type, TypeVar, Union from pulser.channels.base_channel import States -Eigenstate = States | Literal["O", "1"] +Eigenstate = Union[States, Literal["0", "1"]] ArgScalarType = TypeVar("ArgScalarType") ReturnScalarType = TypeVar("ReturnScalarType") diff --git a/pulser-pasqal/pulser_pasqal/pasqal_cloud.py b/pulser-pasqal/pulser_pasqal/pasqal_cloud.py index 5cb8de9c..ec732056 100644 --- a/pulser-pasqal/pulser_pasqal/pasqal_cloud.py +++ b/pulser-pasqal/pulser_pasqal/pasqal_cloud.py @@ -238,6 +238,7 @@ def _query_job_progress( get_batch_fn = backoff_decorator(self._sdk_connection.get_batch) batch = get_batch_fn(id=batch_id) + assert isinstance(batch.sequence_builder, str) seq_builder = Sequence.from_abstract_repr(batch.sequence_builder) reg = seq_builder.get_register(include_mappable=True) all_qubit_ids = reg.qubit_ids