Skip to content

Commit 41b22d7

Browse files
committed
Provide types for custom_seqinfo but disable type checking in the test -- I think mypy has deficiency since we do use kwargs and thus should be ok
1 parent ca48c66 commit 41b22d7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

heudiconv/heuristics/convertall_custom.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@
44
behavior of an already existing heuristic without complete rewrite. Such approach could be
55
useful for heuristic like reproin to overload mapping etc.
66
"""
7+
from __future__ import annotations
8+
9+
from typing import Any
10+
11+
import nibabel.nicom.dicomwrappers as dw
712

813
from .convertall import * # noqa: F403
914

1015

11-
def custom_seqinfo(series_files, wrapper, **kw): # noqa: U100
16+
def custom_seqinfo(
17+
series_files: list[str], wrapper: dw.Wrapper, **kw: Any # noqa: U100
18+
) -> tuple[str | None, str]:
1219
"""Demo for extracting custom header fields into custom_seqinfo field
1320
1421
Operates on already loaded DICOM data.

heudiconv/tests/test_dicoms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def test_custom_seqinfo() -> None:
108108

109109
seqinfos = group_dicoms_into_seqinfos(
110110
dcmfiles, "studyUID", flatten=True, custom_seqinfo=custom_seqinfo
111-
)
111+
) # type: ignore
112112

113113
seqinfo = list(seqinfos.keys())[0]
114114

0 commit comments

Comments
 (0)