From d6cc9cb638871b7662707b8c929944101be25f92 Mon Sep 17 00:00:00 2001 From: Eliott Rosenberg Date: Thu, 25 Jan 2024 22:52:03 -0800 Subject: [PATCH] coverage ignore for exceptions --- .../cirq/experiments/single_qubit_readout_calibration.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cirq-core/cirq/experiments/single_qubit_readout_calibration.py b/cirq-core/cirq/experiments/single_qubit_readout_calibration.py index 4b286307f15..aebf9a0a834 100644 --- a/cirq-core/cirq/experiments/single_qubit_readout_calibration.py +++ b/cirq-core/cirq/experiments/single_qubit_readout_calibration.py @@ -80,8 +80,10 @@ def plot_heatmap( _, axs = plt.subplots(1, 2, dpi=200, facecolor='white', figsize=(12, 4)) else: - if not len(axs) != 2 or type(axs[0]) != plt.Axes or type(axs[1]) != plt.Axes: - raise ValueError('axs should be a length-2 tuple of plt.Axes') + if ( + not len(axs) != 2 or type(axs[0]) != plt.Axes or type(axs[1]) != plt.Axes + ): # pragma: no cover + raise ValueError('axs should be a length-2 tuple of plt.Axes') # pragma: no cover for ax, title, data in zip( axs, ['$|0\\rangle$ errors', '$|1\\rangle$ errors'], @@ -90,7 +92,7 @@ def plot_heatmap( data_with_grid_qubit_keys = {} for qubit in data: if type(qubit) != grid_qubit.GridQubit: - raise TypeError(f'{qubit} must be of type cirq.GridQubit') + raise TypeError(f'{qubit} must be of type cirq.GridQubit') # pragma: no cover 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