Skip to content

Commit

Permalink
Provide types for custom_seqinfo but disable type checking in the tes…
Browse files Browse the repository at this point in the history
…t -- I think mypy has deficiency since we do use kwargs and thus should be ok
  • Loading branch information
yarikoptic committed Feb 28, 2024
1 parent ca48c66 commit 41b22d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion heudiconv/heuristics/convertall_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@
behavior of an already existing heuristic without complete rewrite. Such approach could be
useful for heuristic like reproin to overload mapping etc.
"""
from __future__ import annotations

from typing import Any

import nibabel.nicom.dicomwrappers as dw

from .convertall import * # noqa: F403


def custom_seqinfo(series_files, wrapper, **kw): # noqa: U100
def custom_seqinfo(
series_files: list[str], wrapper: dw.Wrapper, **kw: Any # noqa: U100
) -> tuple[str | None, str]:
"""Demo for extracting custom header fields into custom_seqinfo field
Operates on already loaded DICOM data.
Expand Down
2 changes: 1 addition & 1 deletion heudiconv/tests/test_dicoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_custom_seqinfo() -> None:

seqinfos = group_dicoms_into_seqinfos(
dcmfiles, "studyUID", flatten=True, custom_seqinfo=custom_seqinfo
)
) # type: ignore

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

Expand Down

0 comments on commit 41b22d7

Please sign in to comment.