diff --git a/package.json b/package.json index 02761decca981aa42742c11eb96d8caaed39234c..44965fe0363c9778d55f9bd608f0234570bd2dba 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "transform": { "\\.ts$": "<rootDir>/node_modules/ts-jest/preprocessor.js" }, + "moduleDirectories": ["node_modules", "build/node_modules"], "testRegex": "\\.spec\\.ts$" }, "author": "", diff --git a/src/mol-base/collections/integer.ts b/src/mol-base/collections/integer.ts index a7ca9107661d596bffcdc19ccda024683200bc06..aba4ca874c4776c08020b95c299f968f679252bf 100644 --- a/src/mol-base/collections/integer.ts +++ b/src/mol-base/collections/integer.ts @@ -9,6 +9,7 @@ import OrderedSet from './integer/ordered-set' import Segmentation from './integer/segmentation' import SortedArray from './integer/sorted-array' import Tuple from './integer/tuple' +import LinkedIndex from './integer/linked-index' import Iterator from './iterator' -export { Interval, OrderedSet, Segmentation, SortedArray, Tuple, Iterator } \ No newline at end of file +export { Interval, OrderedSet, Segmentation, SortedArray, Tuple, LinkedIndex, Iterator } \ No newline at end of file diff --git a/src/mol-base/collections/_spec/linked-index.spec.ts b/src/mol-base/collections/integer/_spec/linked-index.spec.ts similarity index 100% rename from src/mol-base/collections/_spec/linked-index.spec.ts rename to src/mol-base/collections/integer/_spec/linked-index.spec.ts diff --git a/src/mol-base/collections/linked-index.ts b/src/mol-base/collections/integer/linked-index.ts similarity index 100% rename from src/mol-base/collections/linked-index.ts rename to src/mol-base/collections/integer/linked-index.ts diff --git a/src/mol-base/collections/table.ts b/src/mol-base/collections/table.ts index 32a7b5379211a94f5ee7d64446718b6f57561f8f..b175419aefd847d27e40302b19409d43ddca0105 100644 --- a/src/mol-base/collections/table.ts +++ b/src/mol-base/collections/table.ts @@ -4,118 +4,8 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Column from './column' -import { sortArray } from './sort' +import Table from './table/table' +import Column from './table/column' +import * as ColumnHelpers from './table/column-helpers' -type Table<Schema extends Table.Schema> = { readonly _rowCount: number, readonly _columns: ReadonlyArray<string> } & Table.Columns<Schema> - -/** An immutable table */ -namespace Table { - export type Schema = { [field: string]: Column.Type } - export type Columns<S extends Schema> = { [C in keyof S]: Column<S[C]['T']> } - export type Row<S extends Schema> = { [C in keyof S]: S[C]['T'] } - export type Arrays<S extends Schema> = { [C in keyof S]: ArrayLike<S[C]['T']> } - export type PartialTable<S extends Table.Schema> = { readonly _rowCount: number, readonly _columns: ReadonlyArray<string> } & { [C in keyof S]?: Column<S[C]['T']> } - - export function pickColumns<S extends Schema>(schema: S, table: PartialTable<S>, guard: Partial<Columns<S>> = {}): Table<S> { - const ret = Object.create(null); - const keys = Object.keys(schema); - ret._rowCount = table._rowCount; - ret._columns = keys; - for (const k of keys) { - if (!!table[k]) ret[k] = table[k]; - else if (!!guard[k]) ret[k] = guard[k]; - else throw Error(`Cannot find column '${k}'.`); - } - return ret; - } - - export function ofColumns<S extends Schema, R extends Table<S> = Table<S>>(columns: Columns<S>): R { - const _columns = Object.keys(columns); - const _rowCount = columns[_columns[0]].rowCount; - return { _rowCount, _columns, ...(columns as any) }; - } - - export function ofRows<S extends Schema, R extends Table<S> = Table<S>>(schema: Schema, rows: ArrayLike<Row<S>>): R { - const ret = Object.create(null); - const rowCount = rows.length; - const columns = Object.keys(schema); - ret._rowCount = rowCount; - ret._columns = columns; - for (const k of columns) { - (ret as any)[k] = Column.ofLambda({ - rowCount, - type: schema[k], - value: r => rows[r][k], - valueKind: r => typeof rows[r][k] === 'undefined' ? Column.ValueKind.NotPresent : Column.ValueKind.Present - }) - } - return ret as R; - } - - export function ofArrays<S extends Schema, R extends Table<S> = Table<S>>(schema: Schema, arrays: Arrays<S>): R { - const ret = Object.create(null); - const columns = Object.keys(schema); - ret._rowCount = arrays[columns[0]].length; - ret._columns = columns; - for (const k of columns) { - (ret as any)[k] = Column.ofArray({ array: arrays[k], type: schema[k] }) - } - return ret as R; - } - - export function view<S extends Schema, R extends Schema>(table: Table<S>, schema: R, view: ArrayLike<number>) { - const ret = Object.create(null); - const columns = Object.keys(schema); - ret._rowCount = view.length; - ret._columns = columns; - for (const k of columns) { - (ret as any)[k] = Column.view(table[k], view); - } - return ret as Table<R>; - } - - export function columnToArray<S extends Schema>(table: Table<S>, name: keyof S, array?: Column.ArrayCtor<any>) { - table[name] = Column.asArrayColumn(table[name], array); - } - - /** Sort and return a new table */ - export function sort<T extends Table<S>, S extends Schema>(table: T, cmp: (i: number, j: number) => number) { - const indices = new Int32Array(table._rowCount); - for (let i = 0, _i = indices.length; i < _i; i++) indices[i] = i; - sortArray(indices, (_, i, j) => cmp(i, j)); - - let isIdentity = true; - for (let i = 0, _i = indices.length; i < _i; i++) { - if (indices[i] !== i) { - isIdentity = false; - break; - } - } - if (isIdentity) return table; - - const ret = Object.create(null); - ret._rowCount = table._rowCount; - ret._columns = table._columns; - for (const c of table._columns) { - ret[c] = Column.view((table as any)[c], indices, false); - } - return ret; - } - - export function areEqual<T extends Table<Schema>>(a: T, b: T) { - if (a._rowCount !== b._rowCount) return false; - if (a._columns.length !== b._columns.length) return false; - for (const c of a._columns) { - if (!b[c]) return false; - } - - for (const c of a._columns) { - if (!Column.areEqual(a[c], b[c])) return false; - } - - return true; - } -} - -export default Table \ No newline at end of file +export { Table, Column, ColumnHelpers } \ No newline at end of file diff --git a/src/mol-base/collections/_spec/table.spec.ts b/src/mol-base/collections/table/_spec/table.spec.ts similarity index 98% rename from src/mol-base/collections/_spec/table.spec.ts rename to src/mol-base/collections/table/_spec/table.spec.ts index 4d79f445b75ff8e9996b4323fcc41f8cdc664594..18a49fc549210d32df9e4a415ef1a3cec8272903 100644 --- a/src/mol-base/collections/_spec/table.spec.ts +++ b/src/mol-base/collections/table/_spec/table.spec.ts @@ -4,7 +4,8 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Column, { ColumnHelpers } from '../column' +import * as ColumnHelpers from '../column-helpers' +import Column from '../column' import Table from '../table' describe('column', () => { diff --git a/src/mol-base/collections/table/column-helpers.ts b/src/mol-base/collections/table/column-helpers.ts new file mode 100644 index 0000000000000000000000000000000000000000..b57deec09a41d9c88c346066058c962a88de9d6d --- /dev/null +++ b/src/mol-base/collections/table/column-helpers.ts @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2017 molio contributors, licensed under MIT, See LICENSE file for more info. + * + * @author David Sehnal <david.sehnal@gmail.com> + */ + +import Column from './column' + +export function getArrayBounds(rowCount: number, params?: Column.ToArrayParams<any>) { + const start = params && typeof params.start !== 'undefined' ? Math.max(Math.min(params.start, rowCount - 1), 0) : 0; + const end = params && typeof params.end !== 'undefined' ? Math.min(params.end, rowCount) : rowCount; + return { start, end }; +} + +export function createArray(rowCount: number, params?: Column.ToArrayParams<any>) { + const c = params && typeof params.array !== 'undefined' ? params.array : Array; + const { start, end } = getArrayBounds(rowCount, params); + return { array: new c(end - start) as any[], start, end }; +} + +export function fillArrayValues(value: (row: number) => any, target: any[], start: number) { + for (let i = 0, _e = target.length; i < _e; i++) target[i] = value(start + i); + return target; +} + +export function createAndFillArray(rowCount: number, value: (row: number) => any, params?: Column.ToArrayParams<any>) { + const { array, start } = createArray(rowCount, params); + return fillArrayValues(value, array, start); +} + +export function isTypedArray(data: any): boolean { + return !!data.buffer && typeof data.byteLength === 'number' && typeof data.BYTES_PER_ELEMENT === 'number'; +} + +export function typedArrayWindow(data: any, params?: Column.ToArrayParams<any>): ReadonlyArray<number> { + const { constructor, buffer, length, byteOffset, BYTES_PER_ELEMENT } = data; + const { start, end } = getArrayBounds(length, params); + if (start === 0 && end === length) return data; + return new constructor(buffer, byteOffset + BYTES_PER_ELEMENT * start, Math.min(length, end - start)); +} \ No newline at end of file diff --git a/src/mol-base/collections/column.ts b/src/mol-base/collections/table/column.ts similarity index 86% rename from src/mol-base/collections/column.ts rename to src/mol-base/collections/table/column.ts index 7118f96d01a9eb1fe7d14650b420e9cd1444831d..9f0263306e0f5fe5c10866c27cb7729856a0e995 100644 --- a/src/mol-base/collections/column.ts +++ b/src/mol-base/collections/table/column.ts @@ -4,6 +4,8 @@ * @author David Sehnal <david.sehnal@gmail.com> */ +import * as ColumnHelpers from './column-helpers' + interface Column<T> { readonly '@type': Column.Type, readonly '@array': ArrayLike<any> | undefined, @@ -304,39 +306,4 @@ function areValuesEqual(a: Column<any>, b: Column<any>) { if (va(i) !== vb(i)) return false; } return true; -} - -export namespace ColumnHelpers { - export function getArrayBounds(rowCount: number, params?: Column.ToArrayParams<any>) { - const start = params && typeof params.start !== 'undefined' ? Math.max(Math.min(params.start, rowCount - 1), 0) : 0; - const end = params && typeof params.end !== 'undefined' ? Math.min(params.end, rowCount) : rowCount; - return { start, end }; - } - - export function createArray(rowCount: number, params?: Column.ToArrayParams<any>) { - const c = params && typeof params.array !== 'undefined' ? params.array : Array; - const { start, end } = getArrayBounds(rowCount, params); - return { array: new c(end - start) as any[], start, end }; - } - - export function fillArrayValues(value: (row: number) => any, target: any[], start: number) { - for (let i = 0, _e = target.length; i < _e; i++) target[i] = value(start + i); - return target; - } - - export function createAndFillArray(rowCount: number, value: (row: number) => any, params?: Column.ToArrayParams<any>) { - const { array, start } = createArray(rowCount, params); - return fillArrayValues(value, array, start); - } - - export function isTypedArray(data: any): boolean { - return !!data.buffer && typeof data.byteLength === 'number' && typeof data.BYTES_PER_ELEMENT === 'number'; - } - - export function typedArrayWindow(data: any, params?: Column.ToArrayParams<any>): ReadonlyArray<number> { - const { constructor, buffer, length, byteOffset, BYTES_PER_ELEMENT } = data; - const { start, end } = getArrayBounds(length, params); - if (start === 0 && end === length) return data; - return new constructor(buffer, byteOffset + BYTES_PER_ELEMENT * start, Math.min(length, end - start)); - } } \ No newline at end of file diff --git a/src/mol-base/collections/table/table.ts b/src/mol-base/collections/table/table.ts new file mode 100644 index 0000000000000000000000000000000000000000..d4e94d98519c7e4c88283e7740c1edda1cee3700 --- /dev/null +++ b/src/mol-base/collections/table/table.ts @@ -0,0 +1,121 @@ +/** + * Copyright (c) 2017 molio contributors, licensed under MIT, See LICENSE file for more info. + * + * @author David Sehnal <david.sehnal@gmail.com> + */ + +import Column from './column' +import { sortArray } from '../sort' + +type Table<Schema extends Table.Schema> = { readonly _rowCount: number, readonly _columns: ReadonlyArray<string> } & Table.Columns<Schema> + +/** An immutable table */ +namespace Table { + export type Schema = { [field: string]: Column.Type } + export type Columns<S extends Schema> = { [C in keyof S]: Column<S[C]['T']> } + export type Row<S extends Schema> = { [C in keyof S]: S[C]['T'] } + export type Arrays<S extends Schema> = { [C in keyof S]: ArrayLike<S[C]['T']> } + export type PartialTable<S extends Table.Schema> = { readonly _rowCount: number, readonly _columns: ReadonlyArray<string> } & { [C in keyof S]?: Column<S[C]['T']> } + + export function pickColumns<S extends Schema>(schema: S, table: PartialTable<S>, guard: Partial<Columns<S>> = {}): Table<S> { + const ret = Object.create(null); + const keys = Object.keys(schema); + ret._rowCount = table._rowCount; + ret._columns = keys; + for (const k of keys) { + if (!!table[k]) ret[k] = table[k]; + else if (!!guard[k]) ret[k] = guard[k]; + else throw Error(`Cannot find column '${k}'.`); + } + return ret; + } + + export function ofColumns<S extends Schema, R extends Table<S> = Table<S>>(columns: Columns<S>): R { + const _columns = Object.keys(columns); + const _rowCount = columns[_columns[0]].rowCount; + return { _rowCount, _columns, ...(columns as any) }; + } + + export function ofRows<S extends Schema, R extends Table<S> = Table<S>>(schema: Schema, rows: ArrayLike<Row<S>>): R { + const ret = Object.create(null); + const rowCount = rows.length; + const columns = Object.keys(schema); + ret._rowCount = rowCount; + ret._columns = columns; + for (const k of columns) { + (ret as any)[k] = Column.ofLambda({ + rowCount, + type: schema[k], + value: r => rows[r][k], + valueKind: r => typeof rows[r][k] === 'undefined' ? Column.ValueKind.NotPresent : Column.ValueKind.Present + }) + } + return ret as R; + } + + export function ofArrays<S extends Schema, R extends Table<S> = Table<S>>(schema: Schema, arrays: Arrays<S>): R { + const ret = Object.create(null); + const columns = Object.keys(schema); + ret._rowCount = arrays[columns[0]].length; + ret._columns = columns; + for (const k of columns) { + (ret as any)[k] = Column.ofArray({ array: arrays[k], type: schema[k] }) + } + return ret as R; + } + + export function view<S extends Schema, R extends Schema>(table: Table<S>, schema: R, view: ArrayLike<number>) { + const ret = Object.create(null); + const columns = Object.keys(schema); + ret._rowCount = view.length; + ret._columns = columns; + for (const k of columns) { + (ret as any)[k] = Column.view(table[k], view); + } + return ret as Table<R>; + } + + export function columnToArray<S extends Schema>(table: Table<S>, name: keyof S, array?: Column.ArrayCtor<any>) { + table[name] = Column.asArrayColumn(table[name], array); + } + + /** Sort and return a new table */ + export function sort<T extends Table<S>, S extends Schema>(table: T, cmp: (i: number, j: number) => number) { + const indices = new Int32Array(table._rowCount); + for (let i = 0, _i = indices.length; i < _i; i++) indices[i] = i; + sortArray(indices, (_, i, j) => cmp(i, j)); + + let isIdentity = true; + for (let i = 0, _i = indices.length; i < _i; i++) { + if (indices[i] !== i) { + isIdentity = false; + break; + } + } + if (isIdentity) return table; + + const ret = Object.create(null); + ret._rowCount = table._rowCount; + ret._columns = table._columns; + for (const c of table._columns) { + ret[c] = Column.view((table as any)[c], indices, false); + } + return ret; + } + + export function areEqual<T extends Table<Schema>>(a: T, b: T) { + if (a._rowCount !== b._rowCount) return false; + if (a._columns.length !== b._columns.length) return false; + for (const c of a._columns) { + if (!b[c]) return false; + } + + for (const c of a._columns) { + if (!Column.areEqual(a[c], b[c])) return false; + } + + return true; + } +} + +export default Table \ No newline at end of file diff --git a/src/mol-data/structure/model/builders/mmcif.ts b/src/mol-data/structure/model/builders/mmcif.ts index 26591bf4bb3b0f1d97e6de25dcfd258d5089df6a..40e713590e1865edae13c50f39d04f4a0e13dea6 100644 --- a/src/mol-data/structure/model/builders/mmcif.ts +++ b/src/mol-data/structure/model/builders/mmcif.ts @@ -6,8 +6,7 @@ import { mmCIF } from '../data-format' import Model from '../model' -import Column from 'mol-base/collections/column' -import Table from 'mol-base/collections/table' +import { Column, Table } from 'mol-base/collections/table' import { Interval, Segmentation } from 'mol-base/collections/integer' import { newUUID } from 'mol-base/utils/uuid' import * as Hierarchy from '../properties/hierarchy' diff --git a/src/mol-data/structure/model/properties/conformation.ts b/src/mol-data/structure/model/properties/conformation.ts index 9014a0a93c190ac065eb54680d53dbe943022547..651504d822245861731d8745aa7868cafdc46ad1 100644 --- a/src/mol-data/structure/model/properties/conformation.ts +++ b/src/mol-data/structure/model/properties/conformation.ts @@ -4,7 +4,7 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Column from 'mol-base/collections/column' +import { Column } from 'mol-base/collections/table' import UUID from 'mol-base/utils/uuid' interface Conformation { diff --git a/src/mol-data/structure/model/properties/hierarchy.ts b/src/mol-data/structure/model/properties/hierarchy.ts index fec5de2657aff6eefa3a0d937d5fb1d71d034ba9..c44ca9052a90966b2a0edc4255a6574c45b86180 100644 --- a/src/mol-data/structure/model/properties/hierarchy.ts +++ b/src/mol-data/structure/model/properties/hierarchy.ts @@ -4,8 +4,7 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Column from 'mol-base/collections/column' -import Table from 'mol-base/collections/table' +import { Column, Table } from 'mol-base/collections/table' import { Segmentation } from 'mol-base/collections/integer' import { Schema as mmCIF } from 'mol-io/reader/cif/schema/mmcif' diff --git a/src/mol-data/structure/model/utils/hierarchy-keys.ts b/src/mol-data/structure/model/utils/hierarchy-keys.ts index fe4391e4231ff3296aeec29bc0f65810cc2a489e..06aa40957cbf36d063a2afb606059f42efee9a2b 100644 --- a/src/mol-data/structure/model/utils/hierarchy-keys.ts +++ b/src/mol-data/structure/model/utils/hierarchy-keys.ts @@ -4,7 +4,7 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Column from 'mol-base/collections/column' +import { Column } from 'mol-base/collections/table' import { Data, Segments, Keys } from '../properties/hierarchy' import { Interval, Segmentation } from 'mol-base/collections/integer' diff --git a/src/mol-io/reader/_spec/column.spec.ts b/src/mol-io/reader/_spec/column.spec.ts index a0242c39f9c226754af22eec8fd75c9d30f39113..556df5d9f7c7b31beb6962a712fe2eaacc70a195 100644 --- a/src/mol-io/reader/_spec/column.spec.ts +++ b/src/mol-io/reader/_spec/column.spec.ts @@ -7,7 +7,7 @@ import FixedColumn from '../common/text/column/fixed' import TokenColumn from '../common/text/column/token' -import Column, { ColumnHelpers } from 'mol-base/collections/column' +import { Column, ColumnHelpers } from 'mol-base/collections/table' const lines = [ '1.123 abc', diff --git a/src/mol-io/reader/cif/binary/field.ts b/src/mol-io/reader/cif/binary/field.ts index 1a629ea2fe3357a44d3e5302ee5cbd495a846432..22165904c61fde08ca0eefd554e5366a92b1ff6c 100644 --- a/src/mol-io/reader/cif/binary/field.ts +++ b/src/mol-io/reader/cif/binary/field.ts @@ -4,7 +4,7 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Column, { ColumnHelpers } from 'mol-base/collections/column' +import { Column, ColumnHelpers } from 'mol-base/collections/table' import * as Data from '../data-model' import { EncodedColumn } from './encoding' import decode from './decoder' diff --git a/src/mol-io/reader/cif/data-model.ts b/src/mol-io/reader/cif/data-model.ts index bd8cf4ec703feba2475f842de28e968ca8f08a2a..4037ae87cbb71223a95ae659e9141e8486e5f59b 100644 --- a/src/mol-io/reader/cif/data-model.ts +++ b/src/mol-io/reader/cif/data-model.ts @@ -4,7 +4,7 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Column from 'mol-base/collections/column' +import { Column } from 'mol-base/collections/table' export interface File { readonly name?: string, diff --git a/src/mol-io/reader/cif/schema.ts b/src/mol-io/reader/cif/schema.ts index 7984870d7a9edd61c97e43da4ef72a122043c057..abc78e5854f0b64f89e3867e1742d171411464f3 100644 --- a/src/mol-io/reader/cif/schema.ts +++ b/src/mol-io/reader/cif/schema.ts @@ -5,8 +5,7 @@ */ import * as Data from './data-model' -import Column, { ColumnHelpers } from 'mol-base/collections/column' -import Table from 'mol-base/collections/table' +import { Table, Column, ColumnHelpers } from 'mol-base/collections/table' export function toTypedFrame<Schema extends FrameSchema, Frame extends TypedFrame<Schema> = TypedFrame<Schema>>(schema: Schema, frame: Data.Frame): Frame { return createTypedFrame(schema, frame) as Frame; diff --git a/src/mol-io/reader/cif/text/field.ts b/src/mol-io/reader/cif/text/field.ts index b124fed3c6effbdd5a664f00bbf47696cbd8d798..6c1ad0fe437f24f6f09c0976b10e3c925fab316f 100644 --- a/src/mol-io/reader/cif/text/field.ts +++ b/src/mol-io/reader/cif/text/field.ts @@ -4,7 +4,7 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Column, { ColumnHelpers } from 'mol-base/collections/column' +import { Column, ColumnHelpers } from 'mol-base/collections/table' import * as TokenColumn from '../../common/text/column/token' import { Tokens } from '../../common/text/tokenizer' import * as Data from '../data-model' diff --git a/src/mol-io/reader/common/text/column/fixed.ts b/src/mol-io/reader/common/text/column/fixed.ts index 2644ac70ab874ca7c834253670b110e0c52aede5..c9d4aa6a193df865e786e25a800faeb6fe29880b 100644 --- a/src/mol-io/reader/common/text/column/fixed.ts +++ b/src/mol-io/reader/common/text/column/fixed.ts @@ -4,7 +4,7 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Column, { ColumnHelpers } from 'mol-base/collections/column' +import { Column, ColumnHelpers } from 'mol-base/collections/table' import { trimStr, Tokens } from '../tokenizer' import { parseIntSkipLeadingWhitespace, parseFloatSkipLeadingWhitespace } from '../number-parser' diff --git a/src/mol-io/reader/common/text/column/token.ts b/src/mol-io/reader/common/text/column/token.ts index 21fd44a7a2336a82b6e99c71e1566412a4d969b9..7ed57ed1ed163448e8580da93f439be7125fdf49 100644 --- a/src/mol-io/reader/common/text/column/token.ts +++ b/src/mol-io/reader/common/text/column/token.ts @@ -4,7 +4,7 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Column, { ColumnHelpers } from 'mol-base/collections/column' +import { Column, ColumnHelpers } from 'mol-base/collections/table' import { Tokens } from '../tokenizer' import { parseInt as fastParseInt, parseFloat as fastParseFloat } from '../number-parser' diff --git a/src/mol-io/reader/gro/parser.ts b/src/mol-io/reader/gro/parser.ts index 68f05a9df41a63757301964765e3300bb1d4838f..a257e5020d67d371b2eae0c0c92a329b6cc2093b 100644 --- a/src/mol-io/reader/gro/parser.ts +++ b/src/mol-io/reader/gro/parser.ts @@ -5,9 +5,9 @@ * @author David Sehnal <david.sehnal@gmail.com> */ +import { Column } from 'mol-base/collections/table' import Tokenizer from '../common/text/tokenizer' import FixedColumn from '../common/text/column/fixed' -import Column from 'mol-base/collections/column' import * as Schema from './schema' import Result from '../result' import Computation from 'mol-base/computation' diff --git a/src/mol-io/reader/gro/schema.d.ts b/src/mol-io/reader/gro/schema.d.ts index d5edb09da0d418993ae05ffde35ee77779caf283..fb2d454b7216d68caa036cdf2566ddef67bfe4f3 100644 --- a/src/mol-io/reader/gro/schema.d.ts +++ b/src/mol-io/reader/gro/schema.d.ts @@ -5,7 +5,7 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Column from 'mol-base/collections/column' +import { Column } from 'mol-base/collections/table' export interface Header { title: string, diff --git a/src/mol-io/reader/mol2/schema.d.ts b/src/mol-io/reader/mol2/schema.d.ts index c99074e349d1e24ee2ecdc3886b3d75a889e8254..f092b0736fd4ed5b1ac1562abf479644a34efa96 100644 --- a/src/mol-io/reader/mol2/schema.d.ts +++ b/src/mol-io/reader/mol2/schema.d.ts @@ -4,7 +4,7 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import Column from 'mol-base/collections/column' +import { Column } from 'mol-base/collections/table' // Full format http://chemyang.ccnu.edu.cn/ccb/server/AIMMS/mol2.pdf // there are many records but for now ignore (pass over) all but the following diff --git a/src/perf-tests/column.ts b/src/perf-tests/column.ts index d43a32a5c64b4a8346fe5ab514505313466e72df..2d0699c71268b3684115e6508ca51dd5cb299a01 100644 --- a/src/perf-tests/column.ts +++ b/src/perf-tests/column.ts @@ -1,5 +1,5 @@ import * as B from 'benchmark' -import C from 'mol-base/collections/column' +import { Column as C } from 'mol-base/collections/table' export namespace Column { function createData(n: number) {