From 65bdbc8542b481e733f58ad1099cece5acb6c6d5 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 4 Oct 2023 09:07:03 -0400 Subject: [PATCH] FIX: Un-define the unspecified Context.data --- bids-validator/src/schema/context.ts | 25 ------------------------- bids-validator/src/types/context.ts | 5 ----- 2 files changed, 30 deletions(-) diff --git a/bids-validator/src/schema/context.ts b/bids-validator/src/schema/context.ts index 65cb6c4f7..284781f38 100644 --- a/bids-validator/src/schema/context.ts +++ b/bids-validator/src/schema/context.ts @@ -5,7 +5,6 @@ import { ContextSubject, ContextAssociations, ContextNiftiHeader, - ContextData, } from '../types/context.ts' import { BIDSFile } from '../types/file.ts' import { FileTree } from '../types/filetree.ts' @@ -13,7 +12,6 @@ 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' @@ -68,7 +66,6 @@ export class BIDSContext implements Context { columns: ColumnsMap associations: ContextAssociations nifti_header?: ContextNiftiHeader - data?: ContextData constructor( fileTree: FileTree, @@ -174,27 +171,6 @@ export class BIDSContext implements Context { } } - // Currently un-specified bit of context needed for bval/bvec - async loadData(): Promise { - 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 { if (this.extension !== '.tsv') { return @@ -222,7 +198,6 @@ export class BIDSContext implements Context { this.loadSidecar(), this.loadColumns(), this.loadAssociations(), - this.loadData(), ]) this.loadNiftiHeader() } diff --git a/bids-validator/src/types/context.ts b/bids-validator/src/types/context.ts index 7fa7e8bd9..4b03fcbee 100644 --- a/bids-validator/src/types/context.ts +++ b/bids-validator/src/types/context.ts @@ -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 @@ -104,5 +100,4 @@ export interface Context { columns: object json: object nifti_header?: ContextNiftiHeader - data?: ContextData }