Skip to content

Commit

Permalink
typecheck, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
eliottrosenberg committed Jan 26, 2024
1 parent 6890e98 commit d264f06
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit d264f06

Please sign in to comment.