Skip to content

Update pybids requirement from ~=0.18.1 to ~=0.19.0 #1414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies = [
"packaging", # for version string parsing
"pandas",
"psutil >= 5.4", # for sentry
"pybids ~= 0.18.1",
"pybids ~= 0.19.0",
"pyyaml",
"scikit-learn <= 1.6.1",
"scipy >= 1.14.0,<= 1.15.2", # nipype needs networkx, which needs scipy > 1.8.0
Expand Down
21 changes: 17 additions & 4 deletions xcp_d/utils/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,13 @@
f'Found files:\n\n{filenames}'
)

cohorts = [bold_file.entities.get('cohort') for bold_file in bold_data]
cohorts = [c for c in cohorts if c is not None]
if len(cohorts) > 1:
raise ValueError(f'Multiple cohorts found: {", ".join(cohorts)}')

Check warning on line 231 in xcp_d/utils/bids.py

View check run for this annotation

Codecov / codecov/patch

xcp_d/utils/bids.py#L231

Added line #L231 was not covered by tests

cohort = cohorts[0] if cohorts else None

if file_format == 'cifti':
# Select the appropriate volumetric space for the CIFTI template.
# This space will be used in the executive summary and T1w/T2w workflows.
Expand Down Expand Up @@ -254,13 +261,19 @@
f'No BOLD NIfTI or transforms found to allowed space ({volspace})'
)

queries['anat_to_template_xfm']['to'] = volspace
queries['template_to_anat_xfm']['from'] = volspace
volspace_cohort = volspace
if cohort:
volspace_cohort += f'+{cohort}'

Check warning on line 266 in xcp_d/utils/bids.py

View check run for this annotation

Codecov / codecov/patch

xcp_d/utils/bids.py#L266

Added line #L266 was not covered by tests
queries['anat_to_template_xfm']['to'] = volspace_cohort
queries['template_to_anat_xfm']['from'] = volspace_cohort
queries['anat_brainmask']['space'] = volspace
else:
volspace_cohort = queries['bold']['space']
if cohort:
volspace_cohort += f'+{cohort}'
# use the BOLD file's space if the BOLD file is a nifti.
queries['anat_to_template_xfm']['to'] = queries['bold']['space']
queries['template_to_anat_xfm']['from'] = queries['bold']['space']
queries['anat_to_template_xfm']['to'] = volspace_cohort
queries['template_to_anat_xfm']['from'] = volspace_cohort
queries['anat_brainmask']['space'] = queries['bold']['space']

# Grab the first (and presumably best) density and resolution if there are multiple.
Expand Down