Skip to content

Commit

Permalink
Merge pull request #1823 from effigies/fix/deno-build
Browse files Browse the repository at this point in the history
FIX: Un-define the unspecified Context.data
  • Loading branch information
rwblair authored Oct 4, 2023
2 parents da75d00 + 65bdbc8 commit 0fb4ca3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
25 changes: 0 additions & 25 deletions bids-validator/src/schema/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ import {
ContextSubject,
ContextAssociations,
ContextNiftiHeader,
ContextData,
} from '../types/context.ts'
import { BIDSFile } from '../types/file.ts'
import { FileTree } from '../types/filetree.ts'
import { ColumnsMap } from '../types/columns.ts'
import { BIDSEntities, readEntities } from './entities.ts'
import { DatasetIssues } from '../issues/datasetIssues.ts'
import { parseTSV } from '../files/tsv.ts'
import { parseBval, parseBvec } from '../files/dwi.ts'
import { loadHeader } from '../files/nifti.ts'
import { buildAssociations } from './associations.ts'
import { ValidatorOptions } from '../setup/options.ts'
Expand Down Expand Up @@ -68,7 +66,6 @@ export class BIDSContext implements Context {
columns: ColumnsMap
associations: ContextAssociations
nifti_header?: ContextNiftiHeader
data?: ContextData

constructor(
fileTree: FileTree,
Expand Down Expand Up @@ -174,27 +171,6 @@ export class BIDSContext implements Context {
}
}

// Currently un-specified bit of context needed for bval/bvec
async loadData(): Promise<void> {
let parser
if (this.file.path.endsWith('.bval')) {
parser = parseBval
} else if (this.file.path.endsWith('.bvec')) {
parser = parseBvec
}
if (parser) {
this.data = await this.file
.text()
.then(parser as (value: string) => number[][])
.then((data) => {
return {
n_rows: data.length,
n_cols: data ? data[0].length : 0,
}
}).then((ret) => {console.log(ret); return ret})
}
}

async loadColumns(): Promise<void> {
if (this.extension !== '.tsv') {
return
Expand Down Expand Up @@ -222,7 +198,6 @@ export class BIDSContext implements Context {
this.loadSidecar(),
this.loadColumns(),
this.loadAssociations(),
this.loadData(),
])
this.loadNiftiHeader()
}
Expand Down
5 changes: 0 additions & 5 deletions bids-validator/src/types/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ export interface ContextNiftiHeader {
qform_code: number
sform_code: number
}
export interface ContextData {
n_cols?: number
n_rows?: number
}
export interface Context {
dataset: ContextDataset
subject: ContextSubject
Expand All @@ -104,5 +100,4 @@ export interface Context {
columns: object
json: object
nifti_header?: ContextNiftiHeader
data?: ContextData
}

0 comments on commit 0fb4ca3

Please sign in to comment.