Skip to content

Commit

Permalink
Additional cleanup of unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
VisLab committed Dec 23, 2024
1 parent 3dd3a15 commit 346d59c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 167 deletions.
39 changes: 18 additions & 21 deletions bids/types/tsv.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,29 @@ export class BidsTsvElement {
*/
hedString

/**
* The ParsedHedString representation of this row
* @type {ParsedHedString}
*/
parsedHedString

/**
* The file this row belongs to.
* The file this row belongs to (usually just the path).
* @type {Object}
*/
file

/**
* The onset represented by this row or a NaN.
* @type {Number}
*/
onset

/**
* The line number(s) (including the header) represented by this row.
*/
tsvLine

/**
* Constructor.
*
Expand Down Expand Up @@ -141,7 +153,12 @@ export class BidsTsvElement {
* A row in a BIDS TSV file.
*/
export class BidsTsvRow extends BidsTsvElement {
/**
* The map of column name to value for this row.
* @type {Map<string, string>}
*/
rowCells

/**
* Constructor.
*
Expand All @@ -156,23 +173,3 @@ export class BidsTsvRow extends BidsTsvElement {
this.rowCells = rowCells
}
}

/**
* A BIDS events.tsv file.
*
* @deprecated Use {@link BidsTsvFile}. Will be removed in version 4.0.0.
*/
export class BidsEventFile extends BidsTsvFile {
/**
* Constructor.
*
* @param {string} name The name of the event TSV file.
* @param {string[]} potentialSidecars The list of potential JSON sidecars.
* @param {object} mergedDictionary The merged sidecar data.
* @param {{headers: string[], rows: string[][]}|string} tsvData This file's TSV data.
* @param {object} file The file object representing this file.
*/
constructor(name, potentialSidecars, mergedDictionary, tsvData, file) {
super(name, tsvData, file, potentialSidecars, mergedDictionary)
}
}
35 changes: 0 additions & 35 deletions tests/utils/map.spec.js

This file was deleted.

17 changes: 0 additions & 17 deletions utils/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,3 @@ export function recursiveMap(fn, array) {
return fn(array)
}
}

// /**
// * Apply a function recursively to an array.
// *
// * @template T,U
// * @param {function(T, U[]): U} fn The function to apply.
// * @param {T[]} array The array to map.
// * @param {U[]} [issues] An optional array to collect issues.
// * @returns {U[]} The mapped array.
// */
// export function recursiveMapNew(fn, array, issues = []) {
// if (Array.isArray(array)) {
// return array.map((element) => recursiveMap(fn, element, issues))
// } else {
// return fn(array, issues)
// }
// }
32 changes: 0 additions & 32 deletions utils/hedData.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import lt from 'semver/functions/lt'
//
// import ParsedHedTag from '../parser/parsedHedTag'
// import { TagSpec } from '../parser/tokenizer'

/**
* Determine the HED generation for a base schema version number.
Expand All @@ -18,32 +15,3 @@ export const getGenerationForSchemaVersion = function (version) {
return 3
}
}

// export const mergeParsingIssues = function (previousIssues, currentIssues) {
// for (const [key, currentIssue] of Object.entries(currentIssues)) {
// previousIssues[key] = previousIssues[key] !== undefined ? previousIssues[key].concat(currentIssue) : currentIssue
// }
// }

// /**
// * Get the parent tag objects for a given short tag.
// *
// * @param {Schemas} hedSchemas The HED schema collection.
// * @param {string} shortTag A short-form HED 3 tag.
// * @returns {Map<Schema, ParsedHedTag>} A Map mapping a {@link Schema} to a {@link ParsedHedTag} object representing the full tag.
// */
// export const getParsedParentTags = function (hedSchemas, shortTag) {
// const parentTags = new Map()
// for (const [schemaNickname, schema] of hedSchemas.schemas) {
// try {
// const parentTag = new ParsedHedTag(
// new TagSpec(shortTag, 0, shortTag.length - 1, schemaNickname),
// hedSchemas,
// shortTag,
// )
// parentTags.set(schema, parentTag)
// // eslint-disable-next-line no-empty
// } catch (e) {}
// }
// return parentTags
// }
11 changes: 0 additions & 11 deletions utils/hedStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,6 @@ export const getTagSlashIndices = function (tag) {
return indices
}

// /**
// * Get the levels of a tag.
// *
// * @param {string} tag A HED tag string.
// * @returns {string[]} The levels of this tag.
// */
// export const getTagLevels = function (tag) {
// const tagSlashIndices = getTagSlashIndices(tag)
// return tagSlashIndices.map((tagSlashIndex) => tag.slice(0, tagSlashIndex))
// }

/**
* Get the last part of a HED tag.
*
Expand Down
51 changes: 0 additions & 51 deletions utils/map.js

This file was deleted.

0 comments on commit 346d59c

Please sign in to comment.