Skip to content

Commit b2b2e16

Browse files
committed
type hint fixes for adaptive/tests/test_learner1d.py
1 parent 085dc02 commit b2b2e16

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

adaptive/tests/test_learner1d.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import random
2-
from typing import Tuple, Union
2+
from typing import Tuple
33

44
import numpy as np
55

@@ -105,9 +105,7 @@ def test_loss_interpolation() -> None:
105105
assert abs(expected_loss - loss) < 1e-15, (expected_loss, loss)
106106

107107

108-
def _run_on_discontinuity(
109-
x_0: Union[int, float], bounds: Union[Tuple[int, int], Tuple[float, float]]
110-
) -> Learner1D:
108+
def _run_on_discontinuity(x_0: float, bounds: Tuple[float, float]) -> Learner1D:
111109
def f(x):
112110
return -1 if x < x_0 else +1
113111

@@ -169,7 +167,7 @@ def goal(l):
169167
assert learner.npoints != 1000
170168

171169

172-
def small_deviations(x: float) -> Union[int, float]:
170+
def small_deviations(x: float) -> float:
173171
return 0 if x <= 1 else 1 + 10 ** (-random.randint(12, 14))
174172

175173

0 commit comments

Comments
 (0)