From 6c68652f2d607c374d2f1bdcb1db377592bb1af8 Mon Sep 17 00:00:00 2001 From: Kay Robbins <1189050+VisLab@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:40:30 -0500 Subject: [PATCH 1/2] A preliminary unit test based on JSON unit tests --- .github/workflows/ci.yml | 6 +- .gitignore | 2 +- spec_tests/jsonSpecificationTests.spec.js | 176 +++++++++++++++++++++ spec_tests/specifications.json | 177 ++++++++++++++++++++++ 4 files changed, 357 insertions(+), 4 deletions(-) create mode 100644 spec_tests/jsonSpecificationTests.spec.js create mode 100644 spec_tests/specifications.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3d8562e..c61cc753 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [master] + branches: '*' pull_request: - branches: [master] + branches: '*' jobs: Build: @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x, 21.x, 22.x] + node-version: [18.x, 22.x] steps: - name: Check out the code diff --git a/.gitignore b/.gitignore index f85ba989..b64fc448 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ node_modules .idea dist/ /venv/ -spec_tests/ + # Unit test / coverage reports htmlcov/ diff --git a/spec_tests/jsonSpecificationTests.spec.js b/spec_tests/jsonSpecificationTests.spec.js new file mode 100644 index 00000000..c03b5cd4 --- /dev/null +++ b/spec_tests/jsonSpecificationTests.spec.js @@ -0,0 +1,176 @@ +import chai from 'chai' +const assert = chai.assert +import { beforeAll, describe, afterAll } from '@jest/globals' + +import { buildSchemas } from '../validator/schema/init' + +import { SchemaSpec, SchemasSpec } from '../common/schema/types' +import { parseHedStrings } from '../parser/main' +import { validateHedEventWithDefinitions } from '../validator/event/init' +import { BidsSidecar } from '../bids/types/json' +import { BidsTsvFile } from '../bids/types/tsv' +import BidsHedSidecarValidator from '../bids/validator/bidsHedSidecarValidator' +import BidsHedTsvValidator from '../bids/validator/bidsHedTsvValidator' +import { parseDefinitions } from '../validator/dataset' +const fs = require('fs') +const path = require('path') + +const readFileSync = fs.readFileSync +let finalLog +let testInfo +let schemaMap +let schemaSpecsMap + +function defsToMap(defList) { + const defMap = {} + + defList.forEach((str, index) => { + defMap[`def${index + 1}`] = str + }) + if (defMap.size === 0) { + return {} + } + return { definitions: { HED: defMap } } +} + +function tsvToString(events) { + return events.map((row) => row.join('\t')).join('\n') +} +function bidsIssuesToStr(issues) { + // Convert a list of issue dictionaries into a string of the hedCode keys. + return issues.map((issue) => issue.hedIssue.hedCode).join(', ') +} + +function issuesToStr(issues) { + // Convert a list of issue dictionaries into a string of the hedCode keys. + return issues.map((dict) => dict.hedCode).join(', ') +} + +const loadTestData = () => { + const testFile = path.join(__dirname, 'specifications.json') + + // Read and parse the test file synchronously + const data = readFileSync(testFile, 'utf8') + testInfo = JSON.parse(data) +} + +// Load data before defining the tests +loadTestData() + +describe('HED', () => { + beforeAll(async () => { + schemaSpecsMap = {} + schemaMap = {} + finalLog = '' + await Promise.all( + testInfo.map(async (item) => { + if (!(item['schema'] in schemaMap)) { + const schemaFile = 'tests/data/HED' + item['schema'] + '.xml' + const schemaSpec = new SchemaSpec('', item['schema'], '', schemaFile) + const specs = new SchemasSpec().addSchemaSpec(schemaSpec) + schemaSpecsMap[item['schema']] = specs + schemaMap[item['schema']] = await buildSchemas(specs) + } + }), + ) + }) + + afterAll(() => { + console.log(finalLog) + }) + + test('should load testInfo correctly', () => { + expect(testInfo).toBeDefined() + }) + + // Define dynamic tests + testInfo.forEach((info) => { + test(`Tests ${info['error_code']}: ${info['name']}`, () => { + finalLog = finalLog + `Running test for ${info['error_code']}: ${info['name']}\n` + const hedSchemas = schemaMap[info['schema']] + const [parsedDefStrings] = parseHedStrings(info['definitions'], hedSchemas) + const [definitions, definitionIssues] = parseDefinitions(parsedDefStrings) + expect(definitionIssues).toHaveLength(0) + + const string_tests_passes = info['tests']['string_tests']['passes'] + string_tests_passes.forEach((str) => { + const [valid_strings] = validateHedEventWithDefinitions(str, hedSchemas, definitions) + assert.strictEqual(valid_strings, true, `${str} should be valid`) + }) + finalLog = finalLog + `\tValid string tests:\n\t\tpassed\n\tInvalid string tests:\n` + + const string_tests_fails = info['tests']['string_tests']['fails'] + string_tests_fails.forEach((str, index) => { + const [invalid_strings, string_fails_issues] = validateHedEventWithDefinitions(str, hedSchemas, definitions) + finalLog = finalLog + `\t\tstr[${index}] ${issuesToStr(string_fails_issues)}: ${str}\n` + assert.strictEqual(invalid_strings, false, `${str} should be invalid`) + }) + + const sidecar_tests_passes = info['tests']['sidecar_tests']['passes'] + sidecar_tests_passes.forEach((sidecar, index) => { + const bidsSide = new BidsSidecar(`sidecar: ${index}`, sidecar, null) + const sideVal = new BidsHedSidecarValidator(bidsSide, hedSchemas) + const sidecarIssues = sideVal.validate() + expect(sidecarIssues).toHaveLength(0) + }) + finalLog = finalLog + `\tValid sidecar tests:\n\t\tpassed\n\tInvalid sidecar tests:\n` + + const sidecar_tests_fails = info['tests']['sidecar_tests']['fails'] + sidecar_tests_fails.forEach((sidecar, index) => { + const bidsSide = new BidsSidecar(`sidecar: ${index}`, sidecar, null) + const sideVal = new BidsHedSidecarValidator(bidsSide, hedSchemas) + const sidecarIssues = sideVal.validate() + finalLog = finalLog + `\t\tsidecar[${index}] ${bidsIssuesToStr(sidecarIssues)} \n` + expect(sidecarIssues.length).toBeGreaterThan(0) + }) + + const event_tests_passes = info['tests']['event_tests']['passes'] + event_tests_passes.forEach((events, index) => { + const eventString = tsvToString(events) + const defDict = defsToMap(info['definitions']) + const bidsTsv = new BidsTsvFile(`events: ${index}`, eventString, null, [], defDict) + const eventsVal = new BidsHedTsvValidator(bidsTsv, hedSchemas) + const eventsIssues = eventsVal.validate() + expect(eventsIssues).toHaveLength(0) + }) + finalLog = finalLog + `\tValid events tests:\n\t\tpassed\n\tInvalid events tests:\n` + + const event_tests_fails = info['tests']['event_tests']['fails'] + event_tests_fails.forEach((events, index) => { + const eventString = tsvToString(events) + const defDict = defsToMap(info['definitions']) + const bidsTsv = new BidsTsvFile(`events: ${index}`, eventString, null, [], defDict) + const eventsVal = new BidsHedTsvValidator(bidsTsv, hedSchemas) + const eventsIssues = eventsVal.validate() + finalLog = finalLog + `\t\tevents[${index}] ${bidsIssuesToStr(eventsIssues)} \n` + expect(eventsIssues.length).toBeGreaterThan(0) + }) + + const combo_tests_passes = info['tests']['combo_tests']['passes'] + combo_tests_passes.forEach((item, index) => { + const eventString = tsvToString(item['events']) + const defDict = defsToMap(info['definitions']) + const sidecarDict = item['sidecar'] + const mergedJson = { ...sidecarDict, ...defDict } + const bidsTsv = new BidsTsvFile(`events: ${index}`, eventString, null, [], mergedJson) + const eventsVal = new BidsHedTsvValidator(bidsTsv, hedSchemas) + const eventsIssues = eventsVal.validate() + expect(eventsIssues).toHaveLength(0) + }) + finalLog = finalLog + `\tValid combo tests:\n\t\tpassed\n\tInvalid combo tests:\n` + + const combo_tests_fails = info['tests']['combo_tests']['fails'] + combo_tests_fails.forEach((item, index) => { + const eventString = tsvToString(item['events']) + const defDict = defsToMap(info['definitions']) + const sidecarDict = item['sidecar'] + const mergedJson = { ...sidecarDict, ...defDict } + const bidsTsv = new BidsTsvFile(`events: ${index}`, eventString, null, [], mergedJson) + const eventsVal = new BidsHedTsvValidator(bidsTsv, hedSchemas) + const eventsIssues = eventsVal.validate() + finalLog = finalLog + `\t\tevents[${index}] ${bidsIssuesToStr(eventsIssues)} \n` + expect(eventsIssues.length).toBeGreaterThan(0) + }) + }) + }) +}) diff --git a/spec_tests/specifications.json b/spec_tests/specifications.json new file mode 100644 index 00000000..e4acfcd0 --- /dev/null +++ b/spec_tests/specifications.json @@ -0,0 +1,177 @@ +[ + { + "error_code": "COMMA_MISSING", + "name": "comma-missing-tag-groups", + "description": "Two tag groups are not separated by commas: (A, B)(C, D).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Red, Blue)(Green, (Yellow))", "(Def/MyColor, Onset)(Def/Acc/3.5 m-per-s^2)"], + "passes": ["(Red, Blue), (Green, (Yellow))", "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue)(Green, (Yellow))", + "ball": "(Def/MyColor, Onset)(Def/Acc/3.5 m-per-s^2)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, ( Yellow))", + "ball": "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red, Blue)(Green, (Yellow))"], + [5.5, 0, "(Def/MyColor, Onset)(Def/Acc/3.5 m-per-s^2)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red, Blue), (Green, (Yellow))"], + [5.5, 0, "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue)(Green, (Yellow))", + "ball": "(Def/MyColor, Onset)(Def/Acc/3.5 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"], + [6.0, 0, "n/a", "(Blue, Green)(Blue, Red)"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, ( Yellow))", + "ball": "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "(Green, Def/MyColor),(Red)"] + ] + } + ] + } + } + }, + { + "error_code": "COMMA_MISSING", + "name": "comma-missing-tag-and-group", + "description": "A tag and a tag group are not separated by commas: A(B,D).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Red, Blue(Green, (Yellow))", "(Def/MyColor, Onset)Def/Acc/3.5 m-per-s^2"], + "passes": ["Red, (Green, (Yellow))", "(Def/MyColor, Onset),Def/Acc/3.5 m-per-s^2"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red(Green, (Yellow))", + "ball": "(Def/MyColor, Onset)Def/Acc/3.5 m-per-s^2" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red, (Green, (Yellow))", + "ball": "(Def/MyColor, Onset),Def/Acc/3.5 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red(Green, (Yellow))"], + [5.5, 0, "(Def/MyColor, Onset)Def/Acc/3.5 m-per-s^2"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Green, (Yellow))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red(Green, (Yellow))", + "ball": "(Def/MyColor, Onset)Def/Acc/3.5 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"], + [6.0, 0, "n/a", "(Green, Yellow)Red"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red, (Green, (Yellow))", + "ball": "(Def/MyColor, Onset),Def/Acc/3.5 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + } +] From 5024d713920496c6b53606770eb9a120730c05a1 Mon Sep 17 00:00:00 2001 From: Kay Robbins <1189050+VisLab@users.noreply.github.com> Date: Tue, 13 Aug 2024 08:13:09 -0500 Subject: [PATCH 2/2] Updated before reorganizing into describe sub-blocks --- .codespellrc | 2 +- .gitignore | 2 +- spec_tests/jsonSpecificationTests.spec.js | 30 +- spec_tests/nonschema_tests.json | 7770 +++++++++++++++++++++ spec_tests/short_tests.json | 5217 ++++++++++++++ 5 files changed, 13012 insertions(+), 9 deletions(-) create mode 100644 spec_tests/nonschema_tests.json create mode 100644 spec_tests/short_tests.json diff --git a/.codespellrc b/.codespellrc index 2b9e82ac..84a3e08e 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,3 +1,3 @@ [codespell] skip = datasets,.git,*.pdf,*.svg,deprecated,*.xml,*.mediawiki,*.omn,datasets -ignore-words-list = covert,hed,recuse +ignore-words-list = covert,hed,recuse,afterAll diff --git a/.gitignore b/.gitignore index b64fc448..ba2e0363 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ node_modules .idea dist/ /venv/ - +spec_tests/*.txt # Unit test / coverage reports htmlcov/ diff --git a/spec_tests/jsonSpecificationTests.spec.js b/spec_tests/jsonSpecificationTests.spec.js index c03b5cd4..14675ed0 100644 --- a/spec_tests/jsonSpecificationTests.spec.js +++ b/spec_tests/jsonSpecificationTests.spec.js @@ -17,10 +17,13 @@ const path = require('path') const readFileSync = fs.readFileSync let finalLog +let badLog let testInfo let schemaMap let schemaSpecsMap +const test_file_name = 'nonschema_tests.json' + function defsToMap(defList) { const defMap = {} @@ -47,7 +50,7 @@ function issuesToStr(issues) { } const loadTestData = () => { - const testFile = path.join(__dirname, 'specifications.json') + const testFile = path.join(__dirname, test_file_name) // Read and parse the test file synchronously const data = readFileSync(testFile, 'utf8') @@ -59,12 +62,14 @@ loadTestData() describe('HED', () => { beforeAll(async () => { + jest.setTimeout(100000) schemaSpecsMap = {} schemaMap = {} finalLog = '' + badLog = '' await Promise.all( testInfo.map(async (item) => { - if (!(item['schema'] in schemaMap)) { + if (!(item['schema'] in schemaSpecsMap)) { const schemaFile = 'tests/data/HED' + item['schema'] + '.xml' const schemaSpec = new SchemaSpec('', item['schema'], '', schemaFile) const specs = new SchemasSpec().addSchemaSpec(schemaSpec) @@ -73,10 +78,14 @@ describe('HED', () => { } }), ) + finalLog = `Schemas: [ ${Object.keys(schemaMap).join(', ')} ]\n\n` }) afterAll(() => { - console.log(finalLog) + const outlog = path.join(__dirname, 'test_log.txt') + fs.writeFileSync(outlog, finalLog, 'utf8') + const outbad = path.join(__dirname, 'test_badlog.txt') + fs.writeFileSync(outbad, badLog, 'utf8') }) test('should load testInfo correctly', () => { @@ -93,10 +102,17 @@ describe('HED', () => { expect(definitionIssues).toHaveLength(0) const string_tests_passes = info['tests']['string_tests']['passes'] - string_tests_passes.forEach((str) => { - const [valid_strings] = validateHedEventWithDefinitions(str, hedSchemas, definitions) + string_tests_passes.forEach((str, index) => { + const [valid_strings, string_passes_issues] = validateHedEventWithDefinitions(str, hedSchemas, definitions) + + if (!valid_strings) { + badLog = + badLog + + `[${info['error_code']}: ${info['name']}]\n\tstr[${index}] ${str} should be valid by threw ${issuesToStr(string_passes_issues)}` + } assert.strictEqual(valid_strings, true, `${str} should be valid`) }) + finalLog = finalLog + `\tValid string tests:\n\t\tpassed\n\tInvalid string tests:\n` const string_tests_fails = info['tests']['string_tests']['fails'] @@ -106,7 +122,7 @@ describe('HED', () => { assert.strictEqual(invalid_strings, false, `${str} should be invalid`) }) - const sidecar_tests_passes = info['tests']['sidecar_tests']['passes'] + /* const sidecar_tests_passes = info['tests']['sidecar_tests']['passes'] sidecar_tests_passes.forEach((sidecar, index) => { const bidsSide = new BidsSidecar(`sidecar: ${index}`, sidecar, null) const sideVal = new BidsHedSidecarValidator(bidsSide, hedSchemas) @@ -170,7 +186,7 @@ describe('HED', () => { const eventsIssues = eventsVal.validate() finalLog = finalLog + `\t\tevents[${index}] ${bidsIssuesToStr(eventsIssues)} \n` expect(eventsIssues.length).toBeGreaterThan(0) - }) + })*/ }) }) }) diff --git a/spec_tests/nonschema_tests.json b/spec_tests/nonschema_tests.json new file mode 100644 index 00000000..7f553366 --- /dev/null +++ b/spec_tests/nonschema_tests.json @@ -0,0 +1,7770 @@ +[ + { + "error_code": "CHARACTER_INVALID", + "name": "character-invalid-utf-8", + "description": "The HED string contains a UTF-8 character.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Collection/[x]", "Description/This is a \u00ca\u00b0 bad character"], + "passes": ["Red, Blue, Description/Red"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "show": "Red, Label/a \u00ca\u00b0 bad" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "show": "Red, Label/Good" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label/a \u00ca\u00b0 bad"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label/Temp"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "show": "Red, Label/a \u00ca\u00b0 bad", + "ball": "Def/Acc/4.5 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "show", "Description/a \u00ca\u00b0 good"], + [5.0, 0, "ball", "Blue"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "show": "Red, Label/a" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "show", "Description/goodness"] + ] + } + ] + } + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "curly-braces-not-in-sidecar", + "description": "The curly brace notation is used outside of a sidecar.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["{col_1}, Red"], + "passes": ["Red, Blue, Description/Red"] + }, + "sidecar_tests": {}, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "{who_knows}, Red"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label/Temp"] + ] + ] + }, + "combo_tests": {} + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "invalid-character-name-value-class", + "description": "An invalid character was used in an 8.3.0 or greater style text value class.", + "schema": "8.3.0", + "tests": { + "string_tests": { + "fails": ["Parameter-label/[", "Parameter-label/Taco*"], + "passes": ["Parameter-label/Words"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "show": "Parameter-label/[" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": "Parameter-label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": {} + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "invalid-character-name-value-class-deprecated", + "description": "An invalid character was used in an 8.2.0 or lower style text value class.", + "schema": "8.2.0", + "tests": { + "string_tests": { + "fails": ["Parameter-label/[", "Parameter-label/Taco\u00c3\u201e"], + "passes": ["Parameter-label/Words", "Parameter-label/Taco*"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "show": "Parameter-label/[" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": "Parameter-label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": {} + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "invalid-character-numeric-class", + "description": "An invalid character was used in an 8.3.0 or greater style numeric value class.", + "schema": "8.3.0", + "tests": { + "string_tests": { + "fails": [ + "Weight/3.0$ kg", + "Weight/3.0db kg", + "Weight/3.0& kg", + "Weight/abc kg", + "Weight/*3.0 kg", + "Weight/3.0% kg", + "Weight/3.0^ kg", + "Weight/3.0? kg" + ], + "passes": [ + "Weight/3.0e10 kg", + "Weight/3e10 kg", + "Weight/3.0 kg", + "Weight/3000 kg", + "Weight/3e10 kg", + "Weight/3.5e10 kg", + "Weight/2.998e8 g", + "Weight/6.022e23 g", + "Weight/7.0e-10 g", + "Weight/1.6e-35 kg" + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "show": "Weight/3.0a" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": "Weight/# g" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": {} + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "invalid-character-name-class", + "description": "An invalid character was used in an 8.3.0 or greater style numeric value class.", + "schema": "8.3.0", + "tests": { + "string_tests": { + "fails": ["Label/30$", "Label/30db kg"], + "passes": ["Label/30e10", "Label/3e10asdf"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "show": "Label/3.0a" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": {} + } + }, + { + "error_code": "COMMA_MISSING", + "name": "comma-missing-tag-groups", + "description": "Two tag groups are not separated by commas: (A, B)(C, D).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Red, Blue)(Green, (Yellow))", "(Def/MyColor, Onset)(Def/Acc/3.5 m-per-s^2)"], + "passes": ["(Red, Blue), (Green, (Yellow))", "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue)(Green, (Yellow))", + "ball": "(Def/MyColor, Onset)(Def/Acc/3.5 m-per-s^2)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, ( Yellow))", + "ball": "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red, Blue)(Green, (Yellow))"], + [5.5, 0, "(Def/MyColor, Onset)(Def/Acc/3.5 m-per-s^2)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red, Blue), (Green, (Yellow))"], + [5.5, 0, "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue)(Green, (Yellow))", + "ball": "(Def/MyColor, Onset)(Def/Acc/3.5 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"], + [6.0, 0, "n/a", "(Blue, Green)(Blue, Red)"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, ( Yellow))", + "ball": "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "(Green, Def/MyColor),(Red)"] + ] + } + ] + } + } + }, + { + "error_code": "COMMA_MISSING", + "name": "comma-missing-tag-and-group", + "description": "A tag and a tag group are not separated by commas: A(B,D).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Red, Blue(Green, (Yellow))", "(Def/MyColor, Onset)Def/Acc/3.5 m-per-s^2"], + "passes": ["Red, (Green, (Yellow))", "(Def/MyColor, Onset),Def/Acc/3.5 m-per-s^2"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red(Green, (Yellow))", + "ball": "(Def/MyColor, Onset)Def/Acc/3.5 m-per-s^2" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red, (Green, (Yellow))", + "ball": "(Def/MyColor, Onset),Def/Acc/3.5 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red(Green, (Yellow))"], + [5.5, 0, "(Def/MyColor, Onset)Def/Acc/3.5 m-per-s^2"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Green, (Yellow))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red(Green, (Yellow))", + "ball": "(Def/MyColor, Onset)Def/Acc/3.5 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"], + [6.0, 0, "n/a", "(Green, Yellow)Red"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red, (Green, (Yellow))", + "ball": "(Def/MyColor, Onset),Def/Acc/3.5 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-tag-group", + "description": "A Definition tag does not appear in a tag group at the top level in an annotation.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Definition/Apple, (Blue)), ((Definition/Blech, (Red)))", "Definition/Blech, (Red)"], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue)), ((Definition/Blech, (Red)))", + "def2": "Definition/Blech, (Red)" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Blech, (Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue)), ((Definition/Blech, (Red)))", + "def2": "Definition/Blech, (Red)" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/MyColor, Def/Apple"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue))", + "def2": "(Definition/Blech, (Red))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/MyColor, Def/Apple"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-missing-inner-group", + "description": "A definition's enclosing tag group is missing the inner tag group (i.e., the definition's contents).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple)" + } + } + }, + { + "defs": { + "HED": { + "def2": "(Definition/Blech/#, ())" + } + } + } + ], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple), ((Definition/Blech, (Red)))", + "def2": "(Definition/Blech/#, ())" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/MyColor, Def/Apple"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue))", + "def2": "(Definition/Blech, (Red))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/MyColor, Def/Apple"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-multiple-definition-tags", + "description": "A definition's enclosing tag group contains more than a `Definition` tag and an inner group.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, Definition/Banana, (Blue))", + "def2": "(Definition/Blech, (Red), Definition/Banana1)", + "def3": "(Definition/Blech1, (Red), Blue)" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue))", + "def2": "((Red), Definition/Blech)" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, Definition/Banana, (Blue))", + "def2": "(Definition/Blech, (Red), Definition/Banana1)", + "def3": "(Definition/Blech1, (Red), Blue)" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple, Def/Banana"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue))", + "def2": "((Red), Definition/Blech)" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech, Def/Apple"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-inner-group-defs", + "description": "A definition's inner tag group contains `Definition`, `Def` or `Def-expand` tags.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Definition/Banana, Blue))", + "def2": "(Definition/Blech, (Red, Def/Apple))" + } + } + } + ], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label/a"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Definition/Banana, (Blue)))", + "def2": "(Definition/Blech, ((Red), Def/MyColor))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple, Def/Banana"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue))", + "def2": "((Red), Definition/Blech)" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech, Def/Apple"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-bad-number-of-placeholders", + "description": "A definition that includes a placeholder (`#`) does not have exactly two `#` characters.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#, Description/#))", + "def2": "(Definition/Blech/#, (Red))" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#))", + "def2": "(Definition/Blech/#, (Red, Label/#))" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#, Description/#))", + "def2": "(Definition/Blech/#, (Red))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple/3, Def/Blech/might"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#))", + "def2": "(Definition/Blech/#, (Red, Label/#))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech/5, Def/Apple/4"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-placeholder-incorrect-of-positions", + "description": "A definition has placeholders (`#`) in incorrect positions.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Label/#))", + "def2": "(Definition/Blech/#, (Red, #))" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Label/Blue))", + "def2": "(Definition/Blech/#, (Label/#, Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Label/#))", + "def2": "(Definition/Blech/#, (Red, #))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple, Def/Blech/might"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#))", + "def2": "(Definition/Blech/#, (Red, Label/#))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech/5, Def/Apple/4"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-placeholder-conflict", + "description": "Definitions of the same name appear with and without a `#`.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Label/#))", + "def2": "(Definition/Apple/#, (Red, #))" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Blech/#, (Label/#))", + "def2": "(Definition/Apple, (Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Label/#))", + "def2": "(Definition/Apple/#, (Red, #))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple/3, Def/Apple"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#))", + "def2": "(Definition/Blech, (Red))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech, Def/Apple/4"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-multiple-definitions", + "description": "Multiple `Definition` tags with same name are encountered.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#, Description/#))", + "def2": "(Definition/Apple/#, (Label/#))", + "def3": "(Definition/MyColor, (Blue))" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/ThisIsALabel, Description/#))", + "def2": "(Definition/Apple2/#, (Label/#))", + "def3": "(Definition/MyColor2, (Blue))" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#, Description/#))", + "def2": "(Definition/Apple/#, (Label/#))", + "def3": "(Definition/MyColor, (Blue))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple/3, Def/Blech/might"], + [5.0, 0, "Def/MyColor"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#))", + "def2": "(Definition/Blech/#, (Red, Label/#))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech/5, Def/Apple/4"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-has-unique-or-required-tag", + "description": "A tag with a required or unique attribute appears in a definition.", + "schema": "8.3.0", + "definitions": [ + "(Definition/Acc/#, (Acceleration/#, Red))", + "(Definition/MyColor, (Event-context, Item, (Label/Pie))" + ], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Event-context, Red))", + "def2": "(Definition/Banana/#, (Label/#))" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Red))", + "def2": "(Definition/Banana/#, (Label/#))" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Event-context, Red))", + "def2": "(Definition/Banana/#, (Label/#))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple, Def/Banana/might"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Red))", + "def2": "(Definition/Banana/#, (Label/#))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple, Def/Banana/might"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-not-allowed-here", + "description": "A definition appears in an unexpected place such as an events file or sidecar.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Item, (Label/Pie)))"], + "tests": { + "string_tests": { + "fails": ["Red, Blue, (Definition/myDef, (Label/Red, Blue))"], + "passes": ["Red, Blue"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red, Blue, (Definition/myDef, (Label/Red, Blue))", + "ball": "Def/Acc/4.5 m-per-s^2" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "face": "(Definition/myDef, (Label/Red, Blue)), (Definition/myDef2, (Label/Red, Blue))", + "ball": "(Definition/myDef1, (Label/Red, Blue))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Definition/myDef, (Label/Red, Green))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, Blue, Def/MyColor"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red, Blue, (Definition/myDef, (Label/Red, Blue))", + "ball": "Def/Acc/4.5 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/myDef, Red"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#))", + "def2": "(Definition/Blech/#, (Red, Label/#))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech/5, Def/Apple/4"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_EXPAND_INVALID", + "name": "def-expand-invalid-name-not-definition", + "description": "A `Def-expand` tag's name does not correspond to a definition.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Def-expand/Acc2/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "(Def-expand/MyColor2, (Label/Pie))" + ], + "passes": ["(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc2/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/MyColor2, (Label/Pie))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/MyColor, (Label/Pie))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc2/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "(Def-expand/MyColor2, (Label/Pie))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "(Def-expand/MyColor, (Label/Pie))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc2/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/MyColor2, (Label/Pie)))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"], + [5.0, 0, "ball", "(Def-expand/Junk, (Label/Red))"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/MyColor, (Label/Pie))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "(Def-expand/MyColor, (Label/Pie))"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_EXPAND_INVALID", + "name": "def-expand-invalid-missing-placeholder", + "description": "A `Def-expand` is missing an expected placeholder value or has an unexpected placeholder value.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Def-expand/Acc, (Acceleration, Red))", + "(Def-expand/Acc/4.5/3, (Acceleration, Red))", + "(Def-expand/MyColor/Blue, (Label/Pie))" + ], + "passes": [ + "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc, (Acceleration, Red))", + "ball": "(Def-expand/Acc/4.5/3, (Acceleration, Red))", + "circle": "(Def-expand/MyColor2/4, (Label/Pie))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc, (Acceleration, Red))"], + [5.5, 0, "(Def-expand/Acc/4.5/3, (Acceleration, Red))"], + [6.5, 0, "(Def-expand/MyColor2/4, (Label/Pie))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc, (Acceleration, Red))", + "ball": "(Def-expand/Acc/4.5/3, (Acceleration, Red))", + "circle": "(Def-expand/MyColor2/4, (Label/Pie))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", " (Def-expand/Acc, (Acceleration, Red))"], + [5.5, 0, "ball", "(Def-expand/Acc/4.5/3, (Acceleration, Red))"], + [5.6, 0, "circle", "(Def-expand/Acc/4.5/3, (Acceleration, Red))"], + [6.5, 0, "n/a", "(Def-expand/MyColor2/4, (Label/Pie))"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"], + [5.2, 0, "ball", "(Def-expand/MyColor, (Label/Pie))"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_EXPAND_INVALID", + "name": "def-expand-invalid-bad-placeholder-units", + "description": "A `Def-expand` has a placeholder value of incorrect format or units for definition.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Def-expand/Acc/Make-me, (Acceleration/Make-me, Red))", + "(Def-expand/Acc/4.5 m, (Acceleration/4.5 m, Red))", + "(Def-expand/Acc/4.5m-per-s^2, (Acceleration/4.5m-per-s^2, Red))" + ], + "passes": ["(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/Make-me, (Acceleration/Make-me, Red))", + "ball": "(Def-expand/Acc/4.5 m, (Acceleration/4.5 m, Red))", + "square": "(Def-expand/Acc/4.5m-per-s^2, (Acceleration/4.5m-per-s^2, Red))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/Make-me, (Acceleration/Make-me, Red))"], + [5.5, 0, "(Def-expand/Acc/4.5 m, (Acceleration/4.5 m, Red))"], + [6.3, 0, "(Def-expand/Acc/4.5m-per-s^2, (Acceleration/4.5m-per-s^2, Red))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/Make-me, (Acceleration/Make-me, Red))", + "ball": "(Def-expand/Acc/4.5 m, (Acceleration/4.5 m, Red))", + "square": "(Def-expand/Acc/4.5m-per-s^2, (Acceleration/4.5m-per-s^2, Red))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Def-expand/Acc/Make-me, (Acceleration/Make-me, Red))"], + [5.5, 0, "ball", "(Def-expand/Acc/4.5 m, (Acceleration/4.5 m, Red))"], + [6.3, 0, "square", "(Def-expand/Acc/4.5m-per-s^2, (Acceleration/4.5m-per-s^2, Red))"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Def-expand/Acc/5.5 m-per-s^2, (Acceleration/5.5 m-per-s^2, Red))"], + [5.5, 0, "ball", "(Def-expand/Acc/5.5 m-per-s^2, (Acceleration/5.5 m-per-s^2, Red))"], + [6.5, 0, "n/a", "n/a"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_EXPAND_INVALID", + "name": "def-expand-invalid-tags-not-in-definition", + "description": "The tags within a Def-expand do not match the corresponding definition.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/6, Red))", + "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Blue))", + "(Def-expand/MyColor, (Label/Cake))" + ], + "passes": ["(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/6, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Blue))", + "square": "(Def-expand/MyColor, (Label/Cake))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/6, Red))"], + [5.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Blue))"], + [6.3, 0, "(Def-expand/MyColor, (Label/Cake))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/6, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Blue))", + "square": "(Def-expand/MyColor, (Label/Cake)))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/6, Red))"], + [5.5, 0, "ball", "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Blue))"], + [6.3, 0, "square", "(Def-expand/MyColor, (Label/Cake))"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Def-expand/Acc/6.5 m-per-s^2, (Acceleration/6.5 m-per-s^2, Red))"], + [5.5, 0, "ball", "(Def-expand/Acc/8.5 m-per-s^2, (Acceleration/8.5 m-per-s^2, Red))"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_EXPAND_INVALID", + "name": "def-expand-missing-inner-group", + "description": "A Def-expand is missing its inner group containing the definition.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Item, (Label/Pie)))"], + "tests": { + "string_tests": { + "fails": ["(Def-expand/Acc/5.4 m-per-s^2)"], + "passes": ["(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, Red)", + "ball": "(Def-expand/Acc/4.5 m-per-s^2)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))", + "ball": "Red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, Red)"], + [5.4, 0, "(Def-expand/Acc/5.4 m-per-s^2)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2)", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Def/Acc, (Def-expand/Acc/4.5 m-per-s^2)"], + [5.4, 0, "n/a", "Green"], + [6.4, 0, "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))", + "ball": "(Acceleration/4.5 m-per-s^2, Blue), Def/MyColor" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "n/a"], + [6.5, 0, "ball", "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_EXPAND_INVALID", + "name": "def-expand-has-extras", + "description": "A Def-expand has extra tags or groups.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Item, (Label/Pie)))"], + "tests": { + "string_tests": { + "fails": [ + "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), Blue)", + "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), (Blue, Green), Black)" + ], + "passes": ["(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), Blue)", + "ball": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), (Blue, Green), Black)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))", + "ball": "Red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), Blue)"], + [5.4, 0, "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), (Blue, Green), Black)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), Blue)", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Def/Acc, (Def-expand/Acc/4.5 m-per-s^2)"], + [5.4, 0, "n/a", "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), Blue)"], + [6.4, 0, "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))", + "ball": "(Acceleration/4.5 m-per-s^2, Blue), Def/MyColor" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "n/a"], + [6.5, 0, "ball", "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_INVALID", + "name": "def-invalid-name", + "description": "A `Def` tag's name does not correspond to a definition.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Def/Apple2, Green", "Def/Acc2/4.5", "Def/Acc"], + "passes": ["Def/Acc/4.5 m-per-s^2"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def/Apple2, Green", + "ball": "Def/Acc2/4.5, Def/Acc/3.2 m-per-s^2" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Def/Acc/4.5 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple2, Green"], + [5.5, 0, "Def/Acc2/4.5 m-per-s^2"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/4.5 m-per-s^2"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Apple2, Green", + "ball": "Def/Acc2/4.5, Def/Acc/3.2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Def/Apple2, Green"], + [5.5, 0, "face", "Def/Acc2/4.5 m-per-s^2"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Acc/4.5 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_INVALID", + "name": "def-invalid-missing-placeholder", + "description": "A `Def` tag is missing an expected placeholder value or has an unexpected placeholder value.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Def/Acc, (Def/Acc/4.5 m-per-s^2, Red)", "Def/MyColor/Blue"], + "passes": ["Def/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def/Acc, (Def/Acc/4.5 m-per-s^2, Red)", + "ball": "(Def/MyColor/Blue, Green)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Def/Acc/4.5 m-per-s^2, Red", + "ball": "(Acceleration/4.5 m-per-s^2, Red), Def/MyColor" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc, (Def/Acc/4.5 m-per-s^2, Red)"], + [5.4, 0, "Def/MyColor/Blue, Green"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Acc, (Def/Acc/4.5 m-per-s^2, Red)", + "ball": "(Def/MyColor/Blue, Green)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Def/Acc, (Def/Acc/4.5 m-per-s^2, Red)"], + [5.4, 0, "n/a", "Def/MyColor/Blue, Green"], + [6.4, 0, "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Acc/4.5 m-per-s^2, Red", + "ball": "(Acceleration/4.5 m-per-s^2, Red), Def/MyColor" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Def/Acc/5.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)"], + [6.5, 0, "ball", "n/a"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_INVALID", + "name": "def-invalid-bad-placeholder-units", + "description": "A `Def` has a placeholder value of incorrect format or units for definition.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "Def/Acc/baloney, (Def/Acc/4.5 m-per-s^2, Red)", + "Def/Acc/3 m", + "Def/Acc/4m-per-s^2", + "Def/MyColor/Redish" + ], + "passes": ["Def/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def/Acc/baloney, (Def/Acc/4.5 m-per-s^2, Red)", + "ball": "Def/Acc/3 m", + "square": "Def/Acc/4m-per-s^2", + "triangle": "Def/MyColor/Redish" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def/Acc/4.5 m-per-s^2, Red)", + "ball": "Def/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/baloney, (Def/Acc/4.5 m-per-s^2, Red)"], + [5.0, 0, "Def/Acc/3 m"], + [6.3, 0, "Def/Acc/4m-per-s^2"], + [7.2, 0, "Def/MyColor/Redish"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Acc/baloney, (Def/Acc/4.5 m-per-s^2, Red)", + "ball": "Def/Acc/3 m", + "square": "Def/Acc/4m-per-s^2", + "triangle": "Def/MyColor/Redish" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Def/Acc/baloney, (Def/Acc/4.5 m-per-s^2, Red)"], + [5.0, 0, "face", "Def/Acc/3 m"], + [6.3, 0, "n/a", "Def/Acc/4m-per-s^2"], + [7.2, 0, "square", "Def/MyColor/Redish"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/Acc/4.5 m-per-s^2, Red)", + "ball": "Def/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "ELEMENT_DEPRECATED", + "name": "tag-deprecated", + "description": "A tag is deprecated", + "warning": true, + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Def/MyColor, Green, Gentalia", "Gentalia"], + "passes": ["Torso"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def/MyColor, Green, Gentalia", + "ball": "Green, Blue" + } + }, + "other_code": { + "HED": "Label/#, Gentalia" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Torso" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Gentalia, Green"], + [5.5, 0, "n/a"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Torso"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Gentalia", + "ball": "Green" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Blue"], + [5.5, 0, "face", "Red"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Torso", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "PARENTHESES_MISMATCH", + "name": "parentheses-mismatch-unmatched-parentheses", + "description": "A HED string does not have the same number of open and closed parentheses.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Def/MyColor, (Blue, (Yellow)), Red))", + "((Red, ((Blue, Green), Yellow))", + "((Red, ((Blue), Green)), (Yellow)" + ], + "passes": ["(Def/Acc/5.3 m-per-s^2, (Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def/MyColor, (Blue, (Yellow)), Red))", + "ball": "(Red, ((Blue, Green), Yellow))", + "square": "(Red, ((Blue), Green)), (Yellow)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def/Acc/5.3 m-per-s^2, (Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/MyColor, (Blue, (Yellow)), Red))"], + [5.5, 0, "(Red, ((Blue, Green), Yellow))"], + [6.3, 0, "(Red, ((Blue), Green)), (Yellow)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/Acc/5.3 m-per-s^2, (Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "Def/Acc/apple3, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "PARENTHESES_MISMATCH", + "name": "parentheses-mismatch-incorrect-nesting", + "description": "The open and closed parentheses are not correctly nested in the HED string.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Def/MyColor)), (Blue, (Yellow)), (Red)", ")(Def/MyColor)), (Blue, (Yellow)), (Red))"], + "passes": ["(Def/Acc/5.3 m-per-s^2, (Red))", "(((((Def/Acc/5.3 m-per-s^2, (Red))))))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def/MyColor)), (Blue, (Yellow)), (Red)", + "ball": ")(Def/MyColor)), (Blue, (Yellow)), (Red))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def/Acc/5.3 m-per-s^2, (Red))", + "ball": "(((((Def/Acc/5.3 m-per-s^2, (Red))))))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/MyColor)), (Blue, (Yellow)), (Red)"], + [5.5, 0, ")(Def/MyColor)), (Blue, (Yellow)), (Red))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/Acc/5.3 m-per-s^2, (Red))"], + [5.5, 0, "(((((Def/Acc/5.3 m-per-s^2, (Red))))))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor)), (Blue, (Yellow)), (Red)", + "ball": ")(Def/MyColor)), (Blue, (Yellow)), (Red))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "),Red, (((Def/MyColor)))"], + [5.0, 0, "ball", "(Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/Acc/5.3 m-per-s^2, (Red))", + "ball": "(((((Def/Acc/5.3 m-per-s^2, (Red))))))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, ((Def/MyColor))"] + ] + } + ] + } + } + }, + { + "error_code": "PLACEHOLDER_INVALID", + "name": "placeholder-invalid-misplaced", + "description": "A `#` appears in a place that it should not (such as in the `HED` column of an event file outside a definition).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Label/#", "Def/Acc/# m-per-s^2"], + "passes": ["Label/This-label"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Label/#", + "ball": "Def/Acc/# m-per-s^2" + } + } + } + ], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label/#"], + [5.0, 0, "Def/Acc/# m-per-s^2"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label/This-label"], + [6.0, 0, "(Def/Acc/3.5 m-per-s^2)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "Def/Acc/apple3, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/Acc/#"], + [5.0, 0, "ball", "Label/#"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "PLACEHOLDER_INVALID", + "name": "placeholder-invalid-#-in-categorical-column", + "description": "A JSON sidecar has a placeholder (`#`) in the HED dictionary for a categorical column.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Label/#", + "ball": "Def/Acc/# m-per-s^2" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Label/This-label", + "ball": "(Def/Acc/3.5 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Label/#", + "ball": "Def/Acc/#" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "PLACEHOLDER_INVALID", + "name": "placeholder-invalid-json-value-column", + "description": "A JSON sidecar does not have exactly one placeholder (`#`) in each HED string representing a value column.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "trial": { + "HED": "Def/Acc/# m-per-s^2, Label/#" + }, + "memory": { + "HED": "Blue, Red, Label/#" + } + } + ], + "passes": [ + { + "trial": { + "HED": "Def/Acc/# m-per-s^2" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "trial": { + "HED": "Def/Acc/#, Label/#" + }, + "memory": { + "HED": "Blue, Red, Label/#" + } + }, + "events": [ + ["onset", "duration", "trial", "memory", "HED"], + [4.5, 0, "3", "4", "Green, Def/MyColor"], + [5.0, 0, "2", "6", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "trial": { + "HED": "Def/Acc/#, Label/Trial" + }, + "memory": { + "HED": "Blue, Red, Label/#" + } + }, + "events": [ + ["onset", "duration", "trial", "memory", "HED"], + [4.5, 0, "5", "4", "Green"], + [5.0, 0, "3", "2", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "PLACEHOLDER_INVALID", + "name": "placeholder-invalid-json-#-misplaced", + "description": "A placeholder (`#`) is used in JSON sidecar or definition, but its parent in the schema does not have a placeholder child.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "trial": { + "HED": "Sensory-event/#" + }, + "defs": { + "def1": "(Definition/Blech/#, (Red, Blue/#))" + } + } + ], + "passes": [ + { + "trial": { + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "trial": { + "HED": "Sensory-event/#" + }, + "defs": { + "def1": "(Definition/Blech/#, (Red, Blue/#))" + } + }, + "events": [ + ["onset", "duration", "trial", "HED"], + [4.5, 0, "3", "Red, Def/MyColor"], + [5.0, 0, "2", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "trial": { + "HED": "Sensory-event, Label/#" + }, + "defs": { + "def1": "(Definition/Blech/#, (Red, Label/#))" + } + }, + "events": [ + ["onset", "duration", "trial", "HED"], + [4.5, 0, "3", "Blue"], + [5.0, 0, "2", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "REQUIRED_TAG_MISSING", + "name": "required-tag-missing", + "description": "An event-level annotation does not have a tag corresponding to a node with the `required` schema attribute. (Note this is deprecated so no tests.)", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + } + } + }, + { + "error_code": "REQUIRED_TAG_MISSING", + "name": "required-tag-in-definition", + "description": "A required tag appears in a definition", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + } + }, + "combo_tests": { + "fails": [], + "passes": [] + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-contents-invalid", + "description": "The item in curly braces is not the word HED or a column name with HED annotations in the sidecar.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description but no HED" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED", "response_time"], + [4.5, 0, "face", "Blue", 0], + [5.0, 0, "ball", "Green, Def/MyColor", 1], + [5.5, 0, "face", "", 2], + [5.7, 0, "face", "n/a", 3] + ] + } + ] + } + } + }, + { + "error_code": "VALUE_INVALID", + "name": "sidecar-braces-invalid-spot", + "description": "A curly brace reference must only appear where a tag could.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/Acc/{response_time})" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [], + "passes": [] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-circular-reference", + "description": "The item in curly braces has a HED annotation that contains curly braces.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), {HED}", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "HED": "Label/#, {event_code}" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), {HED}", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)", + "dog": "Orange, {event_type}" + } + }, + "response_time": { + "HED": "Label/#" + }, + "event_type": { + "HED": { + "banana": "Blue, {response_time}", + "apple": "Green" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + }, + "response_count": { + "Description": "A count used to test curly braces in value columns.", + "HED": "(Item-count/#, {response_time})" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2, {response_action})" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "response_time", "event_code", "HED"], + [4.5, 0, 3.4, "face", "Blue"], + [5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [5.2, 0, "n/a", "face", ""], + [5.5, 0, "any", "face", "n/a"] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-self-reference", + "description": "The item in curly braces has a HED annotation that contains itself.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), {HED}", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "HED": "Label/#, {response_time}" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + }, + "response_count": { + "Description": "A count used to test curly braces in value columns.", + "HED": "(Item-count/#, {response_time})" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2, {response_action})" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#, {response_time}" + } + }, + "events": [ + ["onset", "duration", "response_time", "event_code", "HED"], + [4.5, 0, 3.4, "face", "Blue"], + [5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [5.2, 0, "n/a", "face", ""], + [5.5, 0, "any", "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "response_time", "event_code", "HED"], + [4.5, 0, 3.4, "face", "Blue"], + [5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [5.2, 0, "n/a", "face", ""], + [5.5, 0, "any", "face", "n/a"] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-self-reference", + "description": "The item in curly braces has a HED annotation that contains itself.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), {HED}", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "HED": "Label/#, {response_time}" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + }, + "response_count": { + "Description": "A count used to test curly braces in value columns.", + "HED": "(Item-count/#, {response_time})" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2, {response_action})" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#, {response_time}" + } + }, + "events": [ + ["onset", "duration", "response_time", "event_code", "HED"], + [4.5, 0, 3.4, "face", "Blue"], + [5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [5.2, 0, "n/a", "face", ""], + [5.5, 0, "any", "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "response_time", "event_code", "HED"], + [4.5, 0, 3.4, "face", "Blue"], + [5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [5.2, 0, "n/a", "face", ""], + [5.5, 0, "any", "face", "n/a"] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-appear-as-value-rather-than-tag", + "description": "The curly braces are in a value rather than as a separate tag substitute.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "Label/{response_time}, Black" + } + }, + "response_time": { + "Description": "Has description but no HED", + "HED": "Orange" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "Label/{response_time}, Black" + } + }, + "response_time": { + "Description": "Has description but no HED", + "HED": "Label/#" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), ({response_time}, (Green, (Yellow)))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "Label/{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Orange" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"], + [5.2, 0, "face", ""], + [5.5, 0, "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED", "response_time"], + [4.5, 0, "face", "Blue", 1], + [5.0, 0, "ball", "Green, Def/MyColor", 1], + [5.2, 0, "face", "", 1], + [5.5, 0, "face", "n/a", 1] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-ref-not-hed-column", + "description": "Curly braces reference a column that exists, but isn't marked as hed data.", + "schema": "8.2.0", + "definitions": [], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{onset}" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Blue"] + ] + } + ], + "passes": [] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-ref-ignore-column", + "description": "Curly braces reference a column that exists, but is marked ignore.", + "schema": "8.2.0", + "definitions": [], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{onset}" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Blue"] + ] + } + ], + "passes": [] + } + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "sidecar-braces-in-events-file", + "description": "The curly braces appear in HED column of events file.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["{HED}, Def/MyColor"], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "{who_knows}, Red"] + ] + ], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue, {response_time}"], + [5.0, 0, "ball", "Green, Def/MyColor"], + [5.2, 0, "face", ""], + [5.5, 0, "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED", "response_time"], + [4.5, 0, "face", "Blue", 1], + [5.0, 0, "ball", "Green, Def/MyColor", 1], + [5.2, 0, "face", "", 1], + [5.5, 0, "face", "n/a", 1] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_INVALID", + "name": "sidecar-invalid-key-at-wrong-level", + "description": "The HED key is not a second-level dictionary key.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "temp": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset), (Def/Acc/3.5 m-per-s^2)" + } + } + }, + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset), (Def/Acc/3.5 m-per-s^2)" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "temp": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset), (Def/Acc/3.5 m-per-s^2)" + } + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + }, + { + "sidecar": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset), (Def/Acc/3.5 m-per-s^2)" + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, Def/MyColor"], + [5.0, 0, "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_INVALID", + "name": "sidecar-invalid-na-annotated", + "description": "An annotation entry is provided for `n/a`.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue),(Green, (Yellow))", + "n/a": "(Def/MyColor, Onset), (Def/Acc/3.5 m-per-s^2)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue),(Green, (Yellow))", + "n/a": "(Def/MyColor, Onset), (Def/Acc/3.5 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "n/a", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_KEY_MISSING", + "name": "sidecar-key-missing", + "description": "A value in a categorical column does not have an expected entry in a sidecar.", + "warning": true, + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "Def/Acc/apple3, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "square", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7 m-per-s^2, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "STYLE_WARNING", + "name": "style-warning-bad-naming-style", + "description": "An extension or label does not follow HED naming conventions.", + "warning": true, + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Red-color/red"], + "passes": ["Blue-color/Blue"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red/red_blech", + "ball": "Blue-color/blue" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red-color/Red", + "ball": "Blue-color/Blue" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red/red_blech"], + [5.0, 0, "Blue-color/blue"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red-color/Red"], + [5.0, 0, "Blue-color/Blue"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red/red_blech", + "ball": "Blue-color/blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red-color/Red", + "ball": "Blue-color/Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EMPTY", + "name": "tag-empty-extra-commas-or-parentheses", + "description": "A HED string has extra commas or parentheses separated by only white space.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "Red, , , Green", + "(, Red, Green), Blue", + "(Red, , Green), Blue", + "(Red, Green,), Blue", + "(Red, Green), Blue," + ], + "passes": ["(Red, Blue), Green"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "square": "Red, , , Green", + "test": "(, Red, Green), Blue", + "pine": "(Red, , Green), Blue", + "apple": "(Red, Green,), Blue" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red, Blue", + "ball": "Def/Acc/4.5 m-per-s^2, Def/Acc/3.2 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [5.5, 0, "Red, , , Green"], + [7.5, 0, "(, Red, Green), Blue"], + [8.2, 0, "(Red, , Green), Blue"], + [9.1, 0, "(Red, Green,), Blue"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Blue, Green)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "square": "Red, , , Green", + "test": "(, Red, Green), Blue", + "pine": "(Red, , Green), Blue", + "apple": "(Red, Green,), Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "test", "Red, Def/MyColor"], + [5.0, 0, "apple", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red, Green", + "ball": "Def/Acc/4.5 m-per-s^2, Def/Acc/3.2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EMPTY", + "name": "tag-empty-begin-end-comma", + "description": "A HED string begins or ends with a comma (ignoring white space).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [", Blue,Def/Acc/3.2 m-per-s^2", "(Blue, Green),Yellow,", ",,(Blue, Green),Yellow,"], + "passes": ["(Red, Blue), Green"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": ", Blue,Def/Acc/3.2 m-per-s^2", + "ball": "(Blue, Green),Yellow,", + "square": ",,(Blue, Green),Yellow," + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red, Blue", + "ball": "Def/Acc/4.5 m-per-s^2, Def/Acc/3.2 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, ", (Blue, Green),Yellow,"], + [5.5, 0, ",,(Blue, Green),Yellow,"], + [6.5, 0, ", Blue,Def/Acc/3.2 m-per-s^2"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Blue, Green)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": ", Blue,Def/Acc/3.2", + "ball": "(Blue, Green),Yellow,", + "square": ",,(Blue, Green),Yellow," + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EMPTY", + "name": "tag-empty-empty-parentheses", + "description": "A tag group is empty (i.e., empty parentheses are not allowed).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Red, (), (Blue), ((Green)))", "((( ))), Red"], + "passes": ["(Red, ( Blue ), ((Green)))", "(((Def/Acc/3.5 m-per-s^2)))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, (), (Blue), ((Green)))", + "ball": "((( ))), Red" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, ( Blue ), ((Green)))", + "ball": "(((Def/Acc/3.5 m-per-s^2)))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red, (), (Blue), ((Green)))"], + [5.5, 0, "((( ))), Red"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red, ( Blue ), ((Green)))"], + [5.5, 0, "(((Def/Acc/3.5 m-per-s^2)))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, (), (Blue), ((Green)))", + "ball": "((( ))), Red" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, ( Blue ), ((Green)))", + "ball": "(((Def/Acc/3.5 m-per-s^2)))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EXPRESSION_REPEATED", + "name": "tag-expression-repeated-same-level", + "description": "A tag is repeated in the same tag group or level.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "Red, (Blue), Red, Green", + "(Red, Blue, (Green)), (Red, Blue, (Green))", + "(Red, (Blue, Green, (Yellow)), Red, (Blue, Green, (Yellow)))" + ], + "passes": ["Red, (Blue, Red)", "(Red, Blue, (Green)), (Red, Blue, ((Green)))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red, (Blue), Red, Green", + "ball": "(Red, Blue, (Green)), (Red, Blue, (Green))", + "square": "(Red, (Blue, Green, (Yellow)), Red, (Blue, Green, (Yellow)))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red, (Blue, Red)", + "ball": "(Red, Blue, (Green)), (Red, Blue, ((Green)))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Blue), Red, Green"], + [5.5, 0, "(Red, Blue, (Green)), (Red, Blue, (Green))"], + [6.5, 0, "(Red, (Blue, Green, (Yellow)), Red, (Blue, Green, (Yellow)))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Blue, Red)"], + [5.5, 0, "(Red, Blue, (Green)), (Red, Blue, ((Green)))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red, (Blue), Red, Green", + "ball": "(Red, Blue, (Green)), (Red, Blue, (Green))", + "square": "(Red, (Blue, Green, (Yellow)), Red, (Blue, Green, (Yellow)))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red, (Blue, Red)", + "ball": "(Red, Blue, (Green)), (Red, Blue, ((Green)))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EXTENDED", + "name": "tag-extended-extension", + "description": "A tag represents an extension from the schema.", + "warning": true, + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Red-color/Red/Big-red, Blue/Nice-blue),(Green, (Yellow))", + "Sensory-presentation/Visual-presentation/Nice-yellow", + "Red-color/Red/Redish", + "Red-color/Red/Redish/More-redish", + "((Green/Greenish))", + "Red/1red", + "Red/Red--2red" + ], + "passes": ["Red-color/Red"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red-color/Red/Big-red, Blue/Nice-blue),(Green, (Yellow))", + "ball": "Sensory-presentation/Visual-presentation/Nice-yellow", + "square": "((Green/Greenish))", + "triangle": "Red/1red", + "catwalk": "Red/Red--2red" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red-color/Red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red-color/Red/Big-red, Blue/Nice-blue),(Green, (Yellow))"], + [5.5, 0, "Sensory-presentation/Visual-presentation/Nice-yellow"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red-color/Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red-color/Red/Big-red/Bigger-red, Blue/Nice-blue),(Green, (Yellow))", + "ball": "Sensory-presentation/Visual-presentation/Nice-yellow" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7 m-per-s^2, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EXTENSION_INVALID", + "name": "tag-extension-invalid-duplicate", + "description": "A tag extension term is already in the schema.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Red-color/Red/DarkRed, Sensory-presentation/Red", "Sensory-presentation/Red/Redish"], + "passes": ["Red-color/Red/Redish", "((Green/Greenish))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red-color/Red/DarkRed, Sensory-presentation/Red", + "ball": "Sensory-presentation/Red/Redish" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red-color/Red/Redish", + "ball": "((Green/Greenish))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red-color/Red/DarkRed, Sensory-presentation/Red"], + [5.5, 0, "Sensory-presentation/Red/Redish"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red-color/Red"], + [5.5, 0, "((Green))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red-color/Red/DarkRed, Sensory-presentation/Red", + "ball": "Sensory-presentation/Red/Redish" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red-color/Red", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EXTENSION_INVALID", + "name": "tag-extension-invalid-bad-node-name", + "description": "A tag extension term does not comply with rules for schema nodes.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Red/Red$2", "Red/R#d"], + "passes": ["Red-color/Red", "((Green))", "Red"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red/Red$2", + "ball": "Red/R#d" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red-color/Red/Redish", + "ball": "Red-color/Red/Redish/More-redish", + "square": "((Green/Greenish))", + "triangle": "Red/1red", + "catwalk": "Red/Red--2red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red/Red$2"], + [5.5, 0, "Red/R#d"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red-color/Red/Redish"], + [5.5, 0, "Red-color/Red/Redish/More-redish"], + [6.5, 0, "((Green/Greenish))"], + [7.5, 0, "Red/1red"], + [8.2, 0, "Red/Red--2red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red/Red$2", + "ball": "Red/R#d" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red/Redish-like", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_GROUP_ERROR", + "name": "tag-group-error-missing", + "description": "A tag has tagGroup or topLevelTagGroup attribute, but is not enclosed in parentheses.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "Definition, (Red)", + "Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)", + "Onset", + "Duration/3.0 s", + "Delay/3.0 s" + ], + "passes": [ + "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "((Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset)", + "(Duration/3.0 s, (Event))", + "(Duration/3.0 s, Delay/2.0 s, (Event))" + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "((Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)"], + [5.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "((Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_GROUP_ERROR", + "name": "tag-group-error-not-top-level", + "description": "A tag with the topLevelTagGroup does not appear at a HED tag group at the top level in an assembled HED annotation.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "((Def/Acc/3.0 m-per-s^2, Onset))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "(Def/Acc/3.0 m-per-s^2, Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_GROUP_ERROR", + "name": "multiple-top-level-tags-in-same-group", + "description": "Multiple tags with the topLevelTagGroup attribute appear in the same top-level tag group. (Delay and Duration are allowed to be in the same topLevelTagGroup).", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Def/MyColor, Onset, Event-context)", + "(Event-context, Red, Offset)", + "(Event-context, Duration/3.0 s, Offset)", + "(Delay/3.0 s, Duration/2.0 s, Offset)" + ], + "passes": ["(Def/MyColor, Onset)", "((Event), Duration/3.0 s, Delay/2.0 s)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "(Def/Acc/3.0 m-per-s^2, Onset, Event-context)" + } + } + }, + { + "event_code": { + "HED": { + "face": "Acceleration/5.0", + "ball": "Onset" + } + }, + "val_col": { + "HED": "Time-interval/# s, (Duration/5.0 s, {event_code})" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Acceleration/5.0)", + "ball": "Delay/5.0 s, (Acceleration/5.0)" + } + }, + "val_col": { + "HED": "Time-interval/# s, (Duration/5.0 s, {event_code})" + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Event-context, Def/MyColor, Onset)"], + [5.0, 0, "Green"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Event-context, Def/MyColor)"], + [5.0, 0, "Green"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "(Def/Acc/3.0 m-per-s^2, Onset, Event-context)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, (Def/MyColor, Event-context, Event-context)"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "(Def/Acc/3.0 m-per-s^2, Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue, (Event-context, Label/Red)"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_INVALID", + "name": "tag-invalid-in-schema", + "description": "The tag is not valid in the schema it is associated with.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Label #", "ReallyInvalid/Extension", "ReallyInvalid"], + "passes": ["Brown-color/Brown"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Label #", + "ball": "ReallyInvalid/Extension", + "square": "ReallyInvalid" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Brown-color/Brown" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label #"], + [5.5, 0, "Property/Sensory-event"], + [5.5, 0, "Sensory-event/Baloney"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Brown-color/Brown"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "ReallyInvalid", + "ball": "Property/Sensory-event", + "square": "Sensory-event/Baloney" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue/Apples" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_INVALID", + "name": "tag-has-extra-white space", + "description": "A HED tag has extra internal whitespace, including directly before or after slashes.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "Sensory- event,Green", + "Sensory -event,Blue", + "Event /Sensory-event, Black", + "Event/ Sensory-event,White" + ], + "passes": ["Sensory-event, Green"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "square": "Sensory- event,Green", + "test": "Sensory -event,Blue", + "pine": "Event /Sensory-event, Black", + "apple": "Event/ Sensory-event,White" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Sensory-event, Green", + "ball": "Def/Acc/4.5 m-per-s^2, Def/Acc/3.2 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [5.5, 0, "Sensory- event,Green"], + [7.5, 0, "Sensory -event,Blue"], + [8.2, 0, "Event /Sensory-event, Black"], + [9.1, 0, "Event/ Sensory-event,White"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Sensory-event, Green"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "square": "Sensory- event,Green", + "test": "Sensory -event,Blue", + "pine": "Event /Sensory-event, Black", + "apple": "Event/ Sensory-event,White" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "test", "Red, Def/MyColor"], + [5.0, 0, "apple", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": " Red, Green", + "ball": "Def/Acc/4.5 m-per-s^2, Def/Acc/3.2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_INVALID", + "name": "tag-has-leading-trailing-or-consecutive-slashes", + "description": "A HED tag has leading, trailing or consecutive slashes.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "/Event", + "Red/", + "Event//Sensory-event", + "//Event", + "Body-part/Head-part//Brain", + "Def/Acc/4.5//", + "Def/Acc/4.5/", + "/ /Def/Acc/4.5 ms/" + ], + "passes": ["Body-part/Head-part/Brain", "Label/Red, Informational-property/Label/Blue"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Event//Sensory-event", + "ball": "/Event", + "square": "Red/", + "test": "/ /Def/Acc/4.5 ms/" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Body-part/Head-part/Brain", + "ball": "Def/Acc/4.5 m-per-s^2, Def/Acc/3.2 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "/Event,"], + [5.5, 0, "Body-part/Head-part//Brain"], + [6.5, 0, "Event/Sensory-event/"], + [7.2, 0, "/ /Def/Acc/4.5 ms/"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Event/Sensory-event"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Event//Sensory-event", + "ball": "//Event", + "square": "Body-part/Head-part//Brain", + "test": "/ /Def/Acc/4.5 ms/" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red/, Def/MyColor"], + [5.0, 0, "ball", "Green"], + [7.2, 0, "n/a", "/ /Def/Acc/4.5 ms/"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Event/Sensory-event"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_NOT_UNIQUE", + "name": "tag-not-unique", + "description": "A tag with unique attribute appears more than once in an event-level HED string.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Event-context, (Red, Blue)), (Event-context, (Green, Yellow))"], + "passes": ["(Event-context, (Red, Blue))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Event-context, (Red, Blue)), (Event-context, (Green, Yellow))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Event-context, (Red, Blue))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Event-context, (Red, Blue)), (Event-context, (Green, Yellow))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Event-context, (Red, Blue))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Event-context, (Red, Blue)), (Event-context, (Green, Yellow))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Event-context, (Red, Blue))", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "(Event-context, (Red, Blue))"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_REQUIRES_CHILD", + "name": "tag-requires-child-no-child", + "description": "A tag has the requireChild schema attribute but does not have a child.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Blue, Description)", "Label, Red"], + "passes": ["(Blue, Description/Yes this is a description., (Red))", "Label/Redish, Red"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Blue, Description)", + "ball": "Label, Red" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Blue, Description/Yes this is a description., (Red))", + "ball": "Label/Redish, Red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Blue, Description)"], + [5.0, 0, "Label, Red"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Blue, Description/Yes this is a description., (Red))"], + [5.0, 0, "Label/Redish, Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Blue, Description)", + "ball": "Label, Red" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Label/Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-not-tag-group", + "description": "An Onset or Offset tag does not appear in a tag group.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Onset, Red", "Offset, Def/Acc/5.4 m-per-s^2"], + "passes": ["(Onset, Def/Acc/5.4 m-per-s^2)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Onset, Red", + "ball": "Offset, Def/Acc/5.4 m-per-s^2" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Onset, Def/Acc/5.4 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Onset, Red"], + [4.8, 0, "(Onset, MyColor)"], + [5.0, 0, "Offset, MyColor"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Onset, (Def-expand/MyColor, (Label/Pie)), (Red))"], + [5.5, 0, "(Onset, Def/Acc/5.4 m-per-s^2)"], + [6.3, 0, "(Offset, Def/Acc/5.4 m-per-s^2)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Onset, Red", + "ball": "Offset, Def/Acc/5.4 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Onset, Red"], + [4.8, 0, "n/a", "(Onset/MyColor)"], + [5.0, 0, "face", "Offset, MyColor"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Onset, Def/Acc/5.4 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [5.5, 0, "n/a", "(Onset, Def/Acc/5.4 m-per-s^2)"], + [6.3, 0, "n/a", "(Offset, Def/Acc/5.4 m-per-s^2)"], + [8.5, 0, "face", "Blue"], + [9.0, 0, "n/a", "Green, ((Def-expand/MyColor, (Label/Pie)), Onset)"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-nested-group", + "description": "An Onset or Offset tag appears in a nested tag group (not a top-level tag group).", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["((Onset, Def/MyColor), Red)"], + "passes": ["(Onset, Def/MyColor), Red"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "((Onset, Def/MyColor), Red)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor), Red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "((Onset, Def/MyColor), Red)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Onset, Def/MyColor), Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "((Onset, Def/MyColor), Red)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "n/a", "((Onset, Def/MyColor), Red)"], + [5.0, 0, "face", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor), Red" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "n/a", "(Onset, Def/MyColor), Red"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-wrong-number-of-defs", + "description": "An Onset or Offset tag is not grouped with exactly one Def-expand tag group or a Def tag.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Onset, (Red))"], + "passes": ["(Onset, Def/MyColor, (Red))", "(Onset, (Def-expand/MyColor, (Label/Pie)), (Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Onset, (Red))", + "ball": "(Onset, Def/MyColor, Def/Acc/4.3 m-per-s^2)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor, (Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Onset, (Red))"], + [5.5, 0, "(Onset, Def/MyColor, Def/Acc/4.3 m-per-s^2)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Onset, Def/MyColor, (Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Onset, (Red))", + "ball": "(Onset, Def/MyColor, Def/Acc/4.3 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Green, Def/MyColor"], + [5.0, 0, "n/a", "(Onset, (Yellow))"], + [6.0, 0, "ball", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor, (Red))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "n/a", "(Onset, Def/MyColor, (Blue))"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-onset-has-more-groups", + "description": "An Onset group has more than one additional tag group.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Onset, Def/MyColor, (Red), (Blue))", "((Def-expand/MyColor, (Label/Pie)), (Green), (Red), Onset)"], + "passes": ["(Onset, Def/MyColor)", "((Def-expand/MyColor, (Label/Pie)), (Red), Onset)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor, (Red), (Blue))", + "ball": "((Def-expand/MyColor, (Label/Pie)), (Green), (Yellow), Onset)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor)", + "ball": "((Def-expand/MyColor, (Label/Pie)), (Green, (Yellow)), Onset)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Onset, Def/MyColor, (Red), (Blue))"], + [5.5, 0, "((Def-expand/MyColor, (Label/Pie)), (Green), ((Yellow)), Onset)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Onset, Def/MyColor)"], + [5.0, 0, "((Def-expand/MyColor, (Label/Pie)), (Green, (Yellow)), Onset)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "((Def-expand/MyColor, (Label/Pie)), (Green), ((Yellow)), Onset)", + "ball": "(Onset, Def/MyColor, (Red), (Blue))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"], + [6.0, 0, "n/a", "(Def/MyColor, (Red), (Blue), Onset)"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor)", + "ball": "((Def-expand/MyColor, (Label/Pie)), (Green, (Yellow)), Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "n/a", "((Def-expand/MyColor, (Label/Pie)), (Green, (Yellow)), Onset)"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-offset-has-groups", + "description": "An Offset appears with one or more tags or additional tag groups.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Offset, Def/MyColor, Red)", "((Def-expand/MyColor, (Label/Pie)), Offset, (Red))"], + "passes": ["(Offset, Def/MyColor)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor)", + "ball": "((Def-expand/MyColor, (Label/Pie)), Onset)", + "square": "(Offset, Def/MyColor, (Red))", + "circle": "((Def-expand/MyColor, (Label/Pie)), Offset, Blue)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor)", + "ball": "((Def-expand/MyColor, (Label/Pie)), Onset)", + "square": "(Offset, Def/MyColor)", + "circle": "((Def-expand/MyColor, (Label/Pie)), Offset)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Onset, Def/MyColor)"], + [4.8, 0, "(Offset, Def/MyColor, (Red))"], + [4.9, 0, "(Onset, Def/MyColor, (Red))"], + [5.5, 0, "((Def-expand/MyColor, (Label/Pie)), (Green), Offset)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Onset, Def/MyColor)"], + [4.8, 0, "(Offset, Def/MyColor)"], + [4.9, 0, "(Onset, Def/MyColor, (Red))"], + [5.5, 0, "((Def-expand/MyColor, (Label/Pie)), Offset)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor)", + "ball": "((Def-expand/MyColor, (Label/Pie)), Onset)", + "square": "(Offset, Def/MyColor, (Red))", + "circle": "((Def-expand/MyColor, (Label/Pie)), Offset, Blue)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "n/a"], + [4.8, 0, "square", "n/a"], + [4.9, 0, "ball", "Green"], + [5.5, 0, "((Def-expand/MyColor, (Label/Pie)), Offset, Blue)", "Orange"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor)", + "ball": "((Def-expand/MyColor, (Label/Pie)), Onset)", + "square": "(Offset, Def/MyColor)", + "circle": "((Def-expand/MyColor, (Label/Pie)), Offset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "n/a"], + [4.8, 0, "square", "n/a"], + [4.9, 0, "ball", "Green"], + [5.5, 0, "((Def-expand/MyColor, (Label/Pie)), Offset, Blue)", "Orange"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-mismatch", + "description": "An Offset tag associated with a given definition appears after a previous Offset tag without the appearance of an intervening Onset of the same name.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/MyColor, Offset)"], + [6.5, 0, "Red, (Def/MyColor, Offset)"], + [5.5, 0, "(Def/MyColor, Offset)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/MyColor, Onset)"], + [5.5, 0, "(Def/MyColor, Offset)"], + [6.5, 0, "Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, Onset)", + "ball": "(Def/MyColor, Offset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Red, Blue"], + [4.8, 0, "ball", "Red, Blue"], + [5.0, 0, "face", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, Onset)", + "ball": "(Def/MyColor, Offset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-extra tags", + "description": "An Onset tag group with has tags besides the anchor Def or Def-expand that are not in a tag group.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Def/MyColor, Blue, Green, Onset)"], + "passes": ["(Def/MyColor, (Blue), Onset)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def/MyColor, Blue, Green, Onset)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def/MyColor, (Blue), Onset)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/MyColor, Blue, (Green), Onset)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/MyColor, (Blue), Onset)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, Blue, Green, Onset)", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "((Blue, Green), Def/MyColor, Onset)", + "ball": "(Def/Acc/7, Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-duplicated-onset-or-offset", + "description": "An Onset or an Offset with a given Def or Def-expand anchor appears in the same event marker with another Onset or Offset that uses the same anchor.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, (Green), Onset)", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Def/MyColor, (Blue), Onset)"], + [5.0, 0, "ball", "Green"] + ] + }, + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, (Green), Onset)", + "ball": "(Def/MyColor, Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Def/MyColor, Offset)"], + [5.0, 0, "ball", "(Def/MyColor, Offset)"] + ] + }, + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, (Green), Onset)", + "ball": "(Def/MyColor, Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Def/MyColor, Offset)"], + [5.0, 0, "ball", "(Def/MyColor, Offset)"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "((Blue, Green), Def/MyColor, Onset)", + "ball": "(Def/MyColor, Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-inset-outside-its-event", + "description": "An Inset tag is not grouped with a Def or Def-expand of an ongoing Onset.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Inset, (Red))"], + [6.5, 0, "Red, (Def/MyColor, Offset)"], + [5.5, 0, "(Def/MyColor, Offset)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/MyColor, Onset)"], + [5.5, 0, "(Def/MyColor, Offset)"], + [6.5, 0, "Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, Onset)", + "ball": "(Def/MyColor, Offset)", + "snack": "(Def/MyColor, Inset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "snack", "Red, Blue"], + [4.8, 0, "face", "Red, Blue"], + [5.0, 0, "face", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, Onset)", + "ball": "(Def/MyColor, Offset)", + "snack": "(Def/MyColor, Inset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [4.8, 0, "snack", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-inset-group-has-extras", + "description": "An Inset group has tags or groups in addition to its defining Def or Def-expand.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [2.5, 0, "Red, (Def/MyColor, Onset)"], + [4.5, 0, "(Def/MyColor, Blue, Inset)"], + [6.5, 0, "Red, (Def/MyColor, Onset)"], + [5.5, 0, "(Def/MyColor, Offset)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/MyColor, (Blue), Onset)"], + [4.8, 0, "(Def/MyColor, (Green), Inset)"], + [5.5, 0, "(Def/MyColor, Offset)"], + [6.5, 0, "Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, Onset)", + "ball": "(Def/MyColor, Offset)", + "snack": "(Def/MyColor, Inset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "snack", "Red, Blue"], + [4.8, 0, "face", "Red, Blue"], + [5.0, 0, "face", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, Onset)", + "ball": "(Def/MyColor, Offset)", + "snack": "(Def/MyColor, Inset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [4.7, 0, "face", "Blue"], + [4.8, 0, "snack", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-duration-group", + "description": "An Inset group has tags or groups in addition to its defining Def or Def-expand.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Duration/3.0 s, Delay/2.0 s, (Green), (Blue))", + "(Duration/3.0 s, (Green), (Blue))", + "(Delay/3.0 s, (Green), (Blue))" + ], + "passes": ["(Duration/3.0 s, Delay/2.0 s, (Blue))", "(Duration/3.0 s, (Blue))", "(Delay/3.0 s, (Blue))"] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [5.0, 0, "(Duration/3.0 s, Delay/2.0 s)"], + [5.5, 0, "(Duration/3.0 s, Delay/2.0 s, Event)"], + [6.0, 0, "(Duration/3.0 s, Delay/2.0 s, (Green), (Blue))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "((Blue), Duration/3.0 s)"], + [4.8, 0, "((Green), Delay/2.0 s)"], + [5.0, 0, "((Green), Duration/3.0 s, Delay/2.0 s)"] + ] + ] + }, + "combo_tests": { + "fails": [], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Duration/3.0 s, (Event))", + "ball": "(Delay/3.0 s, (Event))", + "snack": "(Duration/3.0 s, Delay/2.0 s, (Event))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [4.7, 0, "face", "Blue"], + [4.8, 0, "snack", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-tag-appears-where-not-allowed", + "description": "An Inset, Offset, or Onset tag appears in a tsv with no onset column", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["duration", "HED"], + [0, "Red, (Def/MyColor, Onset)"], + [0, "(Def/MyColor, Yellow, Inset)"], + [0, "Red, (Def/MyColor, Onset)"], + [0, "(Def/MyColor, Offset)"] + ] + ], + "passes": [ + [ + ["duration", "HED"], + [0, "(Def/MyColor, (Blue))"], + [0, "(Def/MyColor, (Green))"], + [0, "(Def/MyColor)"], + [0, "Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, Onset)", + "ball": "(Def/MyColor, Offset)", + "snack": "(Def/MyColor, Inset)" + } + } + }, + "events": [ + ["event_code", "HED"], + ["face", "Def/MyColor, Red, Blue"], + ["ball", "Def/MyColor, Red, Blue"], + ["snack", "Green"] + ] + }, + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, Duration)", + "ball": "(Def/MyColor, Delay)" + } + } + }, + "events": [ + ["event_code", "HED"], + ["face", "Def/MyColor, Red, Blue"], + ["ball", "Def/MyColor, Red, Blue"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor)", + "ball": "(Def/MyColor)", + "snack": "(Def/MyColor)" + } + } + }, + "events": [ + ["event_code", "HED"], + ["face", "Blue"], + ["face", "Blue"], + ["snack", "Blue"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-not-tag-group-delay", + "description": "An Onset or Offset tag does not appear in a tag group.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Onset, Red", "Offset, Def/Acc/5.4 m-per-s^2"], + "passes": ["(Onset, Def/Acc/5.4 m-per-s^2)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Onset, Red", + "ball": "Delay/5.0 s, Offset, Def/Acc/5.4 m-per-s^2" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, Def/Acc/5.4 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Delay/1.0 s, Onset, Red"], + [4.8, 0, "(Onset, MyColor)"], + [5.0, 0, "Delay/1.0 s, Offset, MyColor"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Onset, (Def-expand/MyColor, (Label/Pie)), (Red))"], + [5.5, 0, "(Delay/5.0 s, Onset, Def/Acc/5.4 m-per-s^2)"], + [6.3, 0, "(Delay/5.0 s, Offset, Def/Acc/5.4 m-per-s^2)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Onset, Red", + "ball": "Delay/5.0 s, Offset, Def/Acc/5.4 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Onset, Red"], + [4.8, 0, "n/a", "(Onset/MyColor)"], + [5.0, 0, "face", "Offset, MyColor"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Onset, Delay/5.0 s, Def/Acc/5.4 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [5.5, 0, "n/a", "(Onset, Delay/5.0 s, Def/Acc/5.4 m-per-s^2)"], + [6.3, 0, "n/a", "(Offset, Delay/5.0 s, Def/Acc/5.4 m-per-s^2)"], + [8.5, 0, "face", "Blue"], + [9.0, 0, "n/a", "Green, (Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Onset)"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-nested-group-delay", + "description": "An Onset or Offset tag appears in a nested tag group (not a top-level tag group).", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["((Delay/5.0 s, Onset, Def/MyColor), Red)"], + "passes": ["(Delay/5.0 s, Onset, Def/MyColor), Red"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "((Delay/5.0 s, Onset, Def/MyColor), Red)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, Def/MyColor), Red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "((Delay/5.0 s, Onset, Def/MyColor), Red)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Onset, Def/MyColor), Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "((Delay/5.0 s, Onset, Def/MyColor), Red)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "n/a", "((Delay/5.0 s, Onset, Def/MyColor), Red)"], + [5.0, 0, "face", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, Def/MyColor), Red" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "n/a", "(Delay/5.0 s, Onset, Def/MyColor), Red"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-wrong-number-of-defs-delay", + "description": "An Onset or Offset tag is not grouped with exactly one Def-expand tag group or a Def tag.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Delay/5.0 s, Onset, (Red))"], + "passes": [ + "(Delay/5.0 s, Onset, Def/MyColor, (Red))", + "(Delay/5.0 s, Onset, (Def-expand/MyColor, (Label/Pie)), (Red))" + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, (Red))", + "ball": "(Delay/5.0 s, Onset, Def/MyColor, Def/Acc/4.3 m-per-s^2)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, Def/MyColor, (Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Onset, (Red))"], + [5.5, 0, "(Delay/5.0 s, Onset, Def/MyColor, Def/Acc/4.3 m-per-s^2)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Onset, Def/MyColor, (Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, (Red))", + "ball": "(Delay/5.0 s, Onset, Def/MyColor, Def/Acc/4.3 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Green, Def/MyColor"], + [5.0, 0, "n/a", "(Delay/5.0 s, Onset, (Yellow))"], + [6.0, 0, "ball", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, Def/MyColor, (Red))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "n/a", "(Delay/5.0 s, Onset, Def/MyColor, (Blue))"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-onset-has-more-groups-delay", + "description": "An Onset group has more than one additional tag group.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Delay/5.0 s, Onset, Def/MyColor, (Red), (Blue))", + "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), (Green), (Red), Onset)" + ], + "passes": [ + "(Delay/5.0 s, Onset, Def/MyColor)", + "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), (Red), Onset)" + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, Def/MyColor, (Red), (Blue))", + "ball": "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), (Green), (Yellow), Onset)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, Def/MyColor)", + "ball": "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), (Green, (Yellow)), Onset)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Onset, Def/MyColor, (Red), (Blue))"], + [5.5, 0, "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), (Green), ((Yellow)), Onset)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Onset, Def/MyColor)"], + [5.0, 0, "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), (Green, (Yellow)), Onset)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), (Green), ((Yellow)), Onset)", + "ball": "(Delay/5.0 s, Onset, Def/MyColor, (Red), (Blue))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"], + [6.0, 0, "n/a", "(Delay/5.0 s, Def/MyColor, (Red), (Blue), Onset)"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, Def/MyColor)", + "ball": "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), (Green, (Yellow)), Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "n/a", "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), (Green, (Yellow)), Onset)"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-offset-has-groups-delay", + "description": "An Offset appears with one or more tags or additional tag groups.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Delay/5.0 s, Offset, Def/MyColor, Red)", + "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Offset, (Red))" + ], + "passes": ["(Delay/5.0 s, Offset, Def/MyColor)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, Def/MyColor)", + "ball": "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Onset)", + "square": "(Delay/5.0 s, Offset, Def/MyColor, (Red))", + "circle": "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Offset, Blue)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, Def/MyColor)", + "ball": "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Onset)", + "square": "(Delay/5.0 s, Offset, Def/MyColor)", + "circle": "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Offset)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Onset, Def/MyColor)"], + [4.8, 0, "(Delay/5.0 s, Offset, Def/MyColor, (Red))"], + [4.9, 0, "(Delay/5.0 s, Onset, Def/MyColor, (Red))"], + [5.5, 0, "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), (Green), Offset)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Onset, Def/MyColor)"], + [4.8, 0, "(Delay/5.0 s, Offset, Def/MyColor)"], + [4.9, 0, "(Delay/5.0 s, Onset, Def/MyColor, (Red))"], + [5.5, 0, "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Offset)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, Def/MyColor)", + "ball": "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Onset)", + "square": "(Delay/5.0 s, Offset, Def/MyColor, (Red))", + "circle": "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Offset, Blue)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "n/a"], + [4.8, 0, "square", "n/a"], + [4.9, 0, "ball", "Green"], + [5.5, 0, "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Offset, Blue)", "Orange"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Onset, Def/MyColor)", + "ball": "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Onset)", + "square": "(Delay/5.0 s, Offset, Def/MyColor)", + "circle": "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Offset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "n/a"], + [4.8, 0, "square", "n/a"], + [4.9, 0, "ball", "Green"], + [5.5, 0, "(Delay/5.0 s, (Def-expand/MyColor, (Label/Pie)), Offset, Blue)", "Orange"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-mismatch-delay", + "description": "An Offset tag associated with a given definition appears after a previous Offset tag without the appearance of an intervening Onset of the same name.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Def/MyColor, Offset)"], + [6.5, 0, "Red, (Delay/5.0 s, Def/MyColor, Offset)"], + [5.5, 0, "(Delay/5.0 s, Def/MyColor, Offset)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Def/MyColor, Offset)"], + [5.5, 0, "(Def/MyColor, Onset)"], + [6.5, 0, "Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Def/MyColor, Onset)", + "ball": "(Delay/5.0 s, Def/MyColor, Offset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Red, Blue"], + [4.8, 0, "ball", "Red, Blue"], + [5.0, 0, "face", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor, Onset)", + "ball": "(Delay/5.0 s, Def/MyColor, Offset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Blue"], + [5.0, 0, "face", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-extra tags-delay", + "description": "An Onset tag group with has tags besides the anchor Def or Def-expand that are not in a tag group.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Delay/5.0 s, Def/MyColor, Blue, Green, Onset)"], + "passes": ["(Delay/5.0 s, Def/MyColor, (Blue), Onset)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Def/MyColor, Blue, Green, Onset)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Def/MyColor, (Blue), Onset)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Def/MyColor, Blue, (Green), Onset)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Def/MyColor, (Blue), Onset)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Def/MyColor, Blue, Green, Onset)", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, (Blue, Green), Def/MyColor, Onset)", + "ball": "(Delay/5.0 s, Def/Acc/7, Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Blue"], + [5.0, 0, "face", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-duplicated-onset-or-offset-delay", + "description": "An Onset or an Offset with a given Def or Def-expand anchor appears in the same event marker with another Onset or Offset that uses the same anchor.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Def/MyColor, (Green), Onset)", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Delay/5.0 s, Def/MyColor, (Blue), Onset)"], + [5.0, 0, "ball", "Green"] + ] + }, + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Def/MyColor, (Green), Onset)", + "ball": "(Delay/5.0 s, Def/MyColor, Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Delay/5.0 s, Def/MyColor, Offset)"], + [5.0, 0, "ball", "(Delay/5.0 s, Def/MyColor, Offset)"] + ] + }, + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Def/MyColor, (Green), Onset)", + "ball": "(Delay/5.0 s, Def/MyColor, Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Delay/5.0 s, Def/MyColor, Offset)"], + [5.0, 0, "ball", "(Delay/5.0 s, Def/MyColor, Offset)"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, (Blue, Green), Def/MyColor, Onset)", + "ball": "(Delay/5.0 s, Def/MyColor, Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-inset-outside-its-event-delay", + "description": "An Inset tag is not grouped with a Def or Def-expand of an ongoing Onset.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Inset, (Red))"], + [6.5, 0, "Red, (Delay/5.0 s, Def/MyColor, Offset)"], + [5.5, 0, "(Delay/5.0 s, Def/MyColor, Offset)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Def/MyColor, Onset)"], + [5.5, 0, "(Delay/5.0 s, Def/MyColor, Offset)"], + [6.5, 0, "Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Def/MyColor, Onset)", + "ball": "(Delay/5.0 s, Def/MyColor, Offset)", + "snack": "(Delay/5.0 s, Def/MyColor, Inset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "snack", "Red, Blue"], + [4.8, 0, "face", "Red, Blue"], + [5.0, 0, "face", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/2.0 s, Def/MyColor, Onset)", + "ball": "(Delay/5.0 s, Def/MyColor, Offset)", + "snack": "(Def/MyColor, Inset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [1.5, 0, "face", "Blue"], + [4.8, 0, "ball", "Blue"], + [5.0, 0, "snack", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-inset-group-has-extras-delay", + "description": "An Inset group has tags or groups in addition to its defining Def or Def-expand.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [2.5, 0, "Red, (Delay/5.0 s, Def/MyColor, Onset)"], + [4.5, 0, "(Delay/5.0 s, Def/MyColor, Blue, Inset)"], + [6.5, 0, "Red, (Delay/5.0 s, Def/MyColor, Onset)"], + [5.5, 0, "(DDelay/5.0 s, ef/MyColor, Offset)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Delay/5.0 s, Def/MyColor, (Blue), Onset)"], + [4.8, 0, "(Delay/5.0 s, Def/MyColor, (Green), Inset)"], + [5.5, 0, "(Delay/5.0 s, Def/MyColor, Offset)"], + [6.5, 0, "Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Def/MyColor, Onset)", + "ball": "(Delay/5.0 s, Def/MyColor, Offset)", + "snack": "(Delay/5.0 s, Def/MyColor, Inset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "snack", "Red, Blue"], + [4.8, 0, "face", "Red, Blue"], + [5.0, 0, "face", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Def/MyColor, Onset)", + "ball": "(Delay/5.0 s, Def/MyColor, Offset)", + "snack": "(Delay/5.0 s, Def/MyColor, Inset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [4.7, 0, "face", "Blue"], + [4.8, 0, "snack", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-tag-appears-where-not-allowed-delay", + "description": "An Inset, Offset, or Onset tag appears in a tsv with no onset column", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["duration", "HED"], + [0, "Red, (Delay/5.0 s, Def/MyColor, Onset)"], + [0, "(Delay/5.0 s, Def/MyColor, Yellow, Inset)"], + [0, "Red, (Delay/5.0 s, Def/MyColor, Onset)"], + [0, "(Delay/5.0 s, Def/MyColor, Offset)"] + ] + ], + "passes": [ + [ + ["duration", "HED"], + [0, "(Def/MyColor, (Blue))"], + [0, "(Def/MyColor, (Green))"], + [0, "(Def/MyColor)"], + [0, "Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Def/MyColor, Onset)", + "ball": "(Delay/5.0 s, Def/MyColor, Offset)", + "snack": "(Delay/5.0 s, Def/MyColor, Inset)" + } + } + }, + "events": [ + ["event_code", "HED"], + ["face", "Def/MyColor, Red, Blue"], + ["ball", "Def/MyColor, Red, Blue"], + ["snack", "Green"] + ] + }, + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Delay/5.0 s, Def/MyColor, Duration)", + "ball": "(Delay/5.0 s, Def/MyColor, Delay)" + } + } + }, + "events": [ + ["event_code", "HED"], + ["face", "Def/MyColor, Red, Blue"], + ["ball", "Def/MyColor, Red, Blue"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor)", + "ball": "(Def/MyColor)", + "snack": "(Def/MyColor)" + } + } + }, + "events": [ + ["event_code", "HED"], + ["face", "Blue"], + ["face", "Blue"], + ["snack", "Blue"] + ] + } + ] + } + } + }, + { + "error_code": "TILDES_UNSUPPORTED", + "name": "tildes-unsupported", + "description": "The tilde syntax is no longer supported for any version of HED.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Red ~ Blue", "Red, Blue ~ Green ~ Yellow"], + "passes": ["Red, Blue"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red ~ Blue", + "ball": "Red, Blue ~ Green ~ Yellow" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red ~ Blue"], + [5.0, 0, "Red, Blue ~ Green ~ Yellow"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red, Blue), (Green, (Yellow))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red ~ Blue", + "ball": "Red, Blue ~ Green ~ Yellow" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Blue ~ Green ~ Yellow"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "UNITS_INVALID", + "name": "units-invalid-for-unit-class", + "description": "A tag has a value with units that are invalid or not of the correct unit class for the tag.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Def/Acc/3 s", "Weight/3 ms"], + "passes": ["Distance/4 km"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def/Acc/3 s", + "ball": "Weight/3 ms" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Distance/4 km", + "ball": "Angle/4 degrees" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/3 s"], + [5.5, 0, "Weight/3 ms"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Distance/4 km"], + [5.0, 0, "Angle/4 degrees"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Acc/3 s", + "ball": "Weight/3 ms" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "UNITS_INVALID", + "name": "units-invalid-si-units", + "description": "A unit modifier is applied to units that are not SI units.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Distance/3 kfeet", "Distance/3 kmeters"], + "passes": ["Distance/3 kilometres"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Distance/3 kfeet", + "ball": "Distance/3 kmeters" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Distance/3 kilometres" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Distance/3 kfeet"], + [5.0, 0, "Distance/3 kmeters"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Distance/3 kilometres"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Distance/3 kfeet", + "ball": "Distance/3 kmeters" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "UNITS_MISSING", + "name": "units-missing-on-node-with-unit-class", + "description": "A tag that takes value and has a unit class does not have units.", + "warning": true, + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Acceleration/4.5"], + "passes": ["Distance/4 km"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def/Acc/3", + "ball": "Acceleration/4.5" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Distance/4 km", + "ball": "Angle/4 degrees" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/3"], + [5.5, 0, "Acceleration/4.5"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Distance/4 km"], + [5.0, 0, "Angle/4 degrees"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Acc/3", + "ball": "Acceleration/4.5" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7 m-per-s^2, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "UNITS_MISSING", + "name": "units-missing-on-node-with-unit-class", + "description": "A tag that takes value and has a unit class does not have units.", + "warning": true, + "schema": "8.3.0", + "definitions": [], + "tests": { + "string_tests": { + "fails": ["Temperature/4.5"], + "passes": ["Temperature/4 oC"] + } + } + }, + { + "error_code": "VALUE_INVALID", + "name": "value-invalid-#-substitution", + "description": "The value substituted for a placeholder (`#`) is not valid.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Def/Acc/MyMy", "Distance/4mxxx", "Acceleration/banana"], + "passes": ["Def/Acc/3.4 m-per-s^2", "Distance/4 m"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def/Acc/MyMy", + "ball": "Distance/4mxxx" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Def/Acc/3.4 m-per-s^2", + "ball": "Distance/4 m" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/MyMy"], + [5.0, 0, "Distance/4mxxx"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/3.4 m-per-s^2"], + [5.0, 0, "Distance/4 m"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Acc/MyMy", + "ball": "Distance/4mxxx" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "VALUE_INVALID", + "name": "value-invalid-incompatible-value-class", + "description": "A tag value is incompatible with the specified value class.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Statistical-accuracy/1max1"], + "passes": ["Statistical-accuracy/0.677"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Statistical-accuracy/1max1" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Statistical-accuracy/0.677" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Statistical-accuracy/1max1"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Statistical-accuracy/0.677"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Statistical-accuracy/1max1" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "VALUE_INVALID", + "name": "value-invalid-value-class-missing", + "description": "A tag value with no value class is assumed to be a text and contains invalid characters.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Age/x123 asdf", "Def/Acc/apple3"], + "passes": ["Collection/This-collection"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Age/x123 asdf" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Collection/This-collection" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Age/x123 asdf"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Collection/This-collection"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "Def/Acc/apple3, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "VALUE_INVALID", + "name": "value-invalid-blank-missing", + "description": "The units are not separated from the value by a single blank.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Def/Acc/5m-per-s^2"], + "passes": ["Def/Acc/5 m-per-s^2"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def/Acc/5m-per-s^2" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Def/Acc/5 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/5m-per-s^2"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/5 m-per-s^2"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "Def/Acc/apple3, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "VALUE_INVALID", + "name": "value-invalid-#-value-class", + "description": "An extension or a value substituted for a `#` is not allowed by its value class.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Def/Acc/apple3, Blue", "Acceleration/banana"], + "passes": ["Acceleration/3.4 m-per-s^2", "Def/Acc/10.1 m-per-s^2"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "Def/Acc/apple3, Blue" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Acceleration/6.8 m-per-s^2", + "ball": "Def/Acc/5.433 m-per-s^2, Blue" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Acceleration/banana"], + [5.5, 0, "Def/Acc/apple3, Blue"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Acceleration/6.8 m-per-s^2"], + [5.5, 0, "Def/Acc/5.433 m-per-s^2, Blue"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "Def/Acc/apple3, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7 m-per-s^2, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + } +] diff --git a/spec_tests/short_tests.json b/spec_tests/short_tests.json new file mode 100644 index 00000000..205abc2f --- /dev/null +++ b/spec_tests/short_tests.json @@ -0,0 +1,5217 @@ +[ + { + "error_code": "CHARACTER_INVALID", + "name": "character-invalid-utf-8", + "description": "The HED string contains a UTF-8 character.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Collection/[x]", "Description/This is a \u00ca\u00b0 bad character"], + "passes": ["Red, Blue, Description/Red"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "show": "Red, Label/a \u00ca\u00b0 bad" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "show": "Red, Label/Good" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label/a \u00ca\u00b0 bad"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label/Temp"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "show": "Red, Label/a \u00ca\u00b0 bad", + "ball": "Def/Acc/4.5 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "show", "Description/a \u00ca\u00b0 good"], + [5.0, 0, "ball", "Blue"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "show": "Red, Label/a" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "show", "Description/goodness"] + ] + } + ] + } + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "curly-braces-not-in-sidecar", + "description": "The curly brace notation is used outside of a sidecar.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["{col_1}, Red"], + "passes": ["Red, Blue, Description/Red"] + }, + "sidecar_tests": {}, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "{who_knows}, Red"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label/Temp"] + ] + ] + }, + "combo_tests": {} + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "invalid-character-name-value-class", + "description": "An invalid character was used in an 8.3.0 or greater style text value class.", + "schema": "8.3.0", + "tests": { + "string_tests": { + "fails": ["Parameter-label/[", "Parameter-label/Taco*"], + "passes": ["Parameter-label/Words"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "show": "Parameter-label/[" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": "Parameter-label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": {} + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "invalid-character-name-value-class-deprecated", + "description": "An invalid character was used in an 8.2.0 or lower style text value class.", + "schema": "8.2.0", + "tests": { + "string_tests": { + "fails": ["Parameter-label/[", "Parameter-label/Taco\u00c3\u201e"], + "passes": ["Parameter-label/Words", "Parameter-label/Taco*"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "show": "Parameter-label/[" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": "Parameter-label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": {} + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "invalid-character-numeric-class", + "description": "An invalid character was used in an 8.3.0 or greater style numeric value class.", + "schema": "8.3.0", + "tests": { + "string_tests": { + "fails": [ + "Weight/3.0$ kg", + "Weight/3.0db kg", + "Weight/3.0& kg", + "Weight/abc kg", + "Weight/*3.0 kg", + "Weight/3.0% kg", + "Weight/3.0^ kg", + "Weight/3.0? kg" + ], + "passes": [ + "Weight/3.0e10 kg", + "Weight/3e10 kg", + "Weight/3.0 kg", + "Weight/3000 kg", + "Weight/3e10 kg", + "Weight/3.5e10 kg", + "Weight/2.998e8 g", + "Weight/6.022e23 g", + "Weight/7.0e-10 g", + "Weight/1.6e-35 kg" + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "show": "Weight/3.0a" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": "Weight/# g" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": {} + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "invalid-character-name-class", + "description": "An invalid character was used in an 8.3.0 or greater style numeric value class.", + "schema": "8.3.0", + "tests": { + "string_tests": { + "fails": ["Label/30$", "Label/30db kg"], + "passes": ["Label/30e10", "Label/3e10asdf"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "show": "Label/3.0a" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": {} + } + }, + { + "error_code": "COMMA_MISSING", + "name": "comma-missing-tag-groups", + "description": "Two tag groups are not separated by commas: (A, B)(C, D).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Red, Blue)(Green, (Yellow))", "(Def/MyColor, Onset)(Def/Acc/3.5 m-per-s^2)"], + "passes": ["(Red, Blue), (Green, (Yellow))", "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue)(Green, (Yellow))", + "ball": "(Def/MyColor, Onset)(Def/Acc/3.5 m-per-s^2)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, ( Yellow))", + "ball": "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red, Blue)(Green, (Yellow))"], + [5.5, 0, "(Def/MyColor, Onset)(Def/Acc/3.5 m-per-s^2)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red, Blue), (Green, (Yellow))"], + [5.5, 0, "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue)(Green, (Yellow))", + "ball": "(Def/MyColor, Onset)(Def/Acc/3.5 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"], + [6.0, 0, "n/a", "(Blue, Green)(Blue, Red)"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, ( Yellow))", + "ball": "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "(Green, Def/MyColor),(Red)"] + ] + } + ] + } + } + }, + { + "error_code": "COMMA_MISSING", + "name": "comma-missing-tag-and-group", + "description": "A tag and a tag group are not separated by commas: A(B,D).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Red, Blue(Green, (Yellow))", "(Def/MyColor, Onset)Def/Acc/3.5 m-per-s^2"], + "passes": ["Red, (Green, (Yellow))", "(Def/MyColor, Onset),Def/Acc/3.5 m-per-s^2"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red(Green, (Yellow))", + "ball": "(Def/MyColor, Onset)Def/Acc/3.5 m-per-s^2" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red, (Green, (Yellow))", + "ball": "(Def/MyColor, Onset),Def/Acc/3.5 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red(Green, (Yellow))"], + [5.5, 0, "(Def/MyColor, Onset)Def/Acc/3.5 m-per-s^2"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Green, (Yellow))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red(Green, (Yellow))", + "ball": "(Def/MyColor, Onset)Def/Acc/3.5 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"], + [6.0, 0, "n/a", "(Green, Yellow)Red"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red, (Green, (Yellow))", + "ball": "(Def/MyColor, Onset),Def/Acc/3.5 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-tag-group", + "description": "A Definition tag does not appear in a tag group at the top level in an annotation.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Definition/Apple, (Blue)), ((Definition/Blech, (Red)))", "Definition/Blech, (Red)"], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue)), ((Definition/Blech, (Red)))", + "def2": "Definition/Blech, (Red)" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Blech, (Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue)), ((Definition/Blech, (Red)))", + "def2": "Definition/Blech, (Red)" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/MyColor, Def/Apple"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue))", + "def2": "(Definition/Blech, (Red))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/MyColor, Def/Apple"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-missing-inner-group", + "description": "A definition's enclosing tag group is missing the inner tag group (i.e., the definition's contents).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple)" + } + } + }, + { + "defs": { + "HED": { + "def2": "(Definition/Blech/#, ())" + } + } + } + ], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple), ((Definition/Blech, (Red)))", + "def2": "(Definition/Blech/#, ())" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/MyColor, Def/Apple"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue))", + "def2": "(Definition/Blech, (Red))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/MyColor, Def/Apple"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-multiple-definition-tags", + "description": "A definition's enclosing tag group contains more than a `Definition` tag and an inner group.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, Definition/Banana, (Blue))", + "def2": "(Definition/Blech, (Red), Definition/Banana1)", + "def3": "(Definition/Blech1, (Red), Blue)" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue))", + "def2": "((Red), Definition/Blech)" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, Definition/Banana, (Blue))", + "def2": "(Definition/Blech, (Red), Definition/Banana1)", + "def3": "(Definition/Blech1, (Red), Blue)" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple, Def/Banana"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue))", + "def2": "((Red), Definition/Blech)" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech, Def/Apple"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-inner-group-defs", + "description": "A definition's inner tag group contains `Definition`, `Def` or `Def-expand` tags.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Definition/Banana, Blue))", + "def2": "(Definition/Blech, (Red, Def/Apple))" + } + } + } + ], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label/a"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Definition/Banana, (Blue)))", + "def2": "(Definition/Blech, ((Red), Def/MyColor))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple, Def/Banana"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Blue))", + "def2": "((Red), Definition/Blech)" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech, Def/Apple"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-bad-number-of-placeholders", + "description": "A definition that includes a placeholder (`#`) does not have exactly two `#` characters.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#, Description/#))", + "def2": "(Definition/Blech/#, (Red))" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#))", + "def2": "(Definition/Blech/#, (Red, Label/#))" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#, Description/#))", + "def2": "(Definition/Blech/#, (Red))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple/3, Def/Blech/might"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#))", + "def2": "(Definition/Blech/#, (Red, Label/#))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech/5, Def/Apple/4"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-placeholder-incorrect-of-positions", + "description": "A definition has placeholders (`#`) in incorrect positions.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Label/#))", + "def2": "(Definition/Blech/#, (Red, #))" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Label/Blue))", + "def2": "(Definition/Blech/#, (Label/#, Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Label/#))", + "def2": "(Definition/Blech/#, (Red, #))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple, Def/Blech/might"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#))", + "def2": "(Definition/Blech/#, (Red, Label/#))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech/5, Def/Apple/4"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-placeholder-conflict", + "description": "Definitions of the same name appear with and without a `#`.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Label/#))", + "def2": "(Definition/Apple/#, (Red, #))" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Blech/#, (Label/#))", + "def2": "(Definition/Apple, (Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Label/#))", + "def2": "(Definition/Apple/#, (Red, #))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple/3, Def/Apple"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#))", + "def2": "(Definition/Blech, (Red))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech, Def/Apple/4"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-invalid-multiple-definitions", + "description": "Multiple `Definition` tags with same name are encountered.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#, Description/#))", + "def2": "(Definition/Apple/#, (Label/#))", + "def3": "(Definition/MyColor, (Blue))" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/ThisIsALabel, Description/#))", + "def2": "(Definition/Apple2/#, (Label/#))", + "def3": "(Definition/MyColor2, (Blue))" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#, Description/#))", + "def2": "(Definition/Apple/#, (Label/#))", + "def3": "(Definition/MyColor, (Blue))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple/3, Def/Blech/might"], + [5.0, 0, "Def/MyColor"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#))", + "def2": "(Definition/Blech/#, (Red, Label/#))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech/5, Def/Apple/4"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-has-unique-or-required-tag", + "description": "A tag with a required or unique attribute appears in a definition.", + "schema": "8.3.0", + "definitions": [ + "(Definition/Acc/#, (Acceleration/#, Red))", + "(Definition/MyColor, (Event-context, Item, (Label/Pie))" + ], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Event-context, Red))", + "def2": "(Definition/Banana/#, (Label/#))" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Red))", + "def2": "(Definition/Banana/#, (Label/#))" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Event-context, Red))", + "def2": "(Definition/Banana/#, (Label/#))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple, Def/Banana/might"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple, (Red))", + "def2": "(Definition/Banana/#, (Label/#))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple, Def/Banana/might"] + ] + } + ] + } + } + }, + { + "error_code": "DEFINITION_INVALID", + "name": "definition-not-allowed-here", + "description": "A definition appears in an unexpected place such as an events file or sidecar.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Item, (Label/Pie)))"], + "tests": { + "string_tests": { + "fails": ["Red, Blue, (Definition/myDef, (Label/Red, Blue))"], + "passes": ["Red, Blue"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red, Blue, (Definition/myDef, (Label/Red, Blue))", + "ball": "Def/Acc/4.5 m-per-s^2" + } + } + } + ], + "passes": [ + { + "defs": { + "HED": { + "face": "(Definition/myDef, (Label/Red, Blue)), (Definition/myDef2, (Label/Red, Blue))", + "ball": "(Definition/myDef1, (Label/Red, Blue))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Definition/myDef, (Label/Red, Green))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, Blue, Def/MyColor"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red, Blue, (Definition/myDef, (Label/Red, Blue))", + "ball": "Def/Acc/4.5 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/myDef, Red"] + ] + } + ], + "passes": [ + { + "sidecar": { + "defs": { + "HED": { + "def1": "(Definition/Apple/#, (Label/#))", + "def2": "(Definition/Blech/#, (Red, Label/#))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Blech/5, Def/Apple/4"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_EXPAND_INVALID", + "name": "def-expand-invalid-name-not-definition", + "description": "A `Def-expand` tag's name does not correspond to a definition.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Def-expand/Acc2/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "(Def-expand/MyColor2, (Label/Pie))" + ], + "passes": ["(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc2/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/MyColor2, (Label/Pie))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/MyColor, (Label/Pie))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc2/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "(Def-expand/MyColor2, (Label/Pie))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "(Def-expand/MyColor, (Label/Pie))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc2/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/MyColor2, (Label/Pie)))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"], + [5.0, 0, "ball", "(Def-expand/Junk, (Label/Red))"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/MyColor, (Label/Pie))" + } + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "(Def-expand/MyColor, (Label/Pie))"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_EXPAND_INVALID", + "name": "def-expand-invalid-missing-placeholder", + "description": "A `Def-expand` is missing an expected placeholder value or has an unexpected placeholder value.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Def-expand/Acc, (Acceleration, Red))", + "(Def-expand/Acc/4.5/3, (Acceleration, Red))", + "(Def-expand/MyColor/Blue, (Label/Pie))" + ], + "passes": [ + "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc, (Acceleration, Red))", + "ball": "(Def-expand/Acc/4.5/3, (Acceleration, Red))", + "circle": "(Def-expand/MyColor2/4, (Label/Pie))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc, (Acceleration, Red))"], + [5.5, 0, "(Def-expand/Acc/4.5/3, (Acceleration, Red))"], + [6.5, 0, "(Def-expand/MyColor2/4, (Label/Pie))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc, (Acceleration, Red))", + "ball": "(Def-expand/Acc/4.5/3, (Acceleration, Red))", + "circle": "(Def-expand/MyColor2/4, (Label/Pie))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", " (Def-expand/Acc, (Acceleration, Red))"], + [5.5, 0, "ball", "(Def-expand/Acc/4.5/3, (Acceleration, Red))"], + [5.6, 0, "circle", "(Def-expand/Acc/4.5/3, (Acceleration, Red))"], + [6.5, 0, "n/a", "(Def-expand/MyColor2/4, (Label/Pie))"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"], + [5.2, 0, "ball", "(Def-expand/MyColor, (Label/Pie))"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_EXPAND_INVALID", + "name": "def-expand-invalid-bad-placeholder-units", + "description": "A `Def-expand` has a placeholder value of incorrect format or units for definition.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Def-expand/Acc/Make-me, (Acceleration/Make-me, Red))", + "(Def-expand/Acc/4.5 m, (Acceleration/4.5 m, Red))", + "(Def-expand/Acc/4.5m-per-s^2, (Acceleration/4.5m-per-s^2, Red))" + ], + "passes": ["(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/Make-me, (Acceleration/Make-me, Red))", + "ball": "(Def-expand/Acc/4.5 m, (Acceleration/4.5 m, Red))", + "square": "(Def-expand/Acc/4.5m-per-s^2, (Acceleration/4.5m-per-s^2, Red))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/Make-me, (Acceleration/Make-me, Red))"], + [5.5, 0, "(Def-expand/Acc/4.5 m, (Acceleration/4.5 m, Red))"], + [6.3, 0, "(Def-expand/Acc/4.5m-per-s^2, (Acceleration/4.5m-per-s^2, Red))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/Make-me, (Acceleration/Make-me, Red))", + "ball": "(Def-expand/Acc/4.5 m, (Acceleration/4.5 m, Red))", + "square": "(Def-expand/Acc/4.5m-per-s^2, (Acceleration/4.5m-per-s^2, Red))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Def-expand/Acc/Make-me, (Acceleration/Make-me, Red))"], + [5.5, 0, "ball", "(Def-expand/Acc/4.5 m, (Acceleration/4.5 m, Red))"], + [6.3, 0, "square", "(Def-expand/Acc/4.5m-per-s^2, (Acceleration/4.5m-per-s^2, Red))"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Def-expand/Acc/5.5 m-per-s^2, (Acceleration/5.5 m-per-s^2, Red))"], + [5.5, 0, "ball", "(Def-expand/Acc/5.5 m-per-s^2, (Acceleration/5.5 m-per-s^2, Red))"], + [6.5, 0, "n/a", "n/a"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_EXPAND_INVALID", + "name": "def-expand-invalid-tags-not-in-definition", + "description": "The tags within a Def-expand do not match the corresponding definition.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/6, Red))", + "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Blue))", + "(Def-expand/MyColor, (Label/Cake))" + ], + "passes": ["(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/6, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Blue))", + "square": "(Def-expand/MyColor, (Label/Cake))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/6, Red))"], + [5.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Blue))"], + [6.3, 0, "(Def-expand/MyColor, (Label/Cake))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/6, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Blue))", + "square": "(Def-expand/MyColor, (Label/Cake)))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/6, Red))"], + [5.5, 0, "ball", "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Blue))"], + [6.3, 0, "square", "(Def-expand/MyColor, (Label/Cake))"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Def-expand/Acc/6.5 m-per-s^2, (Acceleration/6.5 m-per-s^2, Red))"], + [5.5, 0, "ball", "(Def-expand/Acc/8.5 m-per-s^2, (Acceleration/8.5 m-per-s^2, Red))"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_EXPAND_INVALID", + "name": "def-expand-missing-inner-group", + "description": "A Def-expand is missing its inner group containing the definition.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Item, (Label/Pie)))"], + "tests": { + "string_tests": { + "fails": ["(Def-expand/Acc/5.4 m-per-s^2)"], + "passes": ["(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, Red)", + "ball": "(Def-expand/Acc/4.5 m-per-s^2)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))", + "ball": "Red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, Red)"], + [5.4, 0, "(Def-expand/Acc/5.4 m-per-s^2)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2)", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Def/Acc, (Def-expand/Acc/4.5 m-per-s^2)"], + [5.4, 0, "n/a", "Green"], + [6.4, 0, "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))", + "ball": "(Acceleration/4.5 m-per-s^2, Blue), Def/MyColor" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "n/a"], + [6.5, 0, "ball", "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_EXPAND_INVALID", + "name": "def-expand-has-extras", + "description": "A Def-expand has extra tags or groups.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Item, (Label/Pie)))"], + "tests": { + "string_tests": { + "fails": [ + "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), Blue)", + "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), (Blue, Green), Black)" + ], + "passes": ["(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), Blue)", + "ball": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), (Blue, Green), Black)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))", + "ball": "Red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), Blue)"], + [5.4, 0, "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), (Blue, Green), Black)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), Blue)", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Def/Acc, (Def-expand/Acc/4.5 m-per-s^2)"], + [5.4, 0, "n/a", "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red), Blue)"], + [6.4, 0, "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))", + "ball": "(Acceleration/4.5 m-per-s^2, Blue), Def/MyColor" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "n/a"], + [6.5, 0, "ball", "(Def-expand/Acc/5.4 m-per-s^2, (Acceleration/5.4 m-per-s^2, Red))"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_INVALID", + "name": "def-invalid-name", + "description": "A `Def` tag's name does not correspond to a definition.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Def/Apple2, Green", "Def/Acc2/4.5", "Def/Acc"], + "passes": ["Def/Acc/4.5 m-per-s^2"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def/Apple2, Green", + "ball": "Def/Acc2/4.5, Def/Acc/3.2 m-per-s^2" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Def/Acc/4.5 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Apple2, Green"], + [5.5, 0, "Def/Acc2/4.5 m-per-s^2"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/4.5 m-per-s^2"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Apple2, Green", + "ball": "Def/Acc2/4.5, Def/Acc/3.2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Def/Apple2, Green"], + [5.5, 0, "face", "Def/Acc2/4.5 m-per-s^2"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Acc/4.5 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_INVALID", + "name": "def-invalid-missing-placeholder", + "description": "A `Def` tag is missing an expected placeholder value or has an unexpected placeholder value.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Def/Acc, (Def/Acc/4.5 m-per-s^2, Red)", "Def/MyColor/Blue"], + "passes": ["Def/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def/Acc, (Def/Acc/4.5 m-per-s^2, Red)", + "ball": "(Def/MyColor/Blue, Green)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Def/Acc/4.5 m-per-s^2, Red", + "ball": "(Acceleration/4.5 m-per-s^2, Red), Def/MyColor" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc, (Def/Acc/4.5 m-per-s^2, Red)"], + [5.4, 0, "Def/MyColor/Blue, Green"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Acc, (Def/Acc/4.5 m-per-s^2, Red)", + "ball": "(Def/MyColor/Blue, Green)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Def/Acc, (Def/Acc/4.5 m-per-s^2, Red)"], + [5.4, 0, "n/a", "Def/MyColor/Blue, Green"], + [6.4, 0, "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Acc/4.5 m-per-s^2, Red", + "ball": "(Acceleration/4.5 m-per-s^2, Red), Def/MyColor" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Def/Acc/5.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)"], + [6.5, 0, "ball", "n/a"] + ] + } + ] + } + } + }, + { + "error_code": "DEF_INVALID", + "name": "def-invalid-bad-placeholder-units", + "description": "A `Def` has a placeholder value of incorrect format or units for definition.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "Def/Acc/baloney, (Def/Acc/4.5 m-per-s^2, Red)", + "Def/Acc/3 m", + "Def/Acc/4m-per-s^2", + "Def/MyColor/Redish" + ], + "passes": ["Def/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def/Acc/baloney, (Def/Acc/4.5 m-per-s^2, Red)", + "ball": "Def/Acc/3 m", + "square": "Def/Acc/4m-per-s^2", + "triangle": "Def/MyColor/Redish" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def/Acc/4.5 m-per-s^2, Red)", + "ball": "Def/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/baloney, (Def/Acc/4.5 m-per-s^2, Red)"], + [5.0, 0, "Def/Acc/3 m"], + [6.3, 0, "Def/Acc/4m-per-s^2"], + [7.2, 0, "Def/MyColor/Redish"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def/Acc/baloney, (Def/Acc/4.5 m-per-s^2, Red)", + "ball": "Def/Acc/3 m", + "square": "Def/Acc/4m-per-s^2", + "triangle": "Def/MyColor/Redish" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Def/Acc/baloney, (Def/Acc/4.5 m-per-s^2, Red)"], + [5.0, 0, "face", "Def/Acc/3 m"], + [6.3, 0, "n/a", "Def/Acc/4m-per-s^2"], + [7.2, 0, "square", "Def/MyColor/Redish"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/Acc/4.5 m-per-s^2, Red)", + "ball": "Def/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "ELEMENT_DEPRECATED", + "name": "tag-deprecated", + "description": "A tag is deprecated", + "warning": true, + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Def/MyColor, Green, Gentalia", "Gentalia"], + "passes": ["Torso"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def/MyColor, Green, Gentalia", + "ball": "Green, Blue" + } + }, + "other_code": { + "HED": "Label/#, Gentalia" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Torso" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Gentalia, Green"], + [5.5, 0, "n/a"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Torso"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Gentalia", + "ball": "Green" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Blue"], + [5.5, 0, "face", "Red"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Torso", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "PARENTHESES_MISMATCH", + "name": "parentheses-mismatch-unmatched-parentheses", + "description": "A HED string does not have the same number of open and closed parentheses.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Def/MyColor, (Blue, (Yellow)), Red))", + "((Red, ((Blue, Green), Yellow))", + "((Red, ((Blue), Green)), (Yellow)" + ], + "passes": ["(Def/Acc/5.3 m-per-s^2, (Red))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def/MyColor, (Blue, (Yellow)), Red))", + "ball": "(Red, ((Blue, Green), Yellow))", + "square": "(Red, ((Blue), Green)), (Yellow)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def/Acc/5.3 m-per-s^2, (Red))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/MyColor, (Blue, (Yellow)), Red))"], + [5.5, 0, "(Red, ((Blue, Green), Yellow))"], + [6.3, 0, "(Red, ((Blue), Green)), (Yellow)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/Acc/5.3 m-per-s^2, (Red))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "Def/Acc/apple3, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "(Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "PARENTHESES_MISMATCH", + "name": "parentheses-mismatch-incorrect-nesting", + "description": "The open and closed parentheses are not correctly nested in the HED string.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Def/MyColor)), (Blue, (Yellow)), (Red)", ")(Def/MyColor)), (Blue, (Yellow)), (Red))"], + "passes": ["(Def/Acc/5.3 m-per-s^2, (Red))", "(((((Def/Acc/5.3 m-per-s^2, (Red))))))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Def/MyColor)), (Blue, (Yellow)), (Red)", + "ball": ")(Def/MyColor)), (Blue, (Yellow)), (Red))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def/Acc/5.3 m-per-s^2, (Red))", + "ball": "(((((Def/Acc/5.3 m-per-s^2, (Red))))))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/MyColor)), (Blue, (Yellow)), (Red)"], + [5.5, 0, ")(Def/MyColor)), (Blue, (Yellow)), (Red))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def/Acc/5.3 m-per-s^2, (Red))"], + [5.5, 0, "(((((Def/Acc/5.3 m-per-s^2, (Red))))))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/MyColor)), (Blue, (Yellow)), (Red)", + "ball": ")(Def/MyColor)), (Blue, (Yellow)), (Red))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "),Red, (((Def/MyColor)))"], + [5.0, 0, "ball", "(Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Def/Acc/5.3 m-per-s^2, (Red))", + "ball": "(((((Def/Acc/5.3 m-per-s^2, (Red))))))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, ((Def/MyColor))"] + ] + } + ] + } + } + }, + { + "error_code": "PLACEHOLDER_INVALID", + "name": "placeholder-invalid-misplaced", + "description": "A `#` appears in a place that it should not (such as in the `HED` column of an event file outside a definition).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Label/#", "Def/Acc/# m-per-s^2"], + "passes": ["Label/This-label"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Label/#", + "ball": "Def/Acc/# m-per-s^2" + } + } + } + ], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label/#"], + [5.0, 0, "Def/Acc/# m-per-s^2"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label/This-label"], + [6.0, 0, "(Def/Acc/3.5 m-per-s^2)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "Def/Acc/apple3, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/Acc/#"], + [5.0, 0, "ball", "Label/#"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "PLACEHOLDER_INVALID", + "name": "placeholder-invalid-#-in-categorical-column", + "description": "A JSON sidecar has a placeholder (`#`) in the HED dictionary for a categorical column.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Label/#", + "ball": "Def/Acc/# m-per-s^2" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Label/This-label", + "ball": "(Def/Acc/3.5 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Label/#", + "ball": "Def/Acc/#" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "PLACEHOLDER_INVALID", + "name": "placeholder-invalid-json-value-column", + "description": "A JSON sidecar does not have exactly one placeholder (`#`) in each HED string representing a value column.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "trial": { + "HED": "Def/Acc/# m-per-s^2, Label/#" + }, + "memory": { + "HED": "Blue, Red, Label/#" + } + } + ], + "passes": [ + { + "trial": { + "HED": "Def/Acc/# m-per-s^2" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "trial": { + "HED": "Def/Acc/#, Label/#" + }, + "memory": { + "HED": "Blue, Red, Label/#" + } + }, + "events": [ + ["onset", "duration", "trial", "memory", "HED"], + [4.5, 0, "3", "4", "Green, Def/MyColor"], + [5.0, 0, "2", "6", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "trial": { + "HED": "Def/Acc/#, Label/Trial" + }, + "memory": { + "HED": "Blue, Red, Label/#" + } + }, + "events": [ + ["onset", "duration", "trial", "memory", "HED"], + [4.5, 0, "5", "4", "Green"], + [5.0, 0, "3", "2", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "PLACEHOLDER_INVALID", + "name": "placeholder-invalid-json-#-misplaced", + "description": "A placeholder (`#`) is used in JSON sidecar or definition, but its parent in the schema does not have a placeholder child.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "trial": { + "HED": "Sensory-event/#" + }, + "defs": { + "def1": "(Definition/Blech/#, (Red, Blue/#))" + } + } + ], + "passes": [ + { + "trial": { + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "trial": { + "HED": "Sensory-event/#" + }, + "defs": { + "def1": "(Definition/Blech/#, (Red, Blue/#))" + } + }, + "events": [ + ["onset", "duration", "trial", "HED"], + [4.5, 0, "3", "Red, Def/MyColor"], + [5.0, 0, "2", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "trial": { + "HED": "Sensory-event, Label/#" + }, + "defs": { + "def1": "(Definition/Blech/#, (Red, Label/#))" + } + }, + "events": [ + ["onset", "duration", "trial", "HED"], + [4.5, 0, "3", "Blue"], + [5.0, 0, "2", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "REQUIRED_TAG_MISSING", + "name": "required-tag-missing", + "description": "An event-level annotation does not have a tag corresponding to a node with the `required` schema attribute. (Note this is deprecated so no tests.)", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + } + } + }, + { + "error_code": "REQUIRED_TAG_MISSING", + "name": "required-tag-in-definition", + "description": "A required tag appears in a definition", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + } + }, + "combo_tests": { + "fails": [], + "passes": [] + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-contents-invalid", + "description": "The item in curly braces is not the word HED or a column name with HED annotations in the sidecar.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description but no HED" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED", "response_time"], + [4.5, 0, "face", "Blue", 0], + [5.0, 0, "ball", "Green, Def/MyColor", 1], + [5.5, 0, "face", "", 2], + [5.7, 0, "face", "n/a", 3] + ] + } + ] + } + } + }, + { + "error_code": "VALUE_INVALID", + "name": "sidecar-braces-invalid-spot", + "description": "A curly brace reference must only appear where a tag could.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/Acc/{response_time})" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [], + "passes": [] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-circular-reference", + "description": "The item in curly braces has a HED annotation that contains curly braces.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), {HED}", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "HED": "Label/#, {event_code}" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), {HED}", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)", + "dog": "Orange, {event_type}" + } + }, + "response_time": { + "HED": "Label/#" + }, + "event_type": { + "HED": { + "banana": "Blue, {response_time}", + "apple": "Green" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + }, + "response_count": { + "Description": "A count used to test curly braces in value columns.", + "HED": "(Item-count/#, {response_time})" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2, {response_action})" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "response_time", "event_code", "HED"], + [4.5, 0, 3.4, "face", "Blue"], + [5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [5.2, 0, "n/a", "face", ""], + [5.5, 0, "any", "face", "n/a"] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-self-reference", + "description": "The item in curly braces has a HED annotation that contains itself.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), {HED}", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "HED": "Label/#, {response_time}" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + }, + "response_count": { + "Description": "A count used to test curly braces in value columns.", + "HED": "(Item-count/#, {response_time})" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2, {response_action})" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#, {response_time}" + } + }, + "events": [ + ["onset", "duration", "response_time", "event_code", "HED"], + [4.5, 0, 3.4, "face", "Blue"], + [5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [5.2, 0, "n/a", "face", ""], + [5.5, 0, "any", "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "response_time", "event_code", "HED"], + [4.5, 0, 3.4, "face", "Blue"], + [5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [5.2, 0, "n/a", "face", ""], + [5.5, 0, "any", "face", "n/a"] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-self-reference", + "description": "The item in curly braces has a HED annotation that contains itself.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), {HED}", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "HED": "Label/#, {response_time}" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + }, + "response_count": { + "Description": "A count used to test curly braces in value columns.", + "HED": "(Item-count/#, {response_time})" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2, {response_action})" + } + }, + "response_action": { + "Description": "Does not correspond to curly braces", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{HED}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#, {response_time}" + } + }, + "events": [ + ["onset", "duration", "response_time", "event_code", "HED"], + [4.5, 0, 3.4, "face", "Blue"], + [5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [5.2, 0, "n/a", "face", ""], + [5.5, 0, "any", "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "response_time", "event_code", "HED"], + [4.5, 0, 3.4, "face", "Blue"], + [5.0, 0, 6.8, "ball", "Green, Def/MyColor"], + [5.2, 0, "n/a", "face", ""], + [5.5, 0, "any", "face", "n/a"] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-appear-as-value-rather-than-tag", + "description": "The curly braces are in a value rather than as a separate tag substitute.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "Label/{response_time}, Black" + } + }, + "response_time": { + "Description": "Has description but no HED", + "HED": "Orange" + } + }, + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "Label/{response_time}, Black" + } + }, + "response_time": { + "Description": "Has description but no HED", + "HED": "Label/#" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), ({response_time}, (Green, (Yellow)))", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "Label/{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Orange" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"], + [5.2, 0, "face", ""], + [5.5, 0, "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED", "response_time"], + [4.5, 0, "face", "Blue", 1], + [5.0, 0, "ball", "Green, Def/MyColor", 1], + [5.2, 0, "face", "", 1], + [5.5, 0, "face", "n/a", 1] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-ref-not-hed-column", + "description": "Curly braces reference a column that exists, but isn't marked as hed data.", + "schema": "8.2.0", + "definitions": [], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{onset}" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Blue"] + ] + } + ], + "passes": [] + } + } + }, + { + "error_code": "SIDECAR_BRACES_INVALID", + "name": "sidecar-braces-ref-ignore-column", + "description": "Curly braces reference a column that exists, but is marked ignore.", + "schema": "8.2.0", + "definitions": [], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{onset}" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Blue"] + ] + } + ], + "passes": [] + } + } + }, + { + "error_code": "CHARACTER_INVALID", + "name": "sidecar-braces-in-events-file", + "description": "The curly braces appear in HED column of events file.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["{HED}, Def/MyColor"], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "{who_knows}, Red"] + ] + ], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue, {response_time}"], + [5.0, 0, "ball", "Green, Def/MyColor"], + [5.2, 0, "face", ""], + [5.5, 0, "face", "n/a"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow)), ({HED})", + "ball": "{response_time}, (Def/Acc/3.5 m-per-s^2)" + } + }, + "response_time": { + "Description": "Has description with HED", + "HED": "Label/#" + } + }, + "events": [ + ["onset", "duration", "event_code", "HED", "response_time"], + [4.5, 0, "face", "Blue", 1], + [5.0, 0, "ball", "Green, Def/MyColor", 1], + [5.2, 0, "face", "", 1], + [5.5, 0, "face", "n/a", 1] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_INVALID", + "name": "sidecar-invalid-key-at-wrong-level", + "description": "The HED key is not a second-level dictionary key.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "temp": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset), (Def/Acc/3.5 m-per-s^2)" + } + } + }, + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset), (Def/Acc/3.5 m-per-s^2)" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "temp": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset), (Def/Acc/3.5 m-per-s^2)" + } + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + }, + { + "sidecar": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset), (Def/Acc/3.5 m-per-s^2)" + } + }, + "events": [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, Def/MyColor"], + [5.0, 0, "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_INVALID", + "name": "sidecar-invalid-na-annotated", + "description": "An annotation entry is provided for `n/a`.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue),(Green, (Yellow))", + "n/a": "(Def/MyColor, Onset), (Def/Acc/3.5 m-per-s^2)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, Blue), (Green, (Yellow))", + "ball": "(Def/MyColor, Onset),(Def/Acc/3.5 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, Blue),(Green, (Yellow))", + "n/a": "(Def/MyColor, Onset), (Def/Acc/3.5 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "n/a", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "SIDECAR_KEY_MISSING", + "name": "sidecar-key-missing", + "description": "A value in a categorical column does not have an expected entry in a sidecar.", + "warning": true, + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "Def/Acc/apple3, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "square", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7 m-per-s^2, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "STYLE_WARNING", + "name": "style-warning-bad-naming-style", + "description": "An extension or label does not follow HED naming conventions.", + "warning": true, + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Red-color/red"], + "passes": ["Blue-color/Blue"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red/red_blech", + "ball": "Blue-color/blue" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red-color/Red", + "ball": "Blue-color/Blue" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red/red_blech"], + [5.0, 0, "Blue-color/blue"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red-color/Red"], + [5.0, 0, "Blue-color/Blue"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red/red_blech", + "ball": "Blue-color/blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red-color/Red", + "ball": "Blue-color/Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EMPTY", + "name": "tag-empty-extra-commas-or-parentheses", + "description": "A HED string has extra commas or parentheses separated by only white space.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "Red, , , Green", + "(, Red, Green), Blue", + "(Red, , Green), Blue", + "(Red, Green,), Blue", + "(Red, Green), Blue," + ], + "passes": ["(Red, Blue), Green"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "square": "Red, , , Green", + "test": "(, Red, Green), Blue", + "pine": "(Red, , Green), Blue", + "apple": "(Red, Green,), Blue" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red, Blue", + "ball": "Def/Acc/4.5 m-per-s^2, Def/Acc/3.2 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [5.5, 0, "Red, , , Green"], + [7.5, 0, "(, Red, Green), Blue"], + [8.2, 0, "(Red, , Green), Blue"], + [9.1, 0, "(Red, Green,), Blue"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Blue, Green)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "square": "Red, , , Green", + "test": "(, Red, Green), Blue", + "pine": "(Red, , Green), Blue", + "apple": "(Red, Green,), Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "test", "Red, Def/MyColor"], + [5.0, 0, "apple", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red, Green", + "ball": "Def/Acc/4.5 m-per-s^2, Def/Acc/3.2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EMPTY", + "name": "tag-empty-begin-end-comma", + "description": "A HED string begins or ends with a comma (ignoring white space).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [", Blue,Def/Acc/3.2 m-per-s^2", "(Blue, Green),Yellow,", ",,(Blue, Green),Yellow,"], + "passes": ["(Red, Blue), Green"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": ", Blue,Def/Acc/3.2 m-per-s^2", + "ball": "(Blue, Green),Yellow,", + "square": ",,(Blue, Green),Yellow," + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red, Blue", + "ball": "Def/Acc/4.5 m-per-s^2, Def/Acc/3.2 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, ", (Blue, Green),Yellow,"], + [5.5, 0, ",,(Blue, Green),Yellow,"], + [6.5, 0, ", Blue,Def/Acc/3.2 m-per-s^2"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Blue, Green)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": ", Blue,Def/Acc/3.2", + "ball": "(Blue, Green),Yellow,", + "square": ",,(Blue, Green),Yellow," + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EMPTY", + "name": "tag-empty-empty-parentheses", + "description": "A tag group is empty (i.e., empty parentheses are not allowed).", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Red, (), (Blue), ((Green)))", "((( ))), Red"], + "passes": ["(Red, ( Blue ), ((Green)))", "(((Def/Acc/3.5 m-per-s^2)))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red, (), (Blue), ((Green)))", + "ball": "((( ))), Red" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Red, ( Blue ), ((Green)))", + "ball": "(((Def/Acc/3.5 m-per-s^2)))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red, (), (Blue), ((Green)))"], + [5.5, 0, "((( ))), Red"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red, ( Blue ), ((Green)))"], + [5.5, 0, "(((Def/Acc/3.5 m-per-s^2)))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, (), (Blue), ((Green)))", + "ball": "((( ))), Red" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red, ( Blue ), ((Green)))", + "ball": "(((Def/Acc/3.5 m-per-s^2)))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EXPRESSION_REPEATED", + "name": "tag-expression-repeated-same-level", + "description": "A tag is repeated in the same tag group or level.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "Red, (Blue), Red, Green", + "(Red, Blue, (Green)), (Red, Blue, (Green))", + "(Red, (Blue, Green, (Yellow)), Red, (Blue, Green, (Yellow)))" + ], + "passes": ["Red, (Blue, Red)", "(Red, Blue, (Green)), (Red, Blue, ((Green)))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red, (Blue), Red, Green", + "ball": "(Red, Blue, (Green)), (Red, Blue, (Green))", + "square": "(Red, (Blue, Green, (Yellow)), Red, (Blue, Green, (Yellow)))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red, (Blue, Red)", + "ball": "(Red, Blue, (Green)), (Red, Blue, ((Green)))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Blue), Red, Green"], + [5.5, 0, "(Red, Blue, (Green)), (Red, Blue, (Green))"], + [6.5, 0, "(Red, (Blue, Green, (Yellow)), Red, (Blue, Green, (Yellow)))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Blue, Red)"], + [5.5, 0, "(Red, Blue, (Green)), (Red, Blue, ((Green)))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red, (Blue), Red, Green", + "ball": "(Red, Blue, (Green)), (Red, Blue, (Green))", + "square": "(Red, (Blue, Green, (Yellow)), Red, (Blue, Green, (Yellow)))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red, (Blue, Red)", + "ball": "(Red, Blue, (Green)), (Red, Blue, ((Green)))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EXTENDED", + "name": "tag-extended-extension", + "description": "A tag represents an extension from the schema.", + "warning": true, + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Red-color/Red/Big-red, Blue/Nice-blue),(Green, (Yellow))", + "Sensory-presentation/Visual-presentation/Nice-yellow", + "Red-color/Red/Redish", + "Red-color/Red/Redish/More-redish", + "((Green/Greenish))", + "Red/1red", + "Red/Red--2red" + ], + "passes": ["Red-color/Red"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Red-color/Red/Big-red, Blue/Nice-blue),(Green, (Yellow))", + "ball": "Sensory-presentation/Visual-presentation/Nice-yellow", + "square": "((Green/Greenish))", + "triangle": "Red/1red", + "catwalk": "Red/Red--2red" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red-color/Red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Red-color/Red/Big-red, Blue/Nice-blue),(Green, (Yellow))"], + [5.5, 0, "Sensory-presentation/Visual-presentation/Nice-yellow"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red-color/Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Red-color/Red/Big-red/Bigger-red, Blue/Nice-blue),(Green, (Yellow))", + "ball": "Sensory-presentation/Visual-presentation/Nice-yellow" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7 m-per-s^2, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EXTENSION_INVALID", + "name": "tag-extension-invalid-duplicate", + "description": "A tag extension term is already in the schema.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Red-color/Red/DarkRed, Sensory-presentation/Red", "Sensory-presentation/Red/Redish"], + "passes": ["Red-color/Red/Redish", "((Green/Greenish))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red-color/Red/DarkRed, Sensory-presentation/Red", + "ball": "Sensory-presentation/Red/Redish" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red-color/Red/Redish", + "ball": "((Green/Greenish))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red-color/Red/DarkRed, Sensory-presentation/Red"], + [5.5, 0, "Sensory-presentation/Red/Redish"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red-color/Red"], + [5.5, 0, "((Green))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red-color/Red/DarkRed, Sensory-presentation/Red", + "ball": "Sensory-presentation/Red/Redish" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red-color/Red", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_EXTENSION_INVALID", + "name": "tag-extension-invalid-bad-node-name", + "description": "A tag extension term does not comply with rules for schema nodes.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Red/Red$2", "Red/R#d"], + "passes": ["Red-color/Red", "((Green))", "Red"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Red/Red$2", + "ball": "Red/R#d" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Red-color/Red/Redish", + "ball": "Red-color/Red/Redish/More-redish", + "square": "((Green/Greenish))", + "triangle": "Red/1red", + "catwalk": "Red/Red--2red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red/Red$2"], + [5.5, 0, "Red/R#d"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red-color/Red/Redish"], + [5.5, 0, "Red-color/Red/Redish/More-redish"], + [6.5, 0, "((Green/Greenish))"], + [7.5, 0, "Red/1red"], + [8.2, 0, "Red/Red--2red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red/Red$2", + "ball": "Red/R#d" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Red/Redish-like", + "ball": "Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_GROUP_ERROR", + "name": "tag-group-error-missing", + "description": "A tag has tagGroup or topLevelTagGroup attribute, but is not enclosed in parentheses.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "Definition, (Red)", + "Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)", + "Onset", + "Duration/3.0 s", + "Delay/3.0 s" + ], + "passes": [ + "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "((Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset)", + "(Duration/3.0 s, (Event))", + "(Duration/3.0 s, Delay/2.0 s, (Event))" + ] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))", + "ball": "((Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)"], + [5.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))"], + [5.5, 0, "((Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)", + "ball": "(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_GROUP_ERROR", + "name": "tag-group-error-not-top-level", + "description": "A tag with the topLevelTagGroup does not appear at a HED tag group at the top level in an assembled HED annotation.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [], + "passes": [] + }, + "sidecar_tests": { + "fails": [], + "passes": [] + }, + "event_tests": { + "fails": [], + "passes": [] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "((Def/Acc/3.0 m-per-s^2, Onset))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "(Def/Acc/3.0 m-per-s^2, Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_GROUP_ERROR", + "name": "multiple-top-level-tags-in-same-group", + "description": "Multiple tags with the topLevelTagGroup attribute appear in the same top-level tag group. (Delay and Duration are allowed to be in the same topLevelTagGroup).", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "(Def/MyColor, Onset, Event-context)", + "(Event-context, Red, Offset)", + "(Event-context, Duration/3.0 s, Offset)", + "(Delay/3.0 s, Duration/2.0 s, Offset)" + ], + "passes": ["(Def/MyColor, Onset)", "((Event), Duration/3.0 s, Delay/2.0 s)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "(Def/Acc/3.0 m-per-s^2, Onset, Event-context)" + } + } + }, + { + "event_code": { + "HED": { + "face": "Acceleration/5.0", + "ball": "Onset" + } + }, + "val_col": { + "HED": "Time-interval/# s, (Duration/5.0 s, {event_code})" + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Acceleration/5.0)", + "ball": "Delay/5.0 s, (Acceleration/5.0)" + } + }, + "val_col": { + "HED": "Time-interval/# s, (Duration/5.0 s, {event_code})" + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Event-context, Def/MyColor, Onset)"], + [5.0, 0, "Green"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Red, (Event-context, Def/MyColor)"], + [5.0, 0, "Green"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/banana", + "ball": "(Def/Acc/3.0 m-per-s^2, Onset, Event-context)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, (Def/MyColor, Event-context, Event-context)"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "(Def/Acc/3.0 m-per-s^2, Onset)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue, (Event-context, Label/Red)"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_INVALID", + "name": "tag-invalid-in-schema", + "description": "The tag is not valid in the schema it is associated with.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Label #", "ReallyInvalid/Extension", "ReallyInvalid"], + "passes": ["Brown-color/Brown"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Label #", + "ball": "ReallyInvalid/Extension", + "square": "ReallyInvalid" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Brown-color/Brown" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Label #"], + [5.5, 0, "Property/Sensory-event"], + [5.5, 0, "Sensory-event/Baloney"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Brown-color/Brown"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "ReallyInvalid", + "ball": "Property/Sensory-event", + "square": "Sensory-event/Baloney" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue/Apples" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_INVALID", + "name": "tag-has-extra-white space", + "description": "A HED tag has extra internal whitespace, including directly before or after slashes.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "Sensory- event,Green", + "Sensory -event,Blue", + "Event /Sensory-event, Black", + "Event/ Sensory-event,White" + ], + "passes": ["Sensory-event, Green"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "square": "Sensory- event,Green", + "test": "Sensory -event,Blue", + "pine": "Event /Sensory-event, Black", + "apple": "Event/ Sensory-event,White" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Sensory-event, Green", + "ball": "Def/Acc/4.5 m-per-s^2, Def/Acc/3.2 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [5.5, 0, "Sensory- event,Green"], + [7.5, 0, "Sensory -event,Blue"], + [8.2, 0, "Event /Sensory-event, Black"], + [9.1, 0, "Event/ Sensory-event,White"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Sensory-event, Green"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "square": "Sensory- event,Green", + "test": "Sensory -event,Blue", + "pine": "Event /Sensory-event, Black", + "apple": "Event/ Sensory-event,White" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "test", "Red, Def/MyColor"], + [5.0, 0, "apple", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": " Red, Green", + "ball": "Def/Acc/4.5 m-per-s^2, Def/Acc/3.2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_INVALID", + "name": "tag-has-leading-trailing-or-consecutive-slashes", + "description": "A HED tag has leading, trailing or consecutive slashes.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": [ + "/Event", + "Red/", + "Event//Sensory-event", + "//Event", + "Body-part/Head-part//Brain", + "Def/Acc/4.5//", + "Def/Acc/4.5/", + "/ /Def/Acc/4.5 ms/" + ], + "passes": ["Body-part/Head-part/Brain", "Label/Red, Informational-property/Label/Blue"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Event//Sensory-event", + "ball": "/Event", + "square": "Red/", + "test": "/ /Def/Acc/4.5 ms/" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "Body-part/Head-part/Brain", + "ball": "Def/Acc/4.5 m-per-s^2, Def/Acc/3.2 m-per-s^2" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "/Event,"], + [5.5, 0, "Body-part/Head-part//Brain"], + [6.5, 0, "Event/Sensory-event/"], + [7.2, 0, "/ /Def/Acc/4.5 ms/"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Event/Sensory-event"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Event//Sensory-event", + "ball": "//Event", + "square": "Body-part/Head-part//Brain", + "test": "/ /Def/Acc/4.5 ms/" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red/, Def/MyColor"], + [5.0, 0, "ball", "Green"], + [7.2, 0, "n/a", "/ /Def/Acc/4.5 ms/"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "Event/Sensory-event"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_NOT_UNIQUE", + "name": "tag-not-unique", + "description": "A tag with unique attribute appears more than once in an event-level HED string.", + "schema": "8.3.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Event-context, (Red, Blue)), (Event-context, (Green, Yellow))"], + "passes": ["(Event-context, (Red, Blue))"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Event-context, (Red, Blue)), (Event-context, (Green, Yellow))" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Event-context, (Red, Blue))" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Event-context, (Red, Blue)), (Event-context, (Green, Yellow))"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Event-context, (Red, Blue))"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Event-context, (Red, Blue)), (Event-context, (Green, Yellow))" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Event-context, (Red, Blue))", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "ball", "(Event-context, (Red, Blue))"] + ] + } + ] + } + } + }, + { + "error_code": "TAG_REQUIRES_CHILD", + "name": "tag-requires-child-no-child", + "description": "A tag has the requireChild schema attribute but does not have a child.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["(Blue, Description)", "Label, Red"], + "passes": ["(Blue, Description/Yes this is a description., (Red))", "Label/Redish, Red"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "(Blue, Description)", + "ball": "Label, Red" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Blue, Description/Yes this is a description., (Red))", + "ball": "Label/Redish, Red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Blue, Description)"], + [5.0, 0, "Label, Red"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Blue, Description/Yes this is a description., (Red))"], + [5.0, 0, "Label/Redish, Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Blue, Description)", + "ball": "Label, Red" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Red, Def/MyColor"], + [5.0, 0, "ball", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Acceleration/5 m-per-s^2", + "ball": "Def/Acc/7, Blue" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Label/Blue"], + [5.0, 0, "ball", "Green, Def/MyColor"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-not-tag-group", + "description": "An Onset or Offset tag does not appear in a tag group.", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["Onset, Red", "Offset, Def/Acc/5.4 m-per-s^2"], + "passes": ["(Onset, Def/Acc/5.4 m-per-s^2)"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "Onset, Red", + "ball": "Offset, Def/Acc/5.4 m-per-s^2" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Onset, Def/Acc/5.4 m-per-s^2)" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "Onset, Red"], + [4.8, 0, "(Onset, MyColor)"], + [5.0, 0, "Offset, MyColor"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Onset, (Def-expand/MyColor, (Label/Pie)), (Red))"], + [5.5, 0, "(Onset, Def/Acc/5.4 m-per-s^2)"], + [6.3, 0, "(Offset, Def/Acc/5.4 m-per-s^2)"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "Onset, Red", + "ball": "Offset, Def/Acc/5.4 m-per-s^2" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "ball", "Onset, Red"], + [4.8, 0, "n/a", "(Onset/MyColor)"], + [5.0, 0, "face", "Offset, MyColor"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Onset, Def/Acc/5.4 m-per-s^2)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [5.5, 0, "n/a", "(Onset, Def/Acc/5.4 m-per-s^2)"], + [6.3, 0, "n/a", "(Offset, Def/Acc/5.4 m-per-s^2)"], + [8.5, 0, "face", "Blue"], + [9.0, 0, "n/a", "Green, ((Def-expand/MyColor, (Label/Pie)), Onset)"] + ] + } + ] + } + } + }, + { + "error_code": "TEMPORAL_TAG_ERROR", + "name": "onset-offset-inset-error-nested-group", + "description": "An Onset or Offset tag appears in a nested tag group (not a top-level tag group).", + "schema": "8.2.0", + "definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"], + "tests": { + "string_tests": { + "fails": ["((Onset, Def/MyColor), Red)"], + "passes": ["(Onset, Def/MyColor), Red"] + }, + "sidecar_tests": { + "fails": [ + { + "event_code": { + "HED": { + "face": "((Onset, Def/MyColor), Red)" + } + } + } + ], + "passes": [ + { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor), Red" + } + } + } + ] + }, + "event_tests": { + "fails": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "((Onset, Def/MyColor), Red)"] + ] + ], + "passes": [ + [ + ["onset", "duration", "HED"], + [4.5, 0, "(Onset, Def/MyColor), Red"] + ] + ] + }, + "combo_tests": { + "fails": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "((Onset, Def/MyColor), Red)" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "n/a", "((Onset, Def/MyColor), Red)"], + [5.0, 0, "face", "Green"] + ] + } + ], + "passes": [ + { + "sidecar": { + "event_code": { + "HED": { + "face": "(Onset, Def/MyColor), Red" + } + } + }, + "events": [ + ["onset", "duration", "event_code", "HED"], + [4.5, 0, "face", "Blue"], + [5.0, 0, "n/a", "(Onset, Def/MyColor), Red"] + ] + } + ] + } + } + } +]