From 6751df40549488760597a25cbdcf4fde5d77d5ce Mon Sep 17 00:00:00 2001 From: Alexander Jones Date: Sat, 8 Mar 2025 13:15:13 -0600 Subject: [PATCH] Last-minute changes to BIDS modules before major release Also revert bad replacement of "sidecar" -> "bidsFile" throughout strings and comments. --- spec_tests/jsonTests.spec.js | 2 +- src/bids/types/file.js | 19 ++--- src/bids/types/issues.js | 7 ++ src/bids/types/json.js | 85 +++++++++++++---------- src/bids/types/tsv.js | 4 +- src/bids/utils.js | 9 --- src/bids/validator/sidecarValidator.js | 10 +-- src/bids/validator/tsvValidator.js | 13 ++-- src/bids/validator/validator.js | 2 +- tests/bidsTests.spec.js | 8 +-- tests/testData/bidsTests.data.js | 96 +++++++++++++------------- 11 files changed, 128 insertions(+), 127 deletions(-) delete mode 100644 src/bids/utils.js diff --git a/spec_tests/jsonTests.spec.js b/spec_tests/jsonTests.spec.js index 7da7fe18..11aee54c 100644 --- a/spec_tests/jsonTests.spec.js +++ b/spec_tests/jsonTests.spec.js @@ -232,7 +232,7 @@ describe('HED validation using JSON tests', () => { try { const defManager = new DefinitionManager() defManager.addDefinitions(defList) - const bidsSide = new BidsSidecar(`sidecar`, { relativePath: 'bidsFile test' }, JSON.parse(side), defManager) + const bidsSide = new BidsSidecar(`sidecar`, { relativePath: 'sidecar test' }, JSON.parse(side), defManager) issues = bidsSide.validate(hedSchema) } catch (e) { issues = [convertIssue(e)] diff --git a/src/bids/types/file.js b/src/bids/types/file.js index 942dd3f5..7c85678e 100644 --- a/src/bids/types/file.js +++ b/src/bids/types/file.js @@ -16,15 +16,16 @@ export class BidsFile { * This is used to generate {@link BidsHedIssue} objects. * @type {Object} */ - file + /** * The validator class used to validate this file. * @private */ - _validatorClass + #validatorClass /** + * Constructor. * * @param {string} name - The name of the file -- used for messages. * @param {Object} file - The representation of the file for error messages. @@ -33,19 +34,9 @@ export class BidsFile { constructor(name, file, validatorClass) { this.name = name this.file = file - this._validatorClass = validatorClass + this.#validatorClass = validatorClass } - // /** - // * Parse this bidsFile's HED strings within the bidsFile structure. - // * - // * @param {Schemas} hedSchemas - The HED schema collection. - // * @returns {Array} [Issue[], Issue[]] Any errors and warnings found - // */ - // parseHed(hedSchemas) { - // return [[], []] - // } - /** * Whether this is a TSV file timeline file. * @@ -101,6 +92,6 @@ export class BidsFile { * @returns {function} (typeof BidsValidator) A subclass constructor of {@link BidsValidator}. */ get validatorClass() { - return this._validatorClass + return this.#validatorClass } } diff --git a/src/bids/types/issues.js b/src/bids/types/issues.js index bf0b9dcf..6a1a7bc9 100644 --- a/src/bids/types/issues.js +++ b/src/bids/types/issues.js @@ -8,36 +8,43 @@ export class BidsHedIssue { * @type {Object} */ file + /** * The HED Issue object corresponding to this object. * @type {Issue} */ hedIssue + /** * The BIDS issue code. * @type {string} */ code + /** * The HED spec code for this issue. * @type {string} */ subCode + /** * The severity of this issue. * @type {string} */ severity + /** * The issue message for this issue. * @type {string} */ issueMessage + /** * The line at which the issue was found. * @type {number} */ line + /** * The location of the file at which the issue was found. * @type {string} diff --git a/src/bids/types/json.js b/src/bids/types/json.js index d384419b..f4a2db78 100644 --- a/src/bids/types/json.js +++ b/src/bids/types/json.js @@ -1,6 +1,5 @@ import isPlainObject from 'lodash/isPlainObject' -import { sidecarValueHasHed } from '../utils' import { parseHedString } from '../../parser/parser' import ParsedHedString from '../../parser/parsedHedString' import { BidsFile } from './file' @@ -21,6 +20,7 @@ export class BidsJsonFile extends BidsFile { jsonData /** + * Constructor. * * @param {string} name - The name of the JSON file. * @param {Object} file - The object representing this file. @@ -34,19 +34,19 @@ export class BidsJsonFile extends BidsFile { export class BidsSidecar extends BidsJsonFile { /** - * The extracted keys for this bidsFile (string --> BidsSidecarKey) + * The extracted keys for this sidecar (string --> BidsSidecarKey) * @type {Map} */ sidecarKeys /** - * The extracted HED data for this bidsFile (string --> string | Object: string, string + * The extracted HED data for this sidecar (string --> string | Object: string, string * @type {Map} */ hedData /** - * The parsed HED data for this bidsFile (string --> ParsedHedString | Map: string --> ParsedHedString). + * The parsed HED data for this sidecar (string --> ParsedHedString | Map: string --> ParsedHedString). * @type {Map} */ parsedHedData @@ -84,7 +84,7 @@ export class BidsSidecar extends BidsJsonFile { /** * Constructor. * - * @param {string} name The name of the bidsFile file. + * @param {string} name The name of the sidecar file. * @param {Object} file The file object representing this file. * @param {Object} sidecarData The raw JSON data. * @param {DefinitionManager } defManager - The external definitions to use @@ -93,12 +93,12 @@ export class BidsSidecar extends BidsJsonFile { super(name, file, sidecarData) this.columnSpliceMapping = new Map() this.columnSpliceReferences = new Set() - this._setDefinitions(defManager) - this._filterHedStrings() - this._categorizeHedStrings() + this.#setDefinitions(defManager) + this.#filterHedStrings() + this.#categorizeHedStrings() } - _setDefinitions(defManager) { + #setDefinitions(defManager) { if (defManager instanceof DefinitionManager) { this.definitions = defManager } else if (!defManager) { @@ -111,10 +111,10 @@ export class BidsSidecar extends BidsJsonFile { } /** - * Create the bidsFile key map from the JSON. + * Create the sidecar key map from the JSON. * @private */ - _filterHedStrings() { + #filterHedStrings() { this.sidecarKeys = new Map( Object.entries(this.jsonData) .map(([key, value]) => { @@ -125,17 +125,28 @@ export class BidsSidecar extends BidsJsonFile { IssueError.generateAndThrow('illegalSidecarHedKey') } - if (sidecarValueHasHed(value)) { + if (BidsSidecar.#sidecarValueHasHed(value)) { return [trimmedKey, new BidsSidecarKey(trimmedKey, value.HED, this)] } - this._verifyKeyHasNoDeepHed(key, value) + BidsSidecar.#verifyKeyHasNoDeepHed(key, value) return null }) .filter(Boolean), ) } + /** + * Determine whether a sidecar value has HED data. + * + * @param {Object} sidecarValue A BIDS sidecar value. + * @returns {boolean} Whether the sidecar value has HED data. + * @private + */ + static #sidecarValueHasHed(sidecarValue) { + return sidecarValue !== null && typeof sidecarValue === 'object' && sidecarValue.HED !== undefined + } + /** * Verify that a column has no deeply nested "HED" keys. * @@ -144,7 +155,7 @@ export class BidsSidecar extends BidsJsonFile { * @throws {IssueError} If an invalid "HED" key is found. * @private */ - _verifyKeyHasNoDeepHed(key, value) { + static #verifyKeyHasNoDeepHed(key, value) { if (key.toUpperCase() === 'HED') { IssueError.generateAndThrow('illegalSidecarHedDeepKey') } @@ -152,7 +163,7 @@ export class BidsSidecar extends BidsJsonFile { return } for (const [subkey, subvalue] of Object.entries(value)) { - this._verifyKeyHasNoDeepHed(subkey, subvalue) + BidsSidecar.#verifyKeyHasNoDeepHed(subkey, subvalue) } } @@ -160,7 +171,7 @@ export class BidsSidecar extends BidsJsonFile { * Categorize the column strings into value strings and categorical strings * @private */ - _categorizeHedStrings() { + #categorizeHedStrings() { this.hedValueStrings = [] this.hedCategoricalStrings = [] this.hedData = new Map() @@ -185,7 +196,7 @@ export class BidsSidecar extends BidsJsonFile { } /** - * Parse this bidsFile's HED strings within the bidsFile structure. + * Parse this sidecar's HED strings within the sidecar structure. * * The parsed strings are placed into {@link parsedHedData}. * @@ -206,42 +217,42 @@ export class BidsSidecar extends BidsJsonFile { this.parsedHedData.set(name, sidecarKey.parsedCategoryMap) } } - this._generateSidecarColumnSpliceMap() + this.#generateSidecarColumnSpliceMap() return [errors, warnings] } /** - * Generate a mapping of an individual BIDS bidsFile's curly brace references. + * Generate a mapping of an individual BIDS sidecar's curly brace references. * * @private */ - _generateSidecarColumnSpliceMap() { + #generateSidecarColumnSpliceMap() { this.columnSpliceMapping = new Map() this.columnSpliceReferences = new Set() for (const [sidecarKey, hedData] of this.parsedHedData) { if (hedData instanceof ParsedHedString) { - this._parseValueSplice(sidecarKey, hedData) + this.#parseValueSplice(sidecarKey, hedData) } else if (hedData instanceof Map) { - this._parseCategorySplice(sidecarKey, hedData) + this.#parseCategorySplice(sidecarKey, hedData) } else if (hedData) { - IssueError.generateAndThrowInternalError('Unexpected type found in bidsFile parsedHedData map.') + IssueError.generateAndThrowInternalError('Unexpected type found in sidecar parsedHedData map.') } } } - _parseValueSplice(sidecarKey, hedData) { + #parseValueSplice(sidecarKey, hedData) { if (hedData.columnSplices.length > 0) { - const keyReferences = this._processColumnSplices(new Set(), hedData.columnSplices) + const keyReferences = this.#processColumnSplices(new Set(), hedData.columnSplices) this.columnSpliceMapping.set(sidecarKey, keyReferences) } } - _parseCategorySplice(sidecarKey, hedData) { + #parseCategorySplice(sidecarKey, hedData) { let keyReferences = null for (const valueString of hedData.values()) { if (valueString?.columnSplices.length > 0) { - keyReferences = this._processColumnSplices(keyReferences, valueString.columnSplices) + keyReferences = this.#processColumnSplices(keyReferences, valueString.columnSplices) } } if (keyReferences instanceof Set) { @@ -256,7 +267,7 @@ export class BidsSidecar extends BidsJsonFile { * @returns {Set} * @private */ - _processColumnSplices(keyReferences, columnSplices) { + #processColumnSplices(keyReferences, columnSplices) { keyReferences ??= new Set() for (const columnSplice of columnSplices) { keyReferences.add(columnSplice.originalTag) @@ -306,7 +317,7 @@ export class BidsSidecarKey { parsedValueString /** - * Weak reference to the bidsFile. + * Weak reference to the sidecar. * @type {BidsSidecar} */ sidecar @@ -322,7 +333,7 @@ export class BidsSidecarKey { * * @param {string} key The name of this key. * @param {string|Object} data The data for this key. - * @param {BidsSidecar} sidecar The parent bidsFile. + * @param {BidsSidecar} sidecar The parent sidecar. */ constructor(key, data, sidecar) { this.name = key @@ -347,13 +358,13 @@ export class BidsSidecarKey { */ parseHed(hedSchemas) { if (this.isValueKey) { - return this._parseValueString(hedSchemas) + return this.#parseValueString(hedSchemas) } - return this._parseCategory(hedSchemas) + return this.#parseCategory(hedSchemas) } /** - * Parse the value string in a bidsFile. + * Parse the value string in a sidecar. * * ### Note: * The value strings cannot contain definitions. @@ -362,7 +373,7 @@ export class BidsSidecarKey { * @returns {Array} - [Issue[], Issue[]] - Errors due for the value. * @private */ - _parseValueString(hedSchemas) { + #parseValueString(hedSchemas) { const [parsedString, errorIssues, warningIssues] = parseHedString(this.valueString, hedSchemas, false, true) this.parsedValueString = parsedString return [errorIssues, warningIssues] @@ -374,7 +385,7 @@ export class BidsSidecarKey { * @returns {Array} - Array[Issue[], Issue[]] A list of error issues and warning issues. * @private */ - _parseCategory(hedSchemas) { + #parseCategory(hedSchemas) { this.parsedCategoryMap = new Map() const errors = [] const warnings = [] @@ -393,7 +404,7 @@ export class BidsSidecarKey { warnings.push(...warningIssues) errors.push(...errorIssues) if (errorIssues.length === 0) { - errors.push(...this._checkDefinitions(parsedString)) + errors.push(...this.#checkDefinitions(parsedString)) } } return [errors, warnings] @@ -405,7 +416,7 @@ export class BidsSidecarKey { * @returns {Issue[]} - Errors that occur. * @private */ - _checkDefinitions(parsedString) { + #checkDefinitions(parsedString) { const errors = [] for (const group of parsedString.tagGroups) { if (!group.isDefinitionGroup) { diff --git a/src/bids/types/tsv.js b/src/bids/types/tsv.js index b0524d2a..bc875392 100644 --- a/src/bids/types/tsv.js +++ b/src/bids/types/tsv.js @@ -23,7 +23,7 @@ export class BidsTsvFile extends BidsFile { hedColumnHedStrings /** - * The pseudo-bidsFile object representing the merged bidsFile data. + * The pseudo-sidecar object representing the merged sidecar data. * @type {BidsSidecar} */ mergedSidecar @@ -34,7 +34,7 @@ export class BidsTsvFile extends BidsFile { * @param {string} name - The name of the TSV file. * @param {Object} file - The file object representing this file. * @param {{headers: string[], rows: string[][]}|Map|string} tsvData - This file's TSV data. - * @param {Object} mergedDictionary - The merged bidsFile data. + * @param {Object} mergedDictionary - The merged sidecar data. * @param {DefinitionManager} defManager - The definition manager for this file. */ constructor(name, file, tsvData, mergedDictionary = {}, defManager = undefined) { diff --git a/src/bids/utils.js b/src/bids/utils.js deleted file mode 100644 index b12f327e..00000000 --- a/src/bids/utils.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Determine whether a bidsFile value has HED data. - * - * @param {Object} sidecarValue A BIDS bidsFile value. - * @returns {boolean} Whether the bidsFile value has HED data. - */ -export const sidecarValueHasHed = function (sidecarValue) { - return sidecarValue !== null && typeof sidecarValue === 'object' && sidecarValue.HED !== undefined -} diff --git a/src/bids/validator/sidecarValidator.js b/src/bids/validator/sidecarValidator.js index 7a4b0743..45ad6608 100644 --- a/src/bids/validator/sidecarValidator.js +++ b/src/bids/validator/sidecarValidator.js @@ -17,7 +17,7 @@ export class BidsHedSidecarValidator extends BidsValidator { /** * Constructor for the BidsHedSidecarValidator. * - * @param {BidsSidecar} sidecar - The BIDS bidsFile being validated. + * @param {BidsSidecar} sidecar - The BIDS sidecar being validated. * @param {Schemas} hedSchemas - The schemas used for the sidecar validation. */ constructor(sidecar, hedSchemas) { @@ -26,7 +26,7 @@ export class BidsHedSidecarValidator extends BidsValidator { } /** - * Validate a BIDS JSON bidsFile file. Errors and warnings are stored. + * Validate a BIDS JSON sidecar file. Errors and warnings are stored. * */ validate() { @@ -42,7 +42,7 @@ export class BidsHedSidecarValidator extends BidsValidator { } /** - * Validate this bidsFile's HED strings. + * Validate this sidecar's HED strings. * * @returns {BidsHedIssue[]} All issues found. */ @@ -59,7 +59,7 @@ export class BidsHedSidecarValidator extends BidsValidator { issues.push(...this._checkDetails(sidecarKeyName, valueString)) } } else { - IssueError.generateAndThrowInternalError('Unexpected type found in bidsFile parsedHedData map.') + IssueError.generateAndThrowInternalError('Unexpected type found in sidecar parsedHedData map.') } } return issues @@ -127,7 +127,7 @@ export class BidsHedSidecarValidator extends BidsValidator { } /** - * Validate this bidsFile's curly braces -- checking recursion and missing columns. + * Validate this sidecar's curly braces -- checking recursion and missing columns. * * @returns {BidsHedIssue[]} All issues found. */ diff --git a/src/bids/validator/tsvValidator.js b/src/bids/validator/tsvValidator.js index 41f88829..3bbb5296 100644 --- a/src/bids/validator/tsvValidator.js +++ b/src/bids/validator/tsvValidator.js @@ -38,10 +38,9 @@ export class BidsHedTsvValidator extends BidsValidator { /** * Validate a BIDS TSV file. This method returns the complete issue list for convenience. - * */ validate() { - // Validate the BIDS bidsFile if it exists and return if there are errors + // Validate the BIDS sidecar if it exists and return if there are errors if (this.tsvFile.mergedSidecar) { const issues = this.tsvFile.mergedSidecar.validate(this.hedSchemas) const splitErrors = BidsHedIssue.splitErrors(issues) @@ -161,7 +160,7 @@ export class BidsHedTsvValidator extends BidsValidator { } /** - * Validate the HED data in a combined event TSV file/bidsFile BIDS data collection. + * Validate the HED data in a combined event TSV file/sidecar BIDS data collection. */ validateDataset(elements) { // Final top-tag detection cannot be done until the strings are fully assembled and finalized. @@ -298,11 +297,13 @@ export class BidsHedTsvParser { static internalCommaRegEx = /,\s*,/g static leadingCommaRegEx = /^\s*,+\s*/ static trailingCommaRegEx = /\s*,+\s*$/ + /** * The BIDS TSV file being parsed. * @type {BidsTsvFile} */ tsvFile + /** * The HED schema collection being parsed against. * @type {Schemas} @@ -321,7 +322,7 @@ export class BidsHedTsvParser { } /** - * Combine the BIDS bidsFile HED data into a BIDS TSV file's HED data. + * Combine the BIDS sidecar HED data into a BIDS TSV file's HED data. * * @returns {Array} - Returns a two-element array [BidsTsvElement[], BidsHedIssue[], BidsHedIssue[]]. */ @@ -435,7 +436,7 @@ export class BidsHedTsvParser { * Generate a mapping from tsv columns to strings (may have splices in the strings) * * @param {Map} rowCells - The column-to-value mapping for a single row. - * @returns {Map} - A mapping of column names to their corresponding parsed bidsFile strings. + * @returns {Map} - A mapping of column names to their corresponding parsed sidecar strings. * @private */ _getColumnMapping(rowCells) { @@ -449,7 +450,7 @@ export class BidsHedTsvParser { return columnMap } - // Check for the columns with HED data in the bidsFile + // Check for the columns with HED data in the sidecar for (const [columnName, columnValues] of this.tsvFile.mergedSidecar.parsedHedData.entries()) { if (!rowCells.has(columnName)) { continue diff --git a/src/bids/validator/validator.js b/src/bids/validator/validator.js index f3354932..0af0b144 100644 --- a/src/bids/validator/validator.js +++ b/src/bids/validator/validator.js @@ -22,7 +22,7 @@ export class BidsValidator { warnings /** - * Bids validator base class. + * Constructor. * * @param {Schemas} hedSchemas - The HED schemas used for validation. */ diff --git a/tests/bidsTests.spec.js b/tests/bidsTests.spec.js index 9bc0943c..5efd1b7e 100644 --- a/tests/bidsTests.spec.js +++ b/tests/bidsTests.spec.js @@ -14,7 +14,7 @@ import { DefinitionManager } from '../src/parser/definitionManager' //const skipMap = new Map([['definition-tests', ['invalid-missing-definition-for-def', 'invalid-nested-definition']]]) const skipMap = new Map() const runAll = true -const runMap = new Map([['curly-brace-tests', ['valid-curly-brace-in-bidsFile-with-value-splice']]]) +const runMap = new Map([['curly-brace-tests', ['valid-curly-brace-in-sidecar-with-value-splice']]]) describe('BIDS validation', () => { const schemaMap = new Map([['8.3.0', undefined]]) @@ -52,7 +52,7 @@ describe('BIDS validation', () => { `${header}: input definitions "${test.definitions}" have conflicts "${defAddIssues}"`, ) - // Validate the bidsFile by itself + // Validate the sidecar by itself const sidecarName = test.testname + '.json' const bidsSidecar = new BidsSidecar( 'thisOne', @@ -67,7 +67,7 @@ describe('BIDS validation', () => { const sidecarIssues = bidsSidecar.validate(thisSchema) assertErrors(test, 'Sidecar only', test.sidecarErrors, sidecarIssues) - // Validate the events file with no bidsFile + // Validate the events file with no sidecar const eventName = test.testname + '.tsv' const parsedTsv = parseTSV(test.eventsString) assert.instanceOf(parsedTsv, Map, `${eventName} cannot be parsed`) @@ -86,7 +86,7 @@ describe('BIDS validation', () => { const noSideIssues = bidsTsv.validate(thisSchema) assertErrors(test, 'Events', test.tsvErrors, noSideIssues) - // Validate the events file with the bidsFile (use the definitions from the bidsFile) + // Validate the events file with the sidecar (use the definitions from the sidecar) const defManager3 = new DefinitionManager() defManager3.addDefinitions(defList) const bidsTsvSide = new BidsTsvFile( diff --git a/tests/testData/bidsTests.data.js b/tests/testData/bidsTests.data.js index 9ff556b4..48929f59 100644 --- a/tests/testData/bidsTests.data.js +++ b/tests/testData/bidsTests.data.js @@ -8,7 +8,7 @@ export const bidsTestData = [ tests: [ { testname: 'no-hed-at-all-but-both-tsv-json-non-empty', - explanation: 'Neither the bidsFile or tsv has HED but neither non-empty', + explanation: 'Neither the sidecar or tsv has HED but neither non-empty', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -38,7 +38,7 @@ export const bidsTestData = [ }, { testname: 'empty-json-empty-tsv', - explanation: 'Both bidsFile and tsv are empty except for white space', + explanation: 'Both sidecar and tsv are empty except for white space', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: {}, @@ -92,7 +92,7 @@ export const bidsTestData = [ tests: [ { testname: 'invalid-bad-tag-in-tsv', - explanation: 'Unrelated bidsFile is valid but HED column tag is invalid', + explanation: 'Unrelated sidecar is valid but HED column tag is invalid', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -173,8 +173,8 @@ export const bidsTestData = [ ], }, { - testname: 'valid-bidsFile-tsv-curly-brace', - explanation: 'The bidsFile is valid, but tsv HED column has braces}', + testname: 'valid-sidecar-tsv-curly-brace', + explanation: 'The sidecar is valid, but tsv HED column has braces}', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -188,14 +188,14 @@ export const bidsTestData = [ sidecarErrors: [], tsvErrors: [ BidsHedIssue.fromHedIssue(generateIssue('curlyBracesInHedColumn', { string: 'Red,{blue}', tsvLine: '2' }), { - path: 'valid-bidsFile-tsv-curly-brace.tsv', - relativePath: 'valid-bidsFile-tsv-curly-brace.tsv', + path: 'valid-sidecar-tsv-curly-brace.tsv', + relativePath: 'valid-sidecar-tsv-curly-brace.tsv', }), ], comboErrors: [ BidsHedIssue.fromHedIssue(generateIssue('curlyBracesInHedColumn', { string: 'Red,{blue}', tsvLine: '2' }), { - path: 'valid-bidsFile-tsv-curly-brace.tsv', - relativePath: 'valid-bidsFile-tsv-curly-brace.tsv', + path: 'valid-sidecar-tsv-curly-brace.tsv', + relativePath: 'valid-sidecar-tsv-curly-brace.tsv', }), ], }, @@ -575,8 +575,8 @@ export const bidsTestData = [ description: 'Curly braces tested in various places', tests: [ { - testname: 'valid-curly-brace-in-bidsFile-with-value-splice', - explanation: 'Valid curly brace in bidsFile and valid value is spliced in', + testname: 'valid-curly-brace-in-sidecar-with-value-splice', + explanation: 'Valid curly brace in sidecar and valid value is spliced in', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -597,8 +597,8 @@ export const bidsTestData = [ comboErrors: [], }, { - testname: 'valid-curly-brace-in-bidsFile-with-tsv-n/a', - explanation: 'Valid curly brace in bidsFile and valid tsv with n/a', + testname: 'valid-curly-brace-in-sidecar-with-tsv-n/a', + explanation: 'Valid curly brace in sidecar and valid tsv with n/a', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -620,8 +620,8 @@ export const bidsTestData = [ comboErrors: [], }, { - testname: 'valid-curly-brace-in-bidsFile-with-category-splice', - explanation: 'Valid curly brace in bidsFile and valid value is spliced in', + testname: 'valid-curly-brace-in-sidecar-with-category-splice', + explanation: 'Valid curly brace in sidecar and valid value is spliced in', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -644,8 +644,8 @@ export const bidsTestData = [ comboErrors: [], }, { - testname: 'valid-curly-brace-in-bidsFile-with-n/a-splice', - explanation: 'Valid curly brace in bidsFile and but tsv splice entry is n/a', + testname: 'valid-curly-brace-in-sidecar-with-n/a-splice', + explanation: 'Valid curly brace in sidecar and but tsv splice entry is n/a', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -667,7 +667,7 @@ export const bidsTestData = [ }, { testname: 'valid-HED-column-splice', - explanation: 'Valid curly brace in bidsFile with valid HED column splice', + explanation: 'Valid curly brace in sidecar with valid HED column splice', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -689,7 +689,7 @@ export const bidsTestData = [ }, { testname: 'valid-HED-column-splice-with-n/a', - explanation: 'Valid curly brace in bidsFile with HED column entry n/a', + explanation: 'Valid curly brace in sidecar with HED column entry n/a', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -706,7 +706,7 @@ export const bidsTestData = [ }, { testname: 'valid-HED-curly-brace-but-tsv-has-no-HED-column', - explanation: 'A {HED} column splice is used in a bidsFile but the tsv has no HED column', + explanation: 'A {HED} column splice is used in a sidecar but the tsv has no HED column', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -789,7 +789,7 @@ export const bidsTestData = [ }, { testname: 'invalid-recursive-curly-braces', - explanation: 'Mutually recursive curly braces in bidsFile.', + explanation: 'Mutually recursive curly braces in sidecar.', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -842,7 +842,7 @@ export const bidsTestData = [ }, { testname: 'invalid-self-recursive-curly-braces', - explanation: 'Mutually recursive curly braces in bidsFile.', + explanation: 'Mutually recursive curly braces in sidecar.', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -923,7 +923,7 @@ export const bidsTestData = [ tests: [ { testname: 'valid-placeholder-used-in-tsv', - explanation: 'The bidsFile has a placeholder that is used in the tsv', + explanation: 'The sidecar has a placeholder that is used in the tsv', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -944,7 +944,7 @@ export const bidsTestData = [ }, { testname: 'valid-placeholder-not-used', - explanation: 'The bidsFile has a placeholder that is not used in the tsv', + explanation: 'The sidecar has a placeholder that is not used in the tsv', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -965,7 +965,7 @@ export const bidsTestData = [ }, { testname: 'invalid-no-placeholder-value-column', - explanation: 'The bidsFile has a value column with no placeholder tag', + explanation: 'The sidecar has a value column with no placeholder tag', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -996,7 +996,7 @@ export const bidsTestData = [ }, { testname: 'invalid-multiple-placeholders-in-value-column', - explanation: 'The bidsFile has a value column with no placeholder tag', + explanation: 'The sidecar has a value column with no placeholder tag', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1033,7 +1033,7 @@ export const bidsTestData = [ tests: [ { testname: 'valid-units-on-a-placeholder', - explanation: 'The bidsFile has invalid units on a placeholder', + explanation: 'The sidecar has invalid units on a placeholder', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1048,7 +1048,7 @@ export const bidsTestData = [ }, { testname: 'wrong-units-on-a-placeholder', - explanation: 'The bidsFile has wrong units on a placeholder', + explanation: 'The sidecar has wrong units on a placeholder', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1084,7 +1084,7 @@ export const bidsTestData = [ tests: [ { testname: 'valid-definition-no-placeholder', - explanation: 'Simple definition in bidsFile', + explanation: 'Simple definition in sidecar', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1104,7 +1104,7 @@ export const bidsTestData = [ }, { testname: 'valid-definition-with-placeholder', - explanation: 'Definition in bidsFile has a placeholder', + explanation: 'Definition in sidecar has a placeholder', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1124,7 +1124,7 @@ export const bidsTestData = [ }, { testname: 'valid-def-with-placeholder', - explanation: 'Def in bidsFile has a placeholder', + explanation: 'Def in sidecar has a placeholder', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1139,7 +1139,7 @@ export const bidsTestData = [ }, { testname: 'valid-definition-with-nested-placeholder', - explanation: 'Definition in bidsFile has nested placeholder', + explanation: 'Definition in sidecar has nested placeholder', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1159,7 +1159,7 @@ export const bidsTestData = [ }, { testname: 'valid-definition-no-group', - explanation: 'The bidsFile with definition that has no internal group.', + explanation: 'The sidecar with definition that has no internal group.', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1179,7 +1179,7 @@ export const bidsTestData = [ }, { testname: 'invalid-def-expand-no-group', - explanation: 'The bidsFile with definition that has no internal group.', + explanation: 'The sidecar with definition that has no internal group.', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1218,7 +1218,7 @@ export const bidsTestData = [ }, { testname: 'invalid-missing-definition-for-def', - explanation: 'The bidsFile uses a def with no definition', + explanation: 'The sidecar uses a def with no definition', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1249,7 +1249,7 @@ export const bidsTestData = [ }, { testname: 'invalid-missing-definition-for-def-expand', - explanation: 'The bidsFile uses a def-expand with no definition', + explanation: 'The sidecar uses a def-expand with no definition', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1280,7 +1280,7 @@ export const bidsTestData = [ }, { testname: 'invalid-nested-definition', - explanation: 'The bidsFile has a definition inside a definition', + explanation: 'The sidecar has a definition inside a definition', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1322,7 +1322,7 @@ export const bidsTestData = [ }, { testname: 'invalid-multiple-definition-tags', - explanation: 'The bidsFile has multiple definition tags in same definition', + explanation: 'The sidecar has multiple definition tags in same definition', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1364,7 +1364,7 @@ export const bidsTestData = [ }, { testname: 'invalid-definition-with-extra-groups', - explanation: 'The bidsFile has a definition with extra internal group', + explanation: 'The sidecar has a definition with extra internal group', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1406,7 +1406,7 @@ export const bidsTestData = [ }, { testname: 'invalid-definition-with-extra-sibling', - explanation: 'The bidsFile has a definition with an extra internal sibling', + explanation: 'The sidecar has a definition with an extra internal sibling', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1481,7 +1481,7 @@ export const bidsTestData = [ }, { testname: 'invalid-definition-with-missing-placeholder', - explanation: 'Definition in bidsFile has missing placeholder', + explanation: 'Definition in sidecar has missing placeholder', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1517,7 +1517,7 @@ export const bidsTestData = [ }, { testname: 'invalid-definition-with-fixed-placeholder', - explanation: 'Definition in bidsFile has a fixed value instead of placeholder', + explanation: 'Definition in sidecar has a fixed value instead of placeholder', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1557,7 +1557,7 @@ export const bidsTestData = [ }, { testname: 'invalid-definition-has-multiple-placeholders', - explanation: 'Definition in bidsFile has multiple placeholders', + explanation: 'Definition in sidecar has multiple placeholders', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -1597,7 +1597,7 @@ export const bidsTestData = [ }, { testname: 'invalid-definition-not-isolated', - explanation: 'Definition in bidsFile appears with other tags', + explanation: 'Definition in sidecar appears with other tags', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -2085,8 +2085,8 @@ export const bidsTestData = [ ], }, { - testname: 'delayed-onset-with-offset-before-with-bidsFile', - explanation: 'offset appears before an onset with a bidsFile in complex delayed scenario', + testname: 'delayed-onset-with-offset-before-with-sidecar', + explanation: 'offset appears before an onset with a sidecar in complex delayed scenario', schemaVersion: '8.3.0', definitions: ['(Definition/Acc/#, (Acceleration/# m-per-s^2, Red))', '(Definition/MyColor, (Label/Pie))'], sidecar: { @@ -2106,8 +2106,8 @@ export const bidsTestData = [ BidsHedIssue.fromHedIssue( generateIssue('inactiveOnset', { tag: 'Offset', definition: 'mycolor' }), { - path: 'delayed-onset-with-offset-before-with-bidsFile.tsv', - relativePath: 'delayed-onset-with-offset-before-with-bidsFile.tsv', + path: 'delayed-onset-with-offset-before-with-sidecar.tsv', + relativePath: 'delayed-onset-with-offset-before-with-sidecar.tsv', }, { tsvLine: '5' }, ),