Skip to content

Commit 857dd1a

Browse files
authored
Merge pull request #15 from Axiomatic-AI/hot-fix-tests
changed code to Optional
2 parents 2b91d21 + 5ce8fcd commit 857dd1a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/axiomatic/pic_helpers.py

Lines changed: 10 additions & 10 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-
from typing import List
4+
from typing import List, Optional
55

66

77
def plot_circuit(component):
@@ -23,7 +23,7 @@ def plot_circuit(component):
2323

2424

2525
def plot_losses(
26-
losses: List[float], iterations: List[int] | None = None, return_fig: bool = True
26+
losses: List[float], iterations: Optional[List[int]] = None, return_fig: bool = True
2727
):
2828
"""
2929
Plot a list of losses with labels.
@@ -45,8 +45,8 @@ def plot_losses(
4545

4646
def plot_constraints(
4747
constraints: List[List[float]],
48-
constraints_labels: List[str] | None = None,
49-
iterations: List[int] | None = None,
48+
constraints_labels: Optional[List[str]] = None,
49+
iterations: Optional[List[int]] = None,
5050
return_fig: bool = True,
5151
):
5252
"""
@@ -80,8 +80,8 @@ def plot_constraints(
8080
def plot_single_spectrum(
8181
spectrum: List[float],
8282
wavelengths: List[float],
83-
vlines: List[float] | None = None,
84-
hlines: List[float] | None = None,
83+
vlines: Optional[List[float]] = None,
84+
hlines: Optional[List[float]] = None,
8585
return_fig: bool = True,
8686
):
8787
"""
@@ -112,10 +112,10 @@ def plot_single_spectrum(
112112
def plot_interactive_spectrums(
113113
spectrums: List[List[List[float]]],
114114
wavelengths: List[float],
115-
spectrum_labels: List[str] | None = None,
116-
slider_index: List[int] | None = None,
117-
vlines: List[float] | None = None,
118-
hlines: List[float] | None = None,
115+
spectrum_labels: Optional[List[str]] = None,
116+
slider_index: Optional[List[int]] = None,
117+
vlines: Optional[List[float]] = None,
118+
hlines: Optional[List[float]] = None,
119119
):
120120
"""
121121
Creates an interactive plot of spectrums with a slider to select different indices.

0 commit comments

Comments
 (0)