|
4 | 4 | """ |
5 | 5 |
|
6 | 6 | import copy |
7 | | -from typing import Any |
| 7 | +from typing import Any, Callable |
8 | 8 |
|
9 | 9 | from ..core import NUMERICAL_TOLERANCE, logger, update_uncertainty |
10 | 10 | from ._interval import Interval, IntervalUnion |
|
45 | 45 |
|
46 | 46 |
|
47 | 47 | def iterate_tptn( |
48 | | - *, score: str, score_value: float, valid_pairs: dict, sol_fun, params: dict, iterate_by: str |
| 48 | + *, score: str, score_value: float, valid_pairs: dict, sol_fun: Callable, params: dict, iterate_by: str |
49 | 49 | ) -> dict: |
50 | 50 | """ |
51 | 51 | Iterate through the potential values of tp or tn and construct feasible pairs |
@@ -110,7 +110,7 @@ def update_sens(p: int, valid_pairs: dict, score_int: "Interval", solve_for: str |
110 | 110 | return valid_pairs |
111 | 111 |
|
112 | 112 |
|
113 | | -def update_spec(n: int, valid_pairs: dict, score_int, solve_for: str) -> dict: |
| 113 | +def update_spec(n: int, valid_pairs: dict, score_int: Interval | IntervalUnion, solve_for: str) -> dict: |
114 | 114 | """ |
115 | 115 | Update specificity intervals |
116 | 116 |
|
@@ -175,7 +175,7 @@ def _check_scores_tptn_pairs( |
175 | 175 | p: int, |
176 | 176 | n: int, |
177 | 177 | scores: dict, |
178 | | - eps, |
| 178 | + eps: float | dict, |
179 | 179 | *, |
180 | 180 | numerical_tolerance: float = NUMERICAL_TOLERANCE, |
181 | 181 | solve_for: str | None = None, |
@@ -347,7 +347,7 @@ def update_tptn(tp: Interval | IntervalUnion, tn: Interval | IntervalUnion, sols |
347 | 347 |
|
348 | 348 |
|
349 | 349 | def _check_scores_tptn_intervals( |
350 | | - p: int, n: int, scores: dict, eps, *, numerical_tolerance: float = NUMERICAL_TOLERANCE |
| 350 | + p: int, n: int, scores: dict, eps: float | dict, *, numerical_tolerance: float = NUMERICAL_TOLERANCE |
351 | 351 | ) -> dict: |
352 | 352 | """ |
353 | 353 | Check scores by iteratively reducing the set of feasible ``tp``, ``tn`` pairs. |
@@ -484,7 +484,7 @@ def check_scores_tptn_pairs( |
484 | 484 | p: int, |
485 | 485 | n: int, |
486 | 486 | scores: dict, |
487 | | - eps, |
| 487 | + eps: float | dict, |
488 | 488 | *, |
489 | 489 | numerical_tolerance: float = NUMERICAL_TOLERANCE, |
490 | 490 | solve_for: str | None = None, |
|
0 commit comments