Skip to content

Commit c8bbbb2

Browse files
committed
Update MyPy
1 parent e0ac502 commit c8bbbb2

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

isic_challenge_scoring/classification.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ def __init__(
4747
for category in categories
4848
]
4949
)
50-
# TODO: Fixed by https://github.com/pandas-dev/pandas-stubs/pull/1105
51-
self.macro_average = self.per_category.mean( # type: ignore[assignment]
52-
axis='index'
53-
).rename('macro_average', inplace=True)
50+
self.macro_average = self.per_category.mean(axis='index').rename('macro_average')
5451
self.rocs = {
5552
category: metrics.roc(
5653
truth_probabilities[category],

isic_challenge_scoring/segmentation.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ def __init__(self, image_pairs: Iterable[ImagePair]) -> None:
5252
],
5353
)
5454

55-
# TODO: Fixed by https://github.com/pandas-dev/pandas-stubs/pull/1105
56-
self.macro_average = per_image.mean(axis='index').rename( # type: ignore[assignment]
57-
'macro_average', inplace=True
58-
)
55+
self.macro_average = per_image.mean(axis='index').rename('macro_average')
5956

6057
self.overall = self.macro_average.at['threshold_jaccard']
6158
self.validation = self.macro_average.at['threshold_jaccard']

pyproject.toml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,6 @@ line-length = 100
8181
skip-string-normalization = true
8282
target-version = ["py313"]
8383

84-
[tool.coverage.run]
85-
source_pkgs = [
86-
"isic_challenge_scoring",
87-
]
88-
89-
[tool.coverage.paths]
90-
source = [
91-
"isic_challenge_scoring/",
92-
".tox/**/site-packages/isic_challenge_scoring/",
93-
]
94-
9584
[tool.isort]
9685
profile = "black"
9786
line_length = 100
@@ -105,7 +94,12 @@ files = [
10594
"isic_challenge_scoring",
10695
"tests",
10796
]
97+
check_untyped_defs = true
98+
ignore_missing_imports = true
10899
show_error_codes = true
100+
warn_redundant_casts = true
101+
warn_unused_configs = true
102+
warn_unused_ignores = true
109103

110104
[[tool.mypy.overrides]]
111105
module = [
@@ -133,3 +127,17 @@ filterwarnings = [
133127
testpaths = [
134128
"tests",
135129
]
130+
131+
[tool.coverage.run]
132+
source_pkgs = [
133+
"isic_challenge_scoring",
134+
]
135+
136+
[tool.coverage.paths]
137+
source = [
138+
"isic_challenge_scoring/",
139+
".tox/**/site-packages/isic_challenge_scoring/",
140+
]
141+
142+
[tool.coverage.report]
143+
skip_empty = true

0 commit comments

Comments
 (0)