Skip to content

Commit 3bf07c4

Browse files
authored
Merge pull request #136 from ImageMarkup/mypy
Update MyPy
2 parents 62750f8 + c8bbbb2 commit 3bf07c4

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
@@ -87,17 +87,6 @@ line-length = 100
8787
skip-string-normalization = true
8888
target-version = ["py313"]
8989

90-
[tool.coverage.run]
91-
source_pkgs = [
92-
"isic_challenge_scoring",
93-
]
94-
95-
[tool.coverage.paths]
96-
source = [
97-
"isic_challenge_scoring/",
98-
".tox/**/site-packages/isic_challenge_scoring/",
99-
]
100-
10190
[tool.isort]
10291
profile = "black"
10392
line_length = 100
@@ -111,7 +100,12 @@ files = [
111100
"isic_challenge_scoring",
112101
"tests",
113102
]
103+
check_untyped_defs = true
104+
ignore_missing_imports = true
114105
show_error_codes = true
106+
warn_redundant_casts = true
107+
warn_unused_configs = true
108+
warn_unused_ignores = true
115109

116110
[[tool.mypy.overrides]]
117111
module = [
@@ -139,3 +133,17 @@ filterwarnings = [
139133
testpaths = [
140134
"tests",
141135
]
136+
137+
[tool.coverage.run]
138+
source_pkgs = [
139+
"isic_challenge_scoring",
140+
]
141+
142+
[tool.coverage.paths]
143+
source = [
144+
"isic_challenge_scoring/",
145+
".tox/**/site-packages/isic_challenge_scoring/",
146+
]
147+
148+
[tool.coverage.report]
149+
skip_empty = true

0 commit comments

Comments
 (0)