Skip to content

Commit 2229e56

Browse files
committed
fix cubids validate --participant-label
1 parent 957080a commit 2229e56

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

cubids/cli.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,4 +1101,10 @@ def _main(argv=None):
11011101
options = _get_parser().parse_args(argv)
11021102
args = vars(options).copy()
11031103
args.pop("func")
1104+
1105+
# Automatically set validation_scope='subject' when --participant-label is provided
1106+
if "participant_label" in args and "validation_scope" in args:
1107+
if args["participant_label"]:
1108+
args["validation_scope"] = "subject"
1109+
11041110
options.func(**args)

cubids/workflows.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def validate(
180180
'subject' validates each subject separately.
181181
participant_label : :obj:`list` of :obj:`str` or None
182182
Filter the validation to only include the listed subjects.
183-
Only applies when validation_scope='subject'. Ignored for dataset-level validation.
183+
When provided, validation_scope is automatically set to 'subject' by the CLI.
184184
local_validator : :obj:`bool`
185185
Use the local bids validator.
186186
ignore_nifti_headers : :obj:`bool`
@@ -208,12 +208,7 @@ def validate(
208208
# Run directly from python using subprocess
209209
if validation_scope == "dataset":
210210
# run on full dataset
211-
# Note: participant_label is ignored for dataset-level validation
212-
if participant_label:
213-
logger.warning(
214-
"participant_label is ignored when validation_scope='dataset'. "
215-
"Use validation_scope='subject' to filter by participant."
216-
)
211+
# Note: participant_label is automatically ignored for dataset-level validation
217212
call = build_validator_call(
218213
str(bids_dir),
219214
local_validator,

0 commit comments

Comments
 (0)