Skip to content

Commit

Permalink
Merge pull request #637 from VisLab/develop
Browse files Browse the repository at this point in the history
Updated the tests to account for missing HED column
  • Loading branch information
VisLab authored Feb 7, 2025
2 parents 75ddefe + a005a9f commit efa43b4
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/Appendix_B.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ general explanation of sidecar requirements.
(WARNING)

**a.** A value in a categorical column does not have an expected entry in a sidecar.
**b.** A {ref} in a sidecar does not correspond to a column in the associated tabular file.

**Note:** This warning is only triggered if the categorical column in which the value
appears does have HED annotations.
Expand Down
136 changes: 136 additions & 0 deletions tests/javascriptTests.json
Original file line number Diff line number Diff line change
Expand Up @@ -4422,6 +4422,14 @@
"HED": "(Item-count/#, {response_time})"
}
},
{
"event_code": {
"HED": {
"face": "{HED}",
"ball": "Red"
}
}
},
{
"event_code": {
"HED": {
Expand Down Expand Up @@ -4545,6 +4553,36 @@
"n/a"
]
]
},
{
"sidecar": {
"event_code": {
"HED": {
"face": "{HED}",
"ball": "Red"
}
}
},
"events": [
[
"onset",
"duration",
"response_time",
"event_code"
],
[
4.5,
0,
3.4,
"face"
],
[
5.0,
0,
6.8,
"ball"
]
]
}
]
}
Expand Down Expand Up @@ -5068,6 +5106,104 @@
}
}
},
{
"error_code": "SIDECAR_KEY_MISSING",
"alt_codes": [],
"name": "sidecar-refers-to-missing-tsv-hed-column",
"description": "(Warning) A sidecar uses a {HED} column which does not appear in the corresponding tsv file.",
"warning": true,
"schema": "8.3.0",
"definitions": [
"(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))",
"(Definition/MyColor, (Label/Pie))"
],
"tests": {
"string_tests": {
"fails": [],
"passes": []
},
"sidecar_tests": {
"fails": [],
"passes": [
{
"event_code": {
"HED": {
"face": "{HED}",
"ball": "Red"
}
}
}
]
},
"event_tests": {
"fails": [],
"passes": []
},
"combo_tests": {
"fails": [
{
"sidecar": {
"event_code": {
"HED": {
"face": "{HED}",
"ball": "Red"
}
}
},
"events": [
[
"onset",
"duration",
"event_code"
],
[
4.5,
0,
"face"
],
[
5.0,
0,
"ball"
]
]
}
],
"passes": [
{
"sidecar": {
"event_code": {
"HED": {
"face": "{HED}",
"ball": "Red"
}
}
},
"events": [
[
"onset",
"duration",
"event_code",
"HED"
],
[
4.5,
0,
"face",
"Green"
],
[
5.0,
0,
"ball",
"Black"
]
]
}
]
}
}
},
{
"error_code": "STYLE_WARNING",
"alt_codes": [],
Expand Down
24 changes: 24 additions & 0 deletions tests/json_tests/SIDECAR_BRACES_INVALID.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,14 @@
"HED": "(Item-count/#, {response_time})"
}
},
{
"event_code": {
"HED": {
"face": "{HED}",
"ball": "Red"
}
}
},
{
"event_code": {
"HED": {
Expand Down Expand Up @@ -387,6 +395,22 @@
[ 5.2, 0, "n/a", "face", ""],
[ 5.5, 0, "7,3", "face", "n/a"]
]
},
{
"sidecar": {
"event_code": {
"HED": {
"face": "{HED}",
"ball": "Red"
}
}
},
"events":
[
["onset", "duration", "response_time", "event_code"],
[ 4.5, 0, 3.4, "face"],
[ 5.0, 0, 6.8, "ball"]
]
}
]
}
Expand Down
103 changes: 103 additions & 0 deletions tests/json_tests/SIDECAR_KEY_MISSING.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,108 @@
]
}
}
},
{
"error_code": "SIDECAR_KEY_MISSING",
"alt_codes": [],
"name": "sidecar-refers-to-missing-tsv-hed-column",
"description": "(Warning) A sidecar uses a {HED} column which does not appear in the corresponding tsv file.",
"warning": true,
"schema": "8.3.0",
"definitions": [
"(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))",
"(Definition/MyColor, (Label/Pie))"
],
"tests": {
"string_tests": {
"fails": [
],
"passes": [
]
},
"sidecar_tests": {
"fails": [
],
"passes": [
{
"event_code": {
"HED": {
"face": "{HED}",
"ball": "Red"
}
}
}
]
},
"event_tests": {
"fails": [
],
"passes": [
]
},
"combo_tests": {
"fails": [
{
"sidecar": {
"event_code": {
"HED": {
"face": "{HED}",
"ball": "Red"
}
}
},
"events": [
[
"onset",
"duration",
"event_code"
],
[
4.5,
0,
"face"
],
[
5.0,
0,
"ball"
]
]
}
],
"passes": [
{
"sidecar": {
"event_code": {
"HED": {
"face": "{HED}",
"ball": "Red"
}
}
},
"events": [
[
"onset",
"duration",
"event_code",
"HED"
],
[
4.5,
0,
"face",
"Green"
],
[
5.0,
0,
"ball",
"Black"
]
]
}
]
}
}
}
]

0 comments on commit efa43b4

Please sign in to comment.