Skip to content

Commit d5a86a1

Browse files
committed
Debug: dump bids2table output for derivatives dir before rbc functional
1 parent 8f6e1a6 commit d5a86a1

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

tests/integration/longitudinal/conftest.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,21 @@ def ds000114_func_derivatives(
162162
Only ses-test is processed (one session is sufficient to exercise
163163
the longitudinal functional chain).
164164
"""
165-
# Debug: list derivatives tree before running rbc functional
166-
_tree = sorted(
167-
str(p.relative_to(ds000114_anat_derivatives))
168-
for p in ds000114_anat_derivatives.rglob("*")
169-
if p.is_file()
170-
)
171-
print( # noqa: T201
172-
f"\n--- derivatives tree before rbc functional "
173-
f"({ds000114_anat_derivatives}) ---\n"
174-
+ "\n".join(_tree)
175-
+ "\n--- end tree ---\n"
176-
)
165+
# Debug: dump bids2table output for derivatives dir
166+
import bids2table as b2t
167+
import polars as pl
168+
169+
_datasets = list(b2t.find_bids_datasets(ds000114_anat_derivatives))
170+
print(f"\n--- b2t datasets in {ds000114_anat_derivatives}: {_datasets} ---") # noqa: T201
171+
_tables = list(b2t.batch_index_dataset(_datasets, max_workers=0))
172+
for _t in _tables:
173+
_df = pl.DataFrame(pl.from_arrow(_t))
174+
_anat = _df.filter(pl.col("datatype") == "anat")
175+
print( # noqa: T201
176+
"b2t anat rows:",
177+
_anat.select(["sub", "ses", "suffix", "desc", "space"]).to_dicts(),
178+
)
179+
print("--- end b2t debug ---\n") # noqa: T201
177180
_run_rbc(
178181
[
179182
"functional",

0 commit comments

Comments
 (0)