Skip to content

Commit

Permalink
linting/typing
Browse files Browse the repository at this point in the history
  • Loading branch information
bpinsard committed Jan 16, 2024
1 parent 4ca829d commit facaf5b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion heudiconv/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def prep_conversion(
custom_grouping=getattr(heuristic, "grouping", None),
# callable which will be provided dcminfo and returned
# structure extend seqinfo
custom_seqinfo = getattr(heuristic, 'custom_seqinfo', None),
custom_seqinfo=getattr(heuristic, 'custom_seqinfo', None),
)
elif seqinfo is None:
raise ValueError("Neither 'dicoms' nor 'seqinfo' is given")
Expand Down
3 changes: 2 additions & 1 deletion heudiconv/dicoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@


class CustomSeqinfoT(Protocol):
def __call__(self, wrapper: dw.Wrapper, series_files: list[str]) -> Hashable: ...
def __call__(self, wrapper: dw.Wrapper, series_files: list[str]) -> Hashable:
...


def create_seqinfo(
Expand Down
4 changes: 2 additions & 2 deletions heudiconv/heuristics/convertall.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import logging
from typing import Any, Optional
from typing import Optional

from heudiconv.dicoms import dw
from heudiconv.utils import SeqInfo
Expand All @@ -19,7 +19,7 @@ def create_key(
return (template, outtype, annotation_classes)


def custom_seqinfo(wrapper: dw.Wrapper, series_files: list[str], **kw: Any) -> tuple[str, str]:
def custom_seqinfo(wrapper: dw.Wrapper, series_files: list[str]) -> tuple[str, str]:
# Just a dummy demo for what custom_seqinfo could get/do
# for already loaded DICOM data, and including storing/returning
# the sample series file as was requested
Expand Down
1 change: 1 addition & 0 deletions heudiconv/tests/test_dicoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def test_custom_seqinfo() -> None:
assert len(seqinfo.custom) == 2
assert seqinfo.custom[1] == dcmfiles[0]


def test_get_datetime_from_dcm_from_acq_date_time() -> None:
typical_dcm = dcm.dcmread(
op.join(TESTS_DATA_PATH, "phantom.dcm"), stop_before_pixels=True
Expand Down

0 comments on commit facaf5b

Please sign in to comment.