Skip to content

Commit

Permalink
Debugging circleci using new syntax for [email protected] with da…
Browse files Browse the repository at this point in the history
…taset_dir argument before all other arguments
  • Loading branch information
tientong98 committed Oct 7, 2024
1 parent 592ec5e commit 96f981b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
20 changes: 18 additions & 2 deletions cubids/tests/test_bond.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,11 +983,27 @@ def test_datalad_integration(tmp_path):
def test_validator(tmp_path):
"""Test validator."""
data_root = get_data(tmp_path)


# Ensure the dataset directory exists
dataset_dir = os.path.join(data_root, "complete")
# Debugging: Print the dataset_dir
print("Dataset dir:", dataset_dir)
print(os.listdir(dataset_dir))
if not os.path.exists(dataset_dir):
raise FileNotFoundError(f"Dataset directory does not exist: {dataset_dir}")

# test the validator in valid dataset
call = build_validator_call(str(data_root) + "/complete")
call = build_validator_call(dataset_dir)

# Debugging: Print the constructed command
print("Validator command:", call)

ret = run_validator(call)

# Print the output for debugging
print("Validator output:", ret.stdout.decode("UTF-8"))
print("Validator error:", ret.stderr.decode("UTF-8"))

assert ret.returncode == 0
parsed = parse_validator_output(ret.stdout.decode("UTF-8"))

Expand Down
10 changes: 8 additions & 2 deletions cubids/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ def build_validator_call(path, ignore_headers=False):
"""Build a subprocess command to the bids validator."""
# build docker call
# CuBIDS automatically ignores subject consistency.
command = ["bids-validator", "--verbose", "--json", "--ignoreSubjectConsistency"]

command = ["bids-validator", path, "--verbose", "--json", "--ignoreSubjectConsistency"]

if ignore_headers:
command.append("--ignoreNiftiHeaders")

command.append(path)
# command = ["bids-validator", "--verbose", "--json", "--ignoreSubjectConsistency"]

# if ignore_headers:
# command.append("--ignoreNiftiHeaders")

# command.append(path)

return command

Expand Down

0 comments on commit 96f981b

Please sign in to comment.