Skip to content

Commit 6188c33

Browse files
committed
changed list to typing.List
1 parent 6f1951d commit 6188c33

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/axiomatic/pic_helpers.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import iklayout # type: ignore
22
import matplotlib.pyplot as plt # type: ignore
33
from ipywidgets import interactive, IntSlider # type: ignore
4-
4+
from typing import List
55

66
def plot_circuit(component):
77
"""
@@ -21,7 +21,7 @@ def plot_circuit(component):
2121
return iklayout.show(path)
2222

2323

24-
def plot_losses(losses: list[float], iterations: list[int] = []):
24+
def plot_losses(losses: List[float], iterations: List[int] = []):
2525
"""
2626
Plot a list of losses with labels.
2727
@@ -37,7 +37,7 @@ def plot_losses(losses: list[float], iterations: list[int] = []):
3737
plt.show()
3838

3939

40-
def plot_constraints(constraints: list[list[float]], constraints_labels: list[str], iterations: list[int] = []):
40+
def plot_constraints(constraints: List[List[float]], constraints_labels: List[str], iterations: List[int] = []):
4141
"""
4242
Plot a list of constraints with labels.
4343
@@ -60,10 +60,10 @@ def plot_constraints(constraints: list[list[float]], constraints_labels: list[st
6060
plt.show()
6161

6262

63-
def plot_single_spectrum(spectrum: list[float],
64-
wavelengths: list[float],
65-
vlines: list[float] = [],
66-
hlines: list[float] = []):
63+
def plot_single_spectrum(spectrum: List[float],
64+
wavelengths: List[float],
65+
vlines: List[float] = [],
66+
hlines: List[float] = []):
6767
"""
6868
Plot a single spectrum with vertical and horizontal lines.
6969
"""
@@ -84,12 +84,12 @@ def plot_single_spectrum(spectrum: list[float],
8484

8585

8686
def plot_interactive_spectrums(
87-
spectrums: list[list[list[float]]],
88-
wavelengths: list[float],
89-
spectrum_labels: list[str] = [],
90-
slider_index: list[int] = [],
91-
vlines: list[float] = [],
92-
hlines: list[float] = [],
87+
spectrums: List[List[List[float]]],
88+
wavelengths: List[float],
89+
spectrum_labels: List[str] = [],
90+
slider_index: List[int] = [],
91+
vlines: List[float] = [],
92+
hlines: List[float] = [],
9393
):
9494
"""
9595
Creates an interactive plot of spectrums with a slider to select different indices.

0 commit comments

Comments
 (0)