Skip to content

Commit f4a6769

Browse files
committed
check validation DataFrame rows instead of columns
1 parent ea3d13f commit f4a6769

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cubids/workflows.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def _link_or_copy(src_path, dst_path):
184184
decoded_output = result.stdout.decode("UTF-8")
185185
parsed_output = parse_validator_output(decoded_output)
186186

187-
if parsed_output.shape[1] > 1:
187+
if len(parsed_output) > 0:
188188
parsed_output["subject"] = subject
189189
return (subject, parsed_output)
190190
else:
@@ -255,7 +255,7 @@ def validate(
255255
parsed = parse_validator_output(ret.stdout.decode("UTF-8"))
256256

257257
# Determine if issues were found
258-
if parsed.shape[1] < 1:
258+
if len(parsed) < 1:
259259
logger.info("No issues/warnings parsed, your dataset is BIDS valid.")
260260
# Create empty DataFrame for consistent behavior with sequential mode
261261
parsed = pd.DataFrame()
@@ -331,7 +331,7 @@ def validate(
331331
for future in as_completed(future_to_subject):
332332
try:
333333
subject, result = future.result()
334-
if result is not None and result.shape[1] > 1:
334+
if result is not None and len(result) > 0:
335335
parsed.append(result)
336336
except Exception as exc:
337337
subject = future_to_subject[future]
@@ -342,7 +342,7 @@ def validate(
342342
# Sequential processing using the same helper as the parallel path
343343
for args in tqdm.tqdm(validation_args, desc="Validating subjects"):
344344
subject, result = _validate_single_subject(args)
345-
if result is not None and result.shape[1] > 1:
345+
if result is not None and len(result) > 0:
346346
parsed.append(result)
347347

348348
# concatenate the parsed data and exit

0 commit comments

Comments
 (0)