Skip to content

Commit

Permalink
rework example5 to have unsupported vocabs in data dict
Browse files Browse the repository at this point in the history
- example5 previously wasn't used anywhere and was conceptually a duplicate of example9
  • Loading branch information
alyssadai committed Dec 19, 2024
1 parent 4dc9f8b commit 75329c0
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 104 deletions.
4 changes: 2 additions & 2 deletions tests/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
| 2 | valid, unique `participant` and `session` IDs | same as example 1 | pass |
| 3 | same as example 2 | valid BIDS data dictionary, BUT: does not contain Neurobagel `"Annotations"` key | fail |
| 4 | valid, has additional columns not described in `.json` | same as example 1 | pass |
| 5 | valid, has additional unique value, not annotated in `.json` | same as example 1 | fail |
| 6 | valid, same as example 5. has assessment tool columns | valid, contains `"MissingValues"` attribute for categorical variable | pass |
| 5 | valid, has assessment tool columns | invalid, has TermURLs from unsupported vocabularies | fail |
| 6 | valid, same as example 5. | valid, contains `"MissingValues"` attribute for categorical variable | pass |
| invalid | valid, only exists to be used together with the (invalid) .json | invalid, missing the `"TermURL"` attribute for identifiers | fail |
| 7 | has fewer columns than are annotated in `.json` | same as example 1 | fail |
| 8 | valid, based on ex2 has multiple participant_id columns | valid, based on ex2 multiple participant_id column annotations | fail* |
Expand Down
88 changes: 0 additions & 88 deletions tests/data/example22.json

This file was deleted.

7 changes: 0 additions & 7 deletions tests/data/example22.tsv

This file was deleted.

45 changes: 44 additions & 1 deletion tests/data/example5.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,50 @@
"TermURL": "ncit:C94342",
"Label": "Healthy Control"
}
}
},
"MissingValues": ["OTHER"]
}
},
"tool_item1": {
"Description": "item 1 scores for an imaginary tool",
"Annotations": {
"IsAbout": {
"TermURL": "nb:Assessment",
"Label": "Assessment tool"
},
"IsPartOf": {
"TermURL": "unknownvocab:1234",
"Label": "Imaginary tool"
},
"MissingValues": ["missing"]
}
},
"tool_item2": {
"Description": "item 2 scores for an imaginary tool",
"Annotations": {
"IsAbout": {
"TermURL": "nb:Assessment",
"Label": "Assessment tool"
},
"IsPartOf": {
"TermURL": "unknownvocab:1234",
"Label": "Imaginary tool"
},
"MissingValues": ["missing"]
}
},
"other_tool_item1": {
"Description": "item 1 scores for a different imaginary tool",
"Annotations": {
"IsAbout": {
"TermURL": "nb:Assessment",
"Label": "Assessment tool"
},
"IsPartOf": {
"TermURL": "cogatlas:4321",
"Label": "A different imaginary tool"
},
"MissingValues": ["none"]
}
}
}
12 changes: 7 additions & 5 deletions tests/data/example5.tsv
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
participant_id session_id group
sub-01 ses-01 PAT
sub-01 ses-02 PAT
sub-02 ses-01 OTHER
sub-02 ses-02 CTRL
participant_id session_id group tool_item1 tool_item2 other_tool_item1
sub-01 ses-01 PAT 11.0 "missing" "none"
sub-01 ses-02 PAT "missing" 12.0 "none"
sub-02 ses-01 OTHER "missing" "missing" "none"
sub-02 ses-02 OTHER "missing" "missing" "none"
sub-03 ses-01 CTRL 10.0 8.0 "ok"
sub-03 ses-02 CTRL 10.0 8.0 "bad"
2 changes: 1 addition & 1 deletion tests/integration/test_cli_pheno.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_pheno_valid_inputs_run_successfully(
["do not have unique combinations of participant and session IDs"],
),
(
"example22",
"example5",
LookupError,
[
"unsupported vocabulary namespace prefixes",
Expand Down

0 comments on commit 75329c0

Please sign in to comment.