Skip to content
Snippets Groups Projects
Commit 4efaf1c2 authored by David Sehnal's avatar David Sehnal
Browse files

Module refactoring

parent 10e43067
Branches
Tags
No related merge requests found
Showing
with 32 additions and 39 deletions
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @author David Sehnal <david.sehnal@gmail.com> * @author David Sehnal <david.sehnal@gmail.com>
*/ */
import Iterator from 'mol-base/collections/iterator' import Iterator from 'mol-data/iterator'
import CIF, { Category } from 'mol-io/reader/cif' import CIF, { Category } from 'mol-io/reader/cif'
import * as Encoder from 'mol-io/writer/cif' import * as Encoder from 'mol-io/writer/cif'
import * as fs from 'fs' import * as fs from 'fs'
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @author David Sehnal <david.sehnal@gmail.com> * @author David Sehnal <david.sehnal@gmail.com>
*/ */
import { Column } from 'mol-base/collections/database' import { Column } from 'mol-data/db'
import { Field } from 'mol-io/reader/cif/data-model' import { Field } from 'mol-io/reader/cif/data-model'
import { FieldDefinition, FieldType } from 'mol-io/writer/cif/encoder' import { FieldDefinition, FieldType } from 'mol-io/writer/cif/encoder'
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @author David Sehnal <david.sehnal@gmail.com> * @author David Sehnal <david.sehnal@gmail.com>
*/ */
import { Table } from 'mol-base/collections/database' import { Table } from 'mol-data/db'
import { CIFEncoder, create as createEncoder } from 'mol-io/writer/cif' import { CIFEncoder, create as createEncoder } from 'mol-io/writer/cif'
import * as S from './schemas' import * as S from './schemas'
import { getCategoryInstanceProvider } from './utils' import { getCategoryInstanceProvider } from './utils'
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @author David Sehnal <david.sehnal@gmail.com> * @author David Sehnal <david.sehnal@gmail.com>
*/ */
import { Column } from 'mol-base/collections/database' import { Column } from 'mol-data/db'
import Type = Column.Schema import Type = Column.Schema
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
* @author David Sehnal <david.sehnal@gmail.com> * @author David Sehnal <david.sehnal@gmail.com>
*/ */
import { Table } from 'mol-base/collections/database' import { Table } from 'mol-data/db'
import Iterator from 'mol-base/collections/iterator' import Iterator from 'mol-data/iterator'
import * as Encoder from 'mol-io/writer/cif' import * as Encoder from 'mol-io/writer/cif'
function columnValue(k: string) { function columnValue(k: string) {
......
/**
* Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
import now from './time'
export default interface UUID extends String { '@type': 'uuid' }
export function newUUID(): UUID {
let d = (+new Date()) + now();
const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
const r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return (c==='x' ? r : (r&0x3|0x8)).toString(16);
});
return uuid as any;
}
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @author David Sehnal <david.sehnal@gmail.com> * @author David Sehnal <david.sehnal@gmail.com>
*/ */
import EquivalenceClasses from '../equivalence-classes' import EquivalenceClasses from '../util/equivalence-classes'
describe('equiv-classes', () => { describe('equiv-classes', () => {
it('integer mod classes', () => { it('integer mod classes', () => {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @author David Sehnal <david.sehnal@gmail.com> * @author David Sehnal <david.sehnal@gmail.com>
*/ */
import * as Sort from '../sort' import * as Sort from '../util/sort'
function shuffle<T>(data: T, len: number, clone: (s: T) => T, swap: Sort.Swapper = Sort.arraySwap) { function shuffle<T>(data: T, len: number, clone: (s: T) => T, swap: Sort.Swapper = Sort.arraySwap) {
const a = clone(data); const a = clone(data);
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* @author David Sehnal <david.sehnal@gmail.com> * @author David Sehnal <david.sehnal@gmail.com>
*/ */
import Database from './database/database' import Database from './db/database'
import Table from './database/table' import Table from './db/table'
import Column from './database/column' import Column from './db/column'
import * as ColumnHelpers from './database/column-helpers' import * as ColumnHelpers from './db/column-helpers'
export { Database, Table, Column, ColumnHelpers } export { Database, Table, Column, ColumnHelpers }
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
import * as ColumnHelpers from './column-helpers' import * as ColumnHelpers from './column-helpers'
import Tensors from '../../math/tensor' import { Tensor as Tensors } from 'mol-math/linear-algebra'
interface Column<T> { interface Column<T> {
readonly '@type': Column.Type, readonly '@type': Column.Type,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
import Column from './column' import Column from './column'
import { sortArray } from '../sort' import { sortArray } from '../util/sort'
/** A collection of columns */ /** A collection of columns */
type Table<Schema extends Table.Schema> = { type Table<Schema extends Table.Schema> = {
......
/**
* Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
import * as DB from './db'
import * as Int from './int'
import Iterator from './iterator'
import * as Util from './util'
export { DB, Int, Iterator, Util }
\ No newline at end of file
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
* @author David Sehnal <david.sehnal@gmail.com> * @author David Sehnal <david.sehnal@gmail.com>
*/ */
import Interval from './integer/interval' import Interval from './int/interval'
import OrderedSet from './integer/ordered-set' import OrderedSet from './int/ordered-set'
import Segmentation from './integer/segmentation' import Segmentation from './int/segmentation'
import SortedArray from './integer/sorted-array' import SortedArray from './int/sorted-array'
import Tuple from './integer/tuple' import Tuple from './int/tuple'
import LinkedIndex from './integer/linked-index' import LinkedIndex from './int/linked-index'
import Iterator from './iterator' import Iterator from './iterator'
export { Interval, OrderedSet, Segmentation, SortedArray, Tuple, LinkedIndex, Iterator } export { Interval, OrderedSet, Segmentation, SortedArray, Tuple, LinkedIndex, Iterator }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment