From 19d9439955ec6fb9683657c9c65e236a5728c5fa Mon Sep 17 00:00:00 2001 From: David Sehnal <david.sehnal@gmail.com> Date: Thu, 2 Nov 2017 14:12:59 +0100 Subject: [PATCH] Simplified some modules --- .../collections/_spec/iterators.spec.ts | 1 + src/mol-base/collections/integer.ts | 14 +++++ src/mol-base/collections/iterator.ts | 33 +++++++++-- src/mol-data/_spec/atom-set.spec.ts | 4 +- src/mol-data/model/builders/mmcif.ts | 3 +- src/mol-data/model/properties/computed.ts | 1 - src/mol-data/model/properties/hierarchy.ts | 6 +- src/mol-data/model/utils/hierarchy-keys.ts | 3 +- src/mol-data/query.ts | 2 +- src/mol-data/query/generators.ts | 10 +++- src/mol-data/query/query.ts | 11 ++++ src/mol-data/query/selection.ts | 4 +- src/mol-data/structure.ts | 24 ++------ src/mol-data/structure/atom.ts | 4 +- .../structure/{atom-set.ts => atom/set.ts} | 50 ++++++++-------- .../{atom-set => atom/set}/builder.ts | 6 +- .../{atom-set/base.ts => atom/set/impl.ts} | 11 ++-- .../{atom-set => atom/set}/properties.ts | 0 src/mol-data/structure/base.ts | 37 ------------ src/mol-data/structure/structure.ts | 58 +++++++++++++++++++ src/perf-tests/sets.ts | 6 +- src/perf-tests/structure.ts | 7 +-- 22 files changed, 172 insertions(+), 123 deletions(-) create mode 100644 src/mol-base/collections/integer.ts create mode 100644 src/mol-data/query/query.ts rename src/mol-data/structure/{atom-set.ts => atom/set.ts} (54%) rename src/mol-data/structure/{atom-set => atom/set}/builder.ts (91%) rename src/mol-data/structure/{atom-set/base.ts => atom/set/impl.ts} (97%) rename src/mol-data/structure/{atom-set => atom/set}/properties.ts (100%) delete mode 100644 src/mol-data/structure/base.ts create mode 100644 src/mol-data/structure/structure.ts diff --git a/src/mol-base/collections/_spec/iterators.spec.ts b/src/mol-base/collections/_spec/iterators.spec.ts index 8df989242..7c8cabe4a 100644 --- a/src/mol-base/collections/_spec/iterators.spec.ts +++ b/src/mol-base/collections/_spec/iterators.spec.ts @@ -27,4 +27,5 @@ describe('basic iterators', () => { check('array', Iterator.Array([1, 2, 3]), [1, 2, 3]); check('range', Iterator.Range(0, 3), [0, 1, 2, 3]); check('map', Iterator.map(Iterator.Range(0, 1), x => x + 1), [1, 2]); + check('filter', Iterator.filter(Iterator.Range(0, 3), x => x >= 2), [2, 3]); }); \ No newline at end of file diff --git a/src/mol-base/collections/integer.ts b/src/mol-base/collections/integer.ts new file mode 100644 index 000000000..a7ca91076 --- /dev/null +++ b/src/mol-base/collections/integer.ts @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2017 molio contributors, licensed under MIT, See LICENSE file for more info. + * + * @author David Sehnal <david.sehnal@gmail.com> + */ + +import Interval from './integer/interval' +import OrderedSet from './integer/ordered-set' +import Segmentation from './integer/segmentation' +import SortedArray from './integer/sorted-array' +import Tuple from './integer/tuple' +import Iterator from './iterator' + +export { Interval, OrderedSet, Segmentation, SortedArray, Tuple, Iterator } \ No newline at end of file diff --git a/src/mol-base/collections/iterator.ts b/src/mol-base/collections/iterator.ts index 50ad41cec..02f302d82 100644 --- a/src/mol-base/collections/iterator.ts +++ b/src/mol-base/collections/iterator.ts @@ -21,7 +21,7 @@ class ArrayIteratorImpl<T> implements Iterator<T> { private length: number = 0; private lastValue: T; - hasNext: boolean; + hasNext: boolean = false; move() { ++this.index; @@ -41,9 +41,8 @@ class ArrayIteratorImpl<T> implements Iterator<T> { } class RangeIteratorImpl implements Iterator<number> { - private value: number; - - hasNext: boolean; + private value: number = 0; + hasNext: boolean = false; move() { ++this.value; @@ -64,7 +63,7 @@ class ValueIterator<T> implements Iterator<T> { } class MapIteratorImpl<T, R> implements Iterator<R> { - hasNext: boolean; + hasNext: boolean = false; move() { const v = this.f(this.base.move()); @@ -77,12 +76,36 @@ class MapIteratorImpl<T, R> implements Iterator<R> { } } +class FilterIteratorImpl<T> implements Iterator<T> { + private next: T; + hasNext: boolean; + + move() { + const ret = this.next; + this.hasNext = this.findNext(); + return ret; + } + + private findNext() { + while (this.base.hasNext) { + this.next = this.base.move(); + if (this.p(this.next)) return true; + } + return false; + } + + constructor(private base: Iterator<T>, private p: (v: T) => boolean) { + this.hasNext = this.findNext(); + } +} + namespace Iterator { export const Empty: Iterator<any> = new RangeIteratorImpl(0, -1); export function Array<T>(xs: ArrayLike<T>): Iterator<T> { return new ArrayIteratorImpl<T>(xs); } export function Value<T>(value: T): Iterator<T> { return new ValueIterator(value); } export function Range(min: number, max: number): Iterator<number> { return new RangeIteratorImpl(min, max); } export function map<T, R>(base: Iterator<T>, f: (v: T) => R): Iterator<R> { return new MapIteratorImpl(base, f); } + export function filter<T>(base: Iterator<T>, p: (v: T) => boolean): Iterator<T> { return new FilterIteratorImpl(base, p); } } export default Iterator \ No newline at end of file diff --git a/src/mol-data/_spec/atom-set.spec.ts b/src/mol-data/_spec/atom-set.spec.ts index 375e5ed37..62e5ea804 100644 --- a/src/mol-data/_spec/atom-set.spec.ts +++ b/src/mol-data/_spec/atom-set.spec.ts @@ -4,8 +4,8 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import OrderedSet from '../../mol-base/collections/integer/ordered-set' -import AtomSet from '../structure/atom-set' +import { OrderedSet } from '../../mol-base/collections/integer' +import AtomSet from '../structure/atom/set' import Atom from '../structure/atom' describe('atom set', () => { diff --git a/src/mol-data/model/builders/mmcif.ts b/src/mol-data/model/builders/mmcif.ts index 5890965b0..240e1e503 100644 --- a/src/mol-data/model/builders/mmcif.ts +++ b/src/mol-data/model/builders/mmcif.ts @@ -9,8 +9,7 @@ import { Frame as mmCIF } from '../../../mol-io/reader/cif/schema/mmcif' import Model from '../../model' import Column from '../../../mol-base/collections/column' import Table from '../../../mol-base/collections/table' -import Interval from '../../../mol-base/collections/integer/interval' -import Segmentation from '../../../mol-base/collections/integer/segmentation' +import { Interval, Segmentation } from '../../../mol-base/collections/integer' import { newUUID } from '../../../mol-base/utils/uuid' import * as Hierarchy from '../properties/hierarchy' import Conformation from '../properties/conformation' diff --git a/src/mol-data/model/properties/computed.ts b/src/mol-data/model/properties/computed.ts index 72b082ec5..0cb9039cc 100644 --- a/src/mol-data/model/properties/computed.ts +++ b/src/mol-data/model/properties/computed.ts @@ -8,7 +8,6 @@ // secondary structure is also a computed property // import { SecondaryStructureType } from '../constants' -// import Segmentation from '../../../mol-base/collections/integer/segmentation' // interface SecondaryStructure { diff --git a/src/mol-data/model/properties/hierarchy.ts b/src/mol-data/model/properties/hierarchy.ts index ac0c96fa3..e86fc8983 100644 --- a/src/mol-data/model/properties/hierarchy.ts +++ b/src/mol-data/model/properties/hierarchy.ts @@ -6,7 +6,7 @@ import Column from '../../../mol-base/collections/column' import Table from '../../../mol-base/collections/table' -import IntervalSegmentation from '../../../mol-base/collections/integer/segmentation' +import { Segmentation } from '../../../mol-base/collections/integer' import { Schema as mmCIF } from '../../../mol-io/reader/cif/schema/mmcif' const _esCache = Object.create(null); @@ -59,8 +59,8 @@ export interface Data { } export interface Segments { - residueSegments: IntervalSegmentation, - chainSegments: IntervalSegmentation + residueSegments: Segmentation, + chainSegments: Segmentation } export interface Keys { diff --git a/src/mol-data/model/utils/hierarchy-keys.ts b/src/mol-data/model/utils/hierarchy-keys.ts index ae9f9a176..6bc5a4a8c 100644 --- a/src/mol-data/model/utils/hierarchy-keys.ts +++ b/src/mol-data/model/utils/hierarchy-keys.ts @@ -6,8 +6,7 @@ import Column from '../../../mol-base/collections/column' import { Data, Segments, Keys } from '../properties/hierarchy' -import Segmentation from '../../../mol-base/collections/integer/segmentation' -import Interval from '../../../mol-base/collections/integer/interval' +import { Interval, Segmentation } from '../../../mol-base/collections/integer' function getResidueId(comp_id: string, seq_id: number, ins_code: string) { return `${comp_id} ${seq_id} ${ins_code}`; diff --git a/src/mol-data/query.ts b/src/mol-data/query.ts index 89aaef1c2..e5684e1bd 100644 --- a/src/mol-data/query.ts +++ b/src/mol-data/query.ts @@ -4,7 +4,7 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Structure from './structure' +import { Structure } from './structure' import Selection from './query/selection' interface Query { (s: Structure): Selection } diff --git a/src/mol-data/query/generators.ts b/src/mol-data/query/generators.ts index 28ce9a001..d91aad5eb 100644 --- a/src/mol-data/query/generators.ts +++ b/src/mol-data/query/generators.ts @@ -2,4 +2,12 @@ * Copyright (c) 2017 molio contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> - */ \ No newline at end of file + */ + +// import Selection from './selection' +// import AtomSet from '../structure/atom-set' +// import Atom from '../structure/atom' + +// class LinearGroupingBuilder { + +// } \ No newline at end of file diff --git a/src/mol-data/query/query.ts b/src/mol-data/query/query.ts new file mode 100644 index 000000000..f3bd96b69 --- /dev/null +++ b/src/mol-data/query/query.ts @@ -0,0 +1,11 @@ +/** + * Copyright (c) 2017 molio contributors, licensed under MIT, See LICENSE file for more info. + * + * @author David Sehnal <david.sehnal@gmail.com> + */ + +import { Structure } from '../structure' +import Selection from './selection' + +interface Query { (s: Structure): Selection } +export default Query \ No newline at end of file diff --git a/src/mol-data/query/selection.ts b/src/mol-data/query/selection.ts index 762c304ac..d2ef57dff 100644 --- a/src/mol-data/query/selection.ts +++ b/src/mol-data/query/selection.ts @@ -6,9 +6,7 @@ import Iterator from '../../mol-base/collections/iterator' import HashSet from '../../mol-base/collections/hash-set' -import Structure from './../structure' -import Atom from './../structure/atom' -import AtomSet from './../structure/atom-set' +import { Structure, Atom, AtomSet } from '../structure' type Selection = | Structure // each atom is interpreted as a singleton structure diff --git a/src/mol-data/structure.ts b/src/mol-data/structure.ts index cab016bb1..cc8bf49f3 100644 --- a/src/mol-data/structure.ts +++ b/src/mol-data/structure.ts @@ -4,24 +4,10 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -//import { Vec3 } from '../mol-base/math/linear-algebra' -import AtomSet from './structure/atom-set' +import Atom from './structure/atom' +import AtomSet from './structure/atom/set' +import Structure from './structure/structure' +import Operator from './structure/operator' import Unit from './structure/unit' -import * as Base from './structure/base' -//import Model from './model' -//import Operator from './structure/operator' -// TODO: do "single model" version of the structure? -interface Structure extends Readonly<{ - units: { readonly [id: number]: Unit }, - atoms: AtomSet -}> { } - -namespace Structure { - export const Empty = Base.Empty; - export const ofModel = Base.ofModel; - // TODO: "lift" atom set operators - // TODO: "diff" -} - -export default Structure \ No newline at end of file +export { Atom, AtomSet, Structure, Operator, Unit } \ No newline at end of file diff --git a/src/mol-data/structure/atom.ts b/src/mol-data/structure/atom.ts index 5dfb6d5da..30f5f60f1 100644 --- a/src/mol-data/structure/atom.ts +++ b/src/mol-data/structure/atom.ts @@ -4,9 +4,9 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import Tuple from '../../mol-base/collections/integer/tuple' +import { Tuple } from '../../mol-base/collections/integer' import Unit from './unit' -import Structure from '../structure' +import Structure from './structure' /** Atom pointer */ interface Atom { '@type': Tuple['@type'] } diff --git a/src/mol-data/structure/atom-set.ts b/src/mol-data/structure/atom/set.ts similarity index 54% rename from src/mol-data/structure/atom-set.ts rename to src/mol-data/structure/atom/set.ts index 1e654f113..92a04dc70 100644 --- a/src/mol-data/structure/atom-set.ts +++ b/src/mol-data/structure/atom/set.ts @@ -4,41 +4,39 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import SortedArray from '../../mol-base/collections/integer/sorted-array' -import OrderedSet from '../../mol-base/collections/integer/ordered-set' -import Iterator from '../../mol-base/collections/iterator' -import Atom from './atom' -import * as Base from './atom-set/base' -import createBuilder from './atom-set/builder' +import { OrderedSet, SortedArray, Iterator } from '../../../mol-base/collections/integer' +import Atom from '../atom' +import * as Impl from './set/impl' +import createBuilder from './set/builder' /** A map-like representation of grouped atom set */ namespace AtomSet { - export const Empty: AtomSet = Base.Empty as any; + export const Empty: AtomSet = Impl.Empty as any; - export const create: (data: Atom | ArrayLike<Atom> | { [unitId: number]: OrderedSet }) => AtomSet = Base.create as any; + export const create: (data: Atom | ArrayLike<Atom> | { [unitId: number]: OrderedSet }) => AtomSet = Impl.create as any; - export const unitCount: (set: AtomSet) => number = Base.keyCount as any; - export const unitIds: (set: AtomSet) => SortedArray = Base.getKeys as any; - export const unitHas: (set: AtomSet, id: number) => boolean = Base.hasKey as any; - export const unitGetId: (set: AtomSet, i: number) => number = Base.getKey as any; + export const unitCount: (set: AtomSet) => number = Impl.keyCount as any; + export const unitIds: (set: AtomSet) => SortedArray = Impl.getKeys as any; + export const unitHas: (set: AtomSet, id: number) => boolean = Impl.hasKey as any; + export const unitGetId: (set: AtomSet, i: number) => number = Impl.getKey as any; - export const unitGetById: (set: AtomSet, key: number) => OrderedSet = Base.getByKey as any; - export const unitGetByIndex: (set: AtomSet, i: number) => OrderedSet = Base.getByIndex as any; + export const unitGetById: (set: AtomSet, key: number) => OrderedSet = Impl.getByKey as any; + export const unitGetByIndex: (set: AtomSet, i: number) => OrderedSet = Impl.getByIndex as any; - export const atomCount: (set: AtomSet) => number = Base.size as any; - export const atomHas: (set: AtomSet, x: Atom) => boolean = Base.hasAtom as any; - export const atomIndexOf: (set: AtomSet, x: Atom) => number = Base.indexOf as any; - export const atomGetAt: (set: AtomSet, i: number) => Atom = Base.getAt as any; - export const atoms: (set: AtomSet) => Iterator<Atom> = Base.values as any; + export const atomCount: (set: AtomSet) => number = Impl.size as any; + export const atomHas: (set: AtomSet, x: Atom) => boolean = Impl.hasAtom as any; + export const atomIndexOf: (set: AtomSet, x: Atom) => number = Impl.indexOf as any; + export const atomGetAt: (set: AtomSet, i: number) => Atom = Impl.getAt as any; + export const atoms: (set: AtomSet) => Iterator<Atom> = Impl.values as any; - export const hashCode: (set: AtomSet) => number = Base.hashCode as any; - export const areEqual: (a: AtomSet, b: AtomSet) => boolean = Base.areEqual as any; - export const areIntersecting: (a: AtomSet, b: AtomSet) => boolean = Base.areIntersecting as any; + export const hashCode: (set: AtomSet) => number = Impl.hashCode as any; + export const areEqual: (a: AtomSet, b: AtomSet) => boolean = Impl.areEqual as any; + export const areIntersecting: (a: AtomSet, b: AtomSet) => boolean = Impl.areIntersecting as any; - export const union: (a: AtomSet, b: AtomSet) => AtomSet = Base.union as any; - export const unionMany: (sets: AtomSet[]) => AtomSet = Base.unionMany as any; - export const intersect: (a: AtomSet, b: AtomSet) => AtomSet = Base.intersect as any; - export const subtract: (a: AtomSet, b: AtomSet) => AtomSet = Base.subtract as any; + export const union: (a: AtomSet, b: AtomSet) => AtomSet = Impl.union as any; + export const unionMany: (sets: AtomSet[]) => AtomSet = Impl.unionMany as any; + export const intersect: (a: AtomSet, b: AtomSet) => AtomSet = Impl.intersect as any; + export const subtract: (a: AtomSet, b: AtomSet) => AtomSet = Impl.subtract as any; export function SortedBuilder(parent: AtomSet) { return createBuilder(parent, true); } export function Builder(parent: AtomSet) { return createBuilder(parent, false); } diff --git a/src/mol-data/structure/atom-set/builder.ts b/src/mol-data/structure/atom/set/builder.ts similarity index 91% rename from src/mol-data/structure/atom-set/builder.ts rename to src/mol-data/structure/atom/set/builder.ts index e566c30dc..d79afeb79 100644 --- a/src/mol-data/structure/atom-set/builder.ts +++ b/src/mol-data/structure/atom/set/builder.ts @@ -4,9 +4,9 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import AtomSet from '../atom-set' -import OrderedSet from '../../../mol-base/collections/integer/ordered-set' -import { sortArray } from '../../../mol-base/collections/sort' +import AtomSet from '../set' +import { OrderedSet } from '../../../../mol-base/collections/integer' +import { sortArray } from '../../../../mol-base/collections/sort' class Builder { private keys: number[] = []; diff --git a/src/mol-data/structure/atom-set/base.ts b/src/mol-data/structure/atom/set/impl.ts similarity index 97% rename from src/mol-data/structure/atom-set/base.ts rename to src/mol-data/structure/atom/set/impl.ts index d8be533e7..fab4133aa 100644 --- a/src/mol-data/structure/atom-set/base.ts +++ b/src/mol-data/structure/atom/set/impl.ts @@ -4,13 +4,10 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import OrderedSet from '../../../mol-base/collections/integer/ordered-set' -import SortedArray from '../../../mol-base/collections/integer/sorted-array' -import Iterator from '../../../mol-base/collections/iterator' -import Interval from '../../../mol-base/collections/integer/interval' -import { sortArray } from '../../../mol-base/collections/sort' -import { hash1 } from '../../../mol-base/collections/hash-functions' -import Atom from '../atom' +import { SortedArray, Interval, Iterator, OrderedSet } from '../../../../mol-base/collections/integer' +import { sortArray } from '../../../../mol-base/collections/sort' +import { hash1 } from '../../../../mol-base/collections/hash-functions' +import Atom from '../../atom' /** Long and painful implementation starts here */ diff --git a/src/mol-data/structure/atom-set/properties.ts b/src/mol-data/structure/atom/set/properties.ts similarity index 100% rename from src/mol-data/structure/atom-set/properties.ts rename to src/mol-data/structure/atom/set/properties.ts diff --git a/src/mol-data/structure/base.ts b/src/mol-data/structure/base.ts deleted file mode 100644 index 210c7dcd5..000000000 --- a/src/mol-data/structure/base.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2017 molio contributors, licensed under MIT, See LICENSE file for more info. - * - * @author David Sehnal <david.sehnal@gmail.com> - */ - -import Model from '../model' -import Structure from '../structure' -import Unit from './unit' -import Operator from './operator' -import AtomSet from './atom-set' -import OrderedSet from '../../mol-base/collections/integer/ordered-set' - -export class StructureBuilder { - private units = Object.create(null); - private atoms = Object.create(null); - - addUnit(unit: Unit) { this.units[unit.id] = unit; } - addAtoms(unitId: number, atoms: OrderedSet) { this.atoms[unitId] = atoms; } - - getStructure(): Structure { return { units: this.units, atoms: AtomSet.create(this.atoms) }; } -} - -export const Empty: Structure = { units: {}, atoms: AtomSet.Empty }; - -export function ofModel(model: Model): Structure { - const chains = model.hierarchy.chainSegments; - const builder = new StructureBuilder(); - - for (let c = 0; c < chains.count; c++) { - const unit = Unit.create(model, Operator.Identity); - builder.addUnit(unit); - builder.addAtoms(unit.id, OrderedSet.ofBounds(chains.segments[c], chains.segments[c + 1])); - } - - return builder.getStructure(); -} \ No newline at end of file diff --git a/src/mol-data/structure/structure.ts b/src/mol-data/structure/structure.ts new file mode 100644 index 000000000..fcfb15a9d --- /dev/null +++ b/src/mol-data/structure/structure.ts @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2017 molio contributors, licensed under MIT, See LICENSE file for more info. + * + * @author David Sehnal <david.sehnal@gmail.com> + */ + +import Model from '../model' +import Unit from './unit' +import Operator from './operator' +import AtomSet from './atom/set' +import { OrderedSet } from '../../mol-base/collections/integer' + +interface Structure extends Readonly<{ + units: { readonly [id: number]: Unit }, + atoms: AtomSet +}> { } + +namespace Structure { + export const Empty = { units: {}, atoms: AtomSet.Empty }; + + export function ofModel(model: Model): Structure { + const chains = model.hierarchy.chainSegments; + const builder = Builder(); + + for (let c = 0; c < chains.count; c++) { + const unit = Unit.create(model, Operator.Identity); + builder.addUnit(unit); + builder.addAtoms(unit.id, OrderedSet.ofBounds(chains.segments[c], chains.segments[c + 1])); + } + + return builder.getStructure(); + } + + export interface Builder { + addUnit(unit: Unit): void, + addAtoms(unitId: number, atoms: OrderedSet): void, + getStructure(): Structure, + readonly atomCount: number + } + + class BuilderImpl implements Builder { + private units = Object.create(null); + private atoms = Object.create(null); + atomCount = 0; + + addUnit(unit: Unit) { this.units[unit.id] = unit; } + addAtoms(unitId: number, atoms: OrderedSet) { this.atoms[unitId] = atoms; this.atomCount += OrderedSet.size(atoms); } + getStructure(): Structure { return this.atomCount > 0 ? { units: this.units, atoms: AtomSet.create(this.atoms) } : Empty; } + } + + export function Builder(): Builder { return new BuilderImpl(); } + + + // TODO: "lift" atom set operators? + // TODO: "diff" +} + +export default Structure \ No newline at end of file diff --git a/src/perf-tests/sets.ts b/src/perf-tests/sets.ts index b94f63786..e4f067085 100644 --- a/src/perf-tests/sets.ts +++ b/src/perf-tests/sets.ts @@ -1,8 +1,6 @@ import * as B from 'benchmark' -import Tuple from '../mol-base/collections/integer/tuple' -import OrdSet from '../mol-base/collections/integer/ordered-set' -import AtomSet from '../mol-data/structure/atom-set' -import Segmentation from '../mol-base/collections/integer/segmentation' +import { Tuple, Segmentation, OrderedSet as OrdSet } from '../mol-base/collections/integer' +import { AtomSet } from '../mol-data/structure' export namespace Iteration { const U = 1000, V = 2500; diff --git a/src/perf-tests/structure.ts b/src/perf-tests/structure.ts index 31488d2e3..6549e7e16 100644 --- a/src/perf-tests/structure.ts +++ b/src/perf-tests/structure.ts @@ -11,11 +11,8 @@ import * as fs from 'fs' import CIF from '../mol-io/reader/cif' import Model from '../mol-data/Model' -import Structure from '../mol-data/structure' -import OrdSet from '../mol-base/collections/integer/ordered-set' -import Atom from '../mol-data/structure/atom' -import AtomSet from '../mol-data/structure/atom-set' -import Segmentation from '../mol-base/collections/integer/segmentation' +import { Structure, Atom, AtomSet } from '../mol-data/structure' +import { OrderedSet as OrdSet, Segmentation } from '../mol-base/collections/integer' require('util.promisify').shim(); const readFileAsync = util.promisify(fs.readFile); -- GitLab