Skip to content

Commit 3a77bac

Browse files
committed
some more clean-up
1 parent 89fc794 commit 3a77bac

8 files changed

Lines changed: 10 additions & 10 deletions

File tree

mlscorecheck/aggregated/_evaluation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def to_dict(self) -> dict:
7272

7373
def sample_figures(
7474
self,
75-
random_state=None,
75+
random_state: int | None = None,
7676
score_subset: list | None = None
7777
) -> "Evaluation":
7878
"""

mlscorecheck/aggregated/_experiment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def to_dict(self) -> dict:
6363

6464
def sample_figures(
6565
self,
66-
random_state=None,
66+
random_state: int | None = None,
6767
score_subset: list | None = None
6868
) -> "Experiment":
6969
"""
@@ -166,7 +166,7 @@ def init_lp(self, lp_problem: pl.LpProblem, scores: dict | None = None) -> pl.Lp
166166

167167
return lp_problem
168168

169-
def populate(self, lp_problem) -> "Experiment":
169+
def populate(self, lp_problem: pl.LpProblem) -> "Experiment":
170170
"""
171171
Populates the evaluation with the figures in the solved linear programming problem
172172

mlscorecheck/aggregated/_fold.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def to_dict(self) -> dict:
5454
"""
5555
return {"p": self.p, "n": self.n, "identifier": self.identifier}
5656

57-
def sample_figures(self, random_state=None) -> "Fold":
57+
def sample_figures(self, random_state: int | None = None) -> "Fold":
5858
"""
5959
Samples the ``tp`` and ``tn`` figures
6060

mlscorecheck/aggregated/_generate_problems.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def generate_dataset(
3131
max_p: int = 100,
3232
max_n: int = 100,
3333
*,
34-
random_state=None,
34+
random_state: int | None = None,
3535
) -> dict:
3636
"""
3737
Generate a random dataset specification

mlscorecheck/check/bundles/retina/_diaretdb1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
]
2323

2424

25-
def _prepare_testsets_diaretdb1(subset_indices, data, key, assumption, threshold):
25+
def _prepare_testsets_diaretdb1(subset_indices: list, data: dict, key: str, assumption: str, threshold: float) -> tuple[list, dict]:
2626
"""
2727
Helper function for generating the diaretdb1 evaluation configuration
2828
@@ -60,7 +60,7 @@ def _prepare_testsets_diaretdb1(subset_indices, data, key, assumption, threshold
6060

6161

6262
def _prepare_configuration_diaretdb1(
63-
*, subset, class_name, pixel_level: bool, assumption: str, confidence: float, only_valid=False
63+
*, subset: str | list, class_name: str | list, pixel_level: bool, assumption: str, confidence: float, only_valid: bool = False
6464
) -> list:
6565
"""
6666
Prepares the experiment confuguration based on the description

mlscorecheck/check/bundles/retina/_hrf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def check_hrf_vessel_aggregated_mos_assumption(
117117

118118

119119
def check_hrf_vessel_aggregated_som_assumption(
120-
imageset, assumption: str, scores: dict, eps, numerical_tolerance=NUMERICAL_TOLERANCE
120+
imageset: str | list, assumption: str, scores: dict, eps: float | dict, numerical_tolerance: float = NUMERICAL_TOLERANCE
121121
) -> dict:
122122
"""
123123
Tests the consistency of scores calculated on the HRF dataset using

mlscorecheck/individual/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
functions_standardized = score_functions_standardized_without_complements
3838

3939

40-
def translate_metadata(original) -> dict | list:
40+
def translate_metadata(original: dict | list) -> dict | list:
4141
"""
4242
Translates the metadata, internally uses p instead of n_positive, n_minority or
4343
n_1, and similarly, internally uses n instead of n_negative, n_majority, or n_0.

mlscorecheck/scores/_calculate_scores.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def calculate_scores(
101101

102102
def calculate_multiclass_scores(
103103
confusion_matrix: np.ndarray,
104-
average=None,
104+
average: str | None = None,
105105
*,
106106
rounding_decimals: int | None = None,
107107
additional_symbols: dict | None = None,

0 commit comments

Comments
 (0)