Skip to content

Commit

Permalink
feat: Add values to associations.bvals, fix misnamed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed May 2, 2024
1 parent 95ba32f commit 7a1a22a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions bids-validator/src/schema/associations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ const associationLookup = {
inherit: true,
load: async (file: BIDSFile): Promise<ContextAssociations['bval']> => {
const contents = await file.text()
const columns = parseBvalBvec(contents)
const rows = parseBvalBvec(contents)
return {
path: file.path,
n_cols: columns ? columns[0].length : 0,
n_rows: columns ? columns.length : 0,
n_cols: rows ? rows[0].length : 0,
n_rows: rows ? rows.length : 0,
values: rows[0],
}
},
},
Expand All @@ -96,11 +97,11 @@ const associationLookup = {
inherit: true,
load: async (file: BIDSFile): Promise<ContextAssociations['bvec']> => {
const contents = await file.text()
const columns = parseBvalBvec(contents)
const rows = parseBvalBvec(contents)
return {
path: file.path,
n_cols: columns ? columns[0].length : 0,
n_rows: columns ? columns.length : 0,
n_cols: rows ? rows[0].length : 0,
n_rows: rows ? rows.length : 0,
}
},
},
Expand Down
1 change: 1 addition & 0 deletions bids-validator/src/types/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface ContextAssociationsBval {
path: string
n_cols: number
n_rows: number
values: number[]
}
export interface ContextAssociationsBvec {
path: string
Expand Down

0 comments on commit 7a1a22a

Please sign in to comment.