Skip to content

Commit 08530bc

Browse files
committed
Fix integration test fixture ordering to avoid bids2table discovery issue
ds000114_func_derivatives now depends on ds000114_anat_derivatives directly instead of longitudinal_template_output. This ensures rbc functional runs before the template step writes ses-longitudinal files into the derivatives dir, avoiding a potential bids2table discovery issue where the ses-longitudinal anat files interfere with the functional pipeline's anat resolution. longitudinal_func_output depends on both ds000114_func_derivatives and longitudinal_template_output to ensure both cross-sectional functional outputs and the longitudinal template are present before rbc longitudinal functional runs.
1 parent a3e7707 commit 08530bc

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

tests/integration/longitudinal/conftest.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ def longitudinal_template_output(
149149
@pytest.fixture(scope="session")
150150
def ds000114_func_derivatives(
151151
ds000114_dataset: Path,
152-
longitudinal_template_output: Path,
152+
ds000114_anat_derivatives: Path,
153153
_runner: str,
154154
) -> Path:
155155
"""Run ``rbc functional`` on ds000114 sub-01 ses-test.
156156
157157
Produces cross-sectional functional derivatives (including raw
158158
regressor ``.1D`` files) that the longitudinal functional stage
159-
consumes. Writes into the same derivatives tree as the template
159+
consumes. Writes into the same derivatives tree as the anatomical
160160
stage so all outputs are visible to downstream fixtures.
161161
162162
Only ses-test is processed (one session is sufficient to exercise
@@ -166,9 +166,9 @@ def ds000114_func_derivatives(
166166
[
167167
"functional",
168168
str(ds000114_dataset),
169-
str(longitudinal_template_output),
169+
str(ds000114_anat_derivatives),
170170
"-o",
171-
str(longitudinal_template_output),
171+
str(ds000114_anat_derivatives),
172172
"--runner",
173173
_runner,
174174
"--participant-label",
@@ -179,19 +179,22 @@ def ds000114_func_derivatives(
179179
_TASK,
180180
],
181181
)
182-
return longitudinal_template_output
182+
return ds000114_anat_derivatives
183183

184184

185185
@pytest.fixture(scope="session")
186186
def longitudinal_func_output(
187187
ds000114_func_derivatives: Path,
188+
longitudinal_template_output: Path, # noqa: ARG001 — fixture dep for ordering
188189
_runner: str,
189190
) -> Path:
190191
"""Run ``rbc longitudinal functional`` on ds000114 sub-01 ses-test.
191192
192193
Produces longitudinal functional derivatives (warped BOLD,
193194
per-regressor regressed/cleaned BOLD) by consuming the
194195
cross-sectional functional outputs and the longitudinal template.
196+
Both ``ds000114_func_derivatives`` and ``longitudinal_template_output``
197+
write into the same derivatives directory, so all files are visible.
195198
"""
196199
_run_rbc(
197200
[

0 commit comments

Comments
 (0)