From d264f06a5390290391369681600be81ca17fe2a7 Mon Sep 17 00:00:00 2001 From: Eliott Rosenberg Date: Thu, 25 Jan 2024 22:32:08 -0800 Subject: [PATCH] typecheck, etc --- .../cirq/experiments/single_qubit_readout_calibration.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cirq-core/cirq/experiments/single_qubit_readout_calibration.py b/cirq-core/cirq/experiments/single_qubit_readout_calibration.py index 3a31aaadadd..4b286307f15 100644 --- a/cirq-core/cirq/experiments/single_qubit_readout_calibration.py +++ b/cirq-core/cirq/experiments/single_qubit_readout_calibration.py @@ -14,7 +14,7 @@ """Single qubit readout experiments using parallel or isolated statistics.""" import dataclasses import time -from typing import Any, Dict, Iterable, List, Optional, TYPE_CHECKING, cast +from typing import Any, Dict, Iterable, List, Optional, TYPE_CHECKING import sympy import numpy as np @@ -72,8 +72,8 @@ def plot_heatmap( The two plt.Axes containing the plot. Raises: - ValueError if axs does not contain two plt.Axes - TypeError if qubits are not cirq.GridQubits + ValueError: axs does not contain two plt.Axes + TypeError: qubits are not cirq.GridQubits """ if axs is None: @@ -91,7 +91,6 @@ def plot_heatmap( for qubit in data: if type(qubit) != grid_qubit.GridQubit: raise TypeError(f'{qubit} must be of type cirq.GridQubit') - cast(grid_qubit.GridQubit, qubit) data_with_grid_qubit_keys[qubit] = data[qubit] # just for typecheck _, _ = cirq_heatmap.Heatmap(data_with_grid_qubit_keys).plot( ax, annotation_format=annotation_format, title=title, **plot_kwargs