Skip to content

Commit 3fe2597

Browse files
committed
fix type errors
1 parent 572b2df commit 3fe2597

File tree

4 files changed

+60
-5
lines changed

4 files changed

+60
-5
lines changed

kvasircapsuleloader/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def samples_by_class_by_patient(
6868
:return: _description_
6969
:rtype: Dict[FindingClass, Dict[str, List[KvasirCapsuleSample]]]
7070
"""
71-
S = {}
71+
S: Dict[FindingClass, Dict[str, List[KvasirCapsuleSample]]] = {}
7272
for sample in self.samples:
7373
if sample.finding_class not in S:
7474
S[sample.finding_class] = {}

kvasircapsuleloader/split.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ def save(self, path: Path):
126126
data = {
127127
"ratios": {**self._ratios},
128128
"seed": self._seed,
129-
"samples": {key: [] for key in self._ratios},
129+
"samples": {
130+
phase: [sample.filename for sample in self.samples[phase]]
131+
for phase in self._ratios
132+
},
130133
}
131-
for phase in self._ratios:
132-
for sample in self.samples[phase]:
133-
data["samples"][phase].append(sample.filename)
134134
with open(path, "w") as f:
135135
json.dump(data, f)

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ dependencies = [
1010
"click>=8.3.1",
1111
"mypy>=1.19.0",
1212
"pandas>=2.3.3",
13+
"pandas-stubs>=2.3.3.251201",
1314
"pillow>=12.0.0",
1415
"pytest>=9.0.2",
1516
"requests>=2.32.5",
1617
"ruff>=0.14.8",
1718
"torch>=2.9.1",
1819
"tqdm>=4.67.1",
20+
"types-requests>=2.32.4.20250913",
21+
"types-tqdm>=4.67.0.20250809",
1922
]

uv.lock

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)