Skip to content

Commit 9a82b64

Browse files
committed
type hint fixes for adaptive/learner/average_learner.py
1 parent 8f8c5dc commit 9a82b64

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

adaptive/learner/average_learner.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from functools import partial
21
from math import sqrt
3-
from typing import Callable, Dict, List, Optional, Tuple, Union
2+
from typing import Callable, Dict, List, Optional, Tuple
43

54
import numpy as np
65

@@ -34,9 +33,9 @@ class AverageLearner(BaseLearner):
3433

3534
def __init__(
3635
self,
37-
function: Union[partial, Callable],
38-
atol: None = None,
39-
rtol: Optional[Union[int, float]] = None,
36+
function: Callable,
37+
atol: Optional[float] = None,
38+
rtol: Optional[float] = None,
4039
) -> None:
4140
if atol is None and rtol is None:
4241
raise Exception("At least one of `atol` and `rtol` should be set.")
@@ -75,7 +74,7 @@ def ask(self, n: int, tell_pending: bool = True) -> Tuple[List[int], List[float]
7574
self.tell_pending(p)
7675
return points, loss_improvements
7776

78-
def tell(self, n: int, value: Union[int, float]) -> None:
77+
def tell(self, n: int, value: float) -> None:
7978
if n in self.data:
8079
# The point has already been added before.
8180
return

0 commit comments

Comments
 (0)