Skip to content

Commit e8a04b1

Browse files
committed
rebase and tests
1 parent e5dd1af commit e8a04b1

3 files changed

Lines changed: 23 additions & 5 deletions

File tree

src/rbc/orchestration/longitudinal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def process_func(
105105

106106

107107
def run(
108-
input_dirs: Sequence[Path],
108+
input_dirs: list[Path],
109109
output_dir: Path,
110110
*,
111111
filters: Filters,

tests/unit/cli/test_longitudinal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def base_args(tmp_path: Path) -> argparse.Namespace:
2929
functional=False,
3030
tmp_dir=None,
3131
anat_template=None,
32+
regressor=["36-parameter"],
3233
)
3334

3435

tests/unit/orchestration/test_longitudinal.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def _mock_func_outputs(*, with_bold_mask: bool = True) -> Mock:
6868
m.bold = fake / "bold.nii.gz"
6969
m.forward_xfm = fake / "fwd_xfm.nii.gz"
7070
m.bold_mask = (fake / "bold_mask.nii.gz") if with_bold_mask else None
71+
m.regressed_bold = {"36-parameter": fake / "regressed.nii.gz"}
72+
m.cleaned_bold = {"36-parameter": fake / "cleaned.nii.gz"}
7173
return m
7274

7375

@@ -319,7 +321,12 @@ def test_calls_functional_longitudinal(
319321
),
320322
patch("rbc.bids.builder.shutil.copy2"),
321323
):
322-
process_func(pipe_ctx=pipe_ctx, func_df=func_df, tpl_df=tpl_df)
324+
process_func(
325+
pipe_ctx=pipe_ctx,
326+
func_df=func_df,
327+
tpl_df=tpl_df,
328+
regressors=["36-parameter"],
329+
)
323330
assert mock_func.call_count == 1
324331

325332
@pytest.mark.parametrize(
@@ -359,7 +366,12 @@ def test_missing_required_file_raises(
359366
),
360367
pytest.raises(FileNotFoundError),
361368
):
362-
process_func(pipe_ctx=pipe_ctx, func_df=func_df, tpl_df=tpl_df)
369+
process_func(
370+
pipe_ctx=pipe_ctx,
371+
func_df=func_df,
372+
tpl_df=tpl_df,
373+
regressors=["36-parameter"],
374+
)
363375

364376
def test_optional_bold_mask_file_not_found(
365377
self, func_df: pl.DataFrame, tpl_df: pl.DataFrame, tmp_path: Path
@@ -377,8 +389,13 @@ def test_optional_bold_mask_file_not_found(
377389
),
378390
patch("rbc.bids.builder.shutil.copy2") as mock_copy,
379391
):
380-
process_func(pipe_ctx=pipe_ctx, func_df=func_df, tpl_df=tpl_df)
381-
assert mock_copy.call_count == 3
392+
process_func(
393+
pipe_ctx=pipe_ctx,
394+
func_df=func_df,
395+
tpl_df=tpl_df,
396+
regressors=["36-parameter"],
397+
)
398+
assert mock_copy.call_count == 5
382399

383400

384401
class TestLongitudinalDispatch:

0 commit comments

Comments
 (0)