Skip to content

Commit 1b1c191

Browse files
authored
Merge pull request #247 from VisLab/second-revision
Additional corrections of jsDoc for readthedocs
2 parents 0c05ebd + d8b02f9 commit 1b1c191

File tree

11 files changed

+38
-38
lines changed

11 files changed

+38
-38
lines changed

bids/types/tsv.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { IssueError } from '../../common/issues/issues'
1212
export class BidsTsvFile extends BidsFile {
1313
/**
1414
* This file's parsed TSV data.
15-
* @type {Map[]>}
15+
* @type {Map[]}
1616
*/
1717
parsedTsv
1818
/**
@@ -37,7 +37,7 @@ export class BidsTsvFile extends BidsFile {
3737
* @todo This interface is provisional and subject to modification in version 4.0.0.
3838
*
3939
* @param {string} name The name of the TSV file.
40-
* @param {{headers: string[], rows: string[][]}|Map[]>|string} tsvData This file's TSV data.
40+
* @param {{headers: string[], rows: string[][]|Map[]|string} tsvData This file's TSV data.
4141
* @param {object} file The file object representing this file.
4242
* @param {string[]} potentialSidecars The list of potential JSON sidecars.
4343
* @param {object} mergedDictionary The merged bidsFile data.

bids/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { generateIssue } from '../common/issues/issues'
77
*
88
* @param {BidsDataset} dataset The BIDS dataset.
99
* @param {SchemasSpec} schemaDefinition The version spec for the schema to be loaded.
10-
* @returns {Promise of BidsIssue[]} Any issues found.
10+
* @returns {Promise} A promise for list of Any issues found.
1111
*/
1212
export async function validateBidsDataset(dataset, schemaDefinition) {
1313
const validator = new BidsHedValidator(dataset, schemaDefinition)

bids/validator/tsvValidator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export class BidsHedTsvParser {
331331
/**
332332
* Generate a list of rows with column-to-value mappings.
333333
*
334-
* @returns {Map[]} A list of single-row column-to-value mappings.
334+
* @returns {Array.Map} A list of single-row column-to-value mappings.
335335
* @private
336336
*/
337337
_generateHedRows() {

common/issues/issues.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ export class Issue {
6363
*/
6464
message
6565
/**
66-
* The parameters to the error message template.
67-
* @type {Object<string, (string|number[])>}
66+
* The parameters to the error message template. Object with string and map parameters.
67+
* @type {Object}
6868
*/
6969
parameters
7070

@@ -73,7 +73,7 @@ export class Issue {
7373
* @param {string} internalCode The internal error code.
7474
* @param {string} hedCode The HED 3 error code.
7575
* @param {string} level The issue level (error or warning).
76-
* @param {Object<string, (string|number[])>} parameters The error string parameters.
76+
* @param {Object} parameters The error string parameters.
7777
*/
7878
constructor(internalCode, hedCode, level, parameters) {
7979
this.internalCode = internalCode
@@ -134,7 +134,7 @@ export class Issue {
134134
* Return a tuple with a boolean denoting overall validity and all issues.
135135
*
136136
* @param {Issue[]} issues A list of issues.
137-
* @returns {[boolean, Issue[]]} Whether the validation succeeded (i.e. any errors were found), and all issues (both errors and warnings).
137+
* @returns {boolean, Issue[]} Whether the validation succeeded (i.e. any errors were found), and all issues (both errors and warnings).
138138
*/
139139
static issueListWithValidStatus(issues) {
140140
return [!issues.some((issue) => issue.isError()), issues]
@@ -145,7 +145,7 @@ export class Issue {
145145
* Generate a new issue object.
146146
*
147147
* @param {string} internalCode The internal error code.
148-
* @param {Object<string, (string|number[])>} parameters The error string parameters.
148+
* @param {Object} parameters The error string parameters.
149149
* @returns {Issue} An object representing the issue.
150150
*/
151151
export const generateIssue = function (internalCode, parameters) {

docs/source/bids.types.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
types
22
==============================
3-
.. js:autoclass:: BidsDataset
3+
.. js:autoclass:: dataset.BidsDataset
44
:members:
55

6-
.. js:autoclass:: BidsFile
6+
.. js:autoclass:: file.BidsFile
77
:members:
88

9-
.. js:autoclass:: BidsHedIssue
9+
.. js:autoclass:: issues.BidsHedIssue
1010
:members:
1111

12-
.. js:autoclass:: BidsIssue
12+
.. js:autoclass:: issues.idsIssue
1313
:members:
1414

15-
.. js:autoclass:: BidsJsonFile
15+
.. js:autoclass:: json.BidsJsonFile
1616
:members:
1717

18-
.. js:autoclass:: BidsSidecar
18+
.. js:autoclass:: json.BidsSidecar
1919
:members:
2020

21-
.. js:autoclass:: BidsSidecarKey
21+
.. js:autoclass:: json.BidsSidecarKey
2222
:members:
2323

24-
.. js:autoclass:: BidsTsvElement
24+
.. js:autoclass:: tsv.idsTsvElement
2525
:members:
2626

27-
.. js:autoclass:: BidsTsvFile
27+
.. js:autoclass:: tsv.BidsTsvFile
2828
:members:
2929

30-
.. js:autoclass:: BidsTsvRow
30+
.. js:autoclass:: tsv.BidsTsvRow
3131
:members:

parser/definitionManager.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class Definition {
5454
* @param {ParsedHedTag} tag - The parsed HEd tag whose details should be checked.
5555
* @param {Schemas} hedSchema - The HED schemas used to validate against.
5656
* @param {boolean} placeholderAllowed - If true then placeholder is allowed in the def tag.
57-
* @returns {[string | null, Issue[]]} - The evaluated normalized definition string and any issues in the evaluation,
57+
* @returns {string | null, Issue[]} - The evaluated normalized definition string and any issues in the evaluation,
5858
*/
5959
evaluateDefinition(tag, hedSchema, placeholderAllowed) {
6060
// Check that the level of the value of tag agrees with the definition
@@ -106,7 +106,7 @@ export class Definition {
106106
*
107107
* @param {string} hedString - A list of string definitions.
108108
* @param {Schemas} hedSchemas - The HED schemas to use in creation.
109-
* @returns { [Definition, Issue[]]} - The Definition list and any issues found.
109+
* @returns {Definition, Issue[]} - The Definition list and any issues found.
110110
*/
111111
static createDefinition(hedString, hedSchemas) {
112112
const [parsedString, issues] = parseHedString(hedString, hedSchemas, true, true)
@@ -122,7 +122,7 @@ export class Definition {
122122
/**
123123
* Create a definition from a ParsedHedGroup.
124124
* @param {ParsedHedGroup} group - The group to create a definition from.
125-
* @returns { [Definition, Issue[]]} - The definition and any issues. (The definition will be null if issues.)
125+
* @returns {Definition, Issue[]} - The definition and any issues. (The definition will be null if issues.)
126126
*/
127127
static createDefinitionFromGroup(group) {
128128
const def = new Definition(group)
@@ -135,7 +135,7 @@ export class Definition {
135135

136136
export class DefinitionManager {
137137
/**
138-
* @type { Map<string, Definition>} - Definitions for this manager.
138+
* @type {Map} - Definitions for this manager (string --> Definition).
139139
*/
140140
definitions
141141

@@ -183,7 +183,7 @@ export class DefinitionManager {
183183
* @param {ParsedHedString} hedString - A parsed HED string to be checked.
184184
* @param {Schemas} hedSchemas - Schemas to validate against.
185185
* @param {boolean} placeholderAllowed - If true then placeholder is allowed in the def tag.
186-
* @returns {Issue []} - If there is no matching definition or definition applied incorrectly.
186+
* @returns {Issue[]} - If there is no matching definition or definition applied incorrectly.
187187
*/
188188
validateDefs(hedString, hedSchemas, placeholderAllowed) {
189189
const defTags = filterByTagName(hedString.tags, 'Def')
@@ -202,7 +202,7 @@ export class DefinitionManager {
202202
* @param {ParsedHedString} hedString - A parsed HED string to be checked.
203203
* @param {Schemas} hedSchemas - Schemas to validate against.
204204
* @param {boolean} placeholderAllowed - If true then placeholder is allowed in the def tag.
205-
* @returns {Issue []} - If there is no matching definition or definition applied incorrectly.
205+
* @returns {Issue[]} - If there is no matching definition or definition applied incorrectly.
206206
*/
207207
validateDefExpands(hedString, hedSchemas, placeholderAllowed) {
208208
//Def-expand tags should be rare, so don't look if there aren't any Def-expand tags
@@ -222,7 +222,7 @@ export class DefinitionManager {
222222
* @param {ParsedHedTag} tag - The tag to evaluate against the definitions.
223223
* @param {Schemas} hedSchemas - The schemas to be used to assist in the evaluation.
224224
* @param {boolean} placeholderAllowed - If true then placeholder is allowed in the def tag.
225-
* @returns {[string, Issue[]]} - The evaluated definition contents with this tag and any issues.
225+
* @returns {string, Issue[]} - The evaluated definition contents with this tag and any issues.
226226
*
227227
* Note: If the tag is not a Def or Def-expand, this returns null for the string and [] for the issues.
228228
*/
@@ -277,7 +277,7 @@ export class DefinitionManager {
277277
/**
278278
* Find the definition associated with a tag, if any
279279
* @param {ParsedHedTag} tag - The parsed HEd tag to be checked.
280-
* @returns {[Definition | null, Issue []]} - If there is no matching definition.
280+
* @returns {Definition | null, Issue[]} - If there is no matching definition.
281281
*/
282282
findDefinition(tag) {
283283
if (tag.schemaTag._name !== 'Def' && tag.schemaTag.name !== 'Def-expand') {
@@ -300,7 +300,7 @@ export class DefinitionManager {
300300
*
301301
* @param {string[]} defStrings - A list of string definitions.
302302
* @param {Schemas} hedSchemas - The HED schemas to use in creation.
303-
* @returns { [Definition[], Issue[]]} - The Definition list and any issues found.
303+
* @returns {Definition[], Issue[]} - The Definition list and any issues found.
304304
*/
305305
static createDefinitions(defStrings, hedSchemas) {
306306
const defList = []

parser/parsedHedTag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export default class ParsedHedTag extends ParsedHedSubstring {
154154
*
155155
* @param {SchemaTag} schemaTag - The part of the tag that is in the schema.
156156
* @param {string} remainder - The leftover part.
157-
* @returns {[SchemaUnit, string, string]} - The actual Unit, the unit string and the value string.
157+
* @returns {SchemaUnit, string, string} - The actual Unit, the unit string and the value string.
158158
* @throws {IssueError} If parsing the remainder section fails.
159159
*/
160160
_separateUnits(schemaTag, remainder) {

parser/parser.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class HedStringParser {
4848

4949
/**
5050
* Parse a full HED string.
51-
* @returns {[ParsedHedString|null, Issue[]]} The parsed HED string and any parsing issues.
51+
* @returns {ParsedHedString|null, Issue[]} The parsed HED string and any parsing issues.
5252
*/
5353
parseHedString() {
5454
if (this.hedString === null || this.hedString === undefined) {
@@ -115,7 +115,7 @@ class HedStringParser {
115115
* @param {Schemas} hedSchemas The collection of HED schemas.
116116
* @param {boolean} definitionsAllowed - True if definitions are allowed
117117
* @param {boolean} placeholdersAllowed - True if placeholders are allowed
118-
* @returns {[ParsedHedString[], Issue[]]} The parsed HED strings and any issues found.
118+
* @returns {ParsedHedString[], Issue[]} The parsed HED strings and any issues found.
119119
*/
120120
static parseHedStrings(hedStrings, hedSchemas, definitionsAllowed, placeholdersAllowed) {
121121
if (!hedSchemas) {
@@ -145,7 +145,7 @@ class HedStringParser {
145145
* @param {Schemas} hedSchemas - The collection of HED schemas.
146146
* @param {boolean} definitionsAllowed - True if definitions are allowed
147147
* @param {boolean} placeholdersAllowed - True if placeholders are allowed
148-
* @returns {[ParsedHedString, Issue[]]} - The parsed HED string and any issues found.
148+
* @returns {ParsedHedString, Issue[]} - The parsed HED string and any issues found.
149149
*/
150150
export function parseHedString(hedString, hedSchemas, definitionsAllowed, placeholdersAllowed) {
151151
return new HedStringParser(hedString, hedSchemas, definitionsAllowed, placeholdersAllowed).parseHedString()

parser/reservedChecker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class ReservedChecker {
161161
*
162162
* @param {ParsedHedGroup} group - The enclosing tag group.
163163
* @param {ParsedHedTag} reservedTag - The reserved tag whose tag requirements are to be checked.
164-
* @param { Object } requirements - The requirements for this reserved tag.
164+
* @param {Object} requirements - The requirements for this reserved tag.
165165
* @returns {Issue[]} - Issues because
166166
* @private
167167
*/
@@ -205,7 +205,7 @@ export class ReservedChecker {
205205
*
206206
* @param {ParsedHedGroup} group - The enclosing tag group.
207207
* @param {ParsedHedTag} reservedTag - The reserved tag whose tag requirements are to be checked.
208-
* @param { Object } requirements - The requirements for this reserved tag.
208+
* @param {Object} requirements - The requirements for this reserved tag.
209209
* @returns {Issue[]}
210210
* @private
211211
*/
@@ -232,7 +232,7 @@ export class ReservedChecker {
232232
* @param {ParsedHedTag} reservedTag - The reserved tags whose requirements are used.
233233
* @param {Number | null} minLimit - The minimum number of non-def groups required or null if no requirement.
234234
* @param {Number} defAdjustment - Either 0 or 1 depending on whether a def-expand is included.
235-
* @returns {Issue[]|*[]} - Returns an issue list if the count requirement is violated.
235+
* @returns {Issue[]} - Returns an issue list if the count requirement is violated.
236236
* @private
237237
*/
238238
_checkMinGroupCount(group, reservedTag, minLimit, defAdjustment) {

parser/splitter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default class HedStringSplitter {
3434
/**
3535
* Split and parse a HED string into tags and groups.
3636
*
37-
* @returns {[ParsedHedSubstring[], Issue[]]} The parsed HED string data and any issues found.
37+
* @returns {ParsedHedSubstring[], Issue[]} The parsed HED string data and any issues found.
3838
*/
3939
splitHedString() {
4040
if (this.hedString === null || this.hedString === undefined || typeof this.hedString !== 'string') {
@@ -56,7 +56,7 @@ export default class HedStringSplitter {
5656
*
5757
* @param {TagSpec[]} tagSpecs The tag specifications.
5858
* @param {GroupSpec} groupSpecs The group specifications.
59-
* @returns {[ParsedHedSubstring[], Issue[]]} The parsed HED tags and any issues.
59+
* @returns {ParsedHedSubstring[], Issue[]} The parsed HED tags and any issues.
6060
*/
6161
_createParsedTags(tagSpecs, groupSpecs) {
6262
// Create tags from specifications

0 commit comments

Comments
 (0)