Browse Source

Fix build & tests

David Sehnal 6 years ago
parent
commit
da051fd1f8

+ 21 - 7
package-lock.json

@@ -3326,12 +3326,14 @@
         "balanced-match": {
           "version": "1.0.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "brace-expansion": {
           "version": "1.1.11",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "balanced-match": "^1.0.0",
             "concat-map": "0.0.1"
@@ -3346,17 +3348,20 @@
         "code-point-at": {
           "version": "1.1.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "concat-map": {
           "version": "0.0.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "console-control-strings": {
           "version": "1.1.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "core-util-is": {
           "version": "1.0.2",
@@ -3473,7 +3478,8 @@
         "inherits": {
           "version": "2.0.3",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "ini": {
           "version": "1.3.5",
@@ -3485,6 +3491,7 @@
           "version": "1.0.0",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "number-is-nan": "^1.0.0"
           }
@@ -3499,6 +3506,7 @@
           "version": "3.0.4",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "brace-expansion": "^1.1.7"
           }
@@ -3506,12 +3514,14 @@
         "minimist": {
           "version": "0.0.8",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "minipass": {
           "version": "2.2.4",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "safe-buffer": "^5.1.1",
             "yallist": "^3.0.0"
@@ -3530,6 +3540,7 @@
           "version": "0.5.1",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "minimist": "0.0.8"
           }
@@ -3610,7 +3621,8 @@
         "number-is-nan": {
           "version": "1.0.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "object-assign": {
           "version": "4.1.1",
@@ -3622,6 +3634,7 @@
           "version": "1.4.0",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "wrappy": "1"
           }
@@ -3743,6 +3756,7 @@
           "version": "1.0.2",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "code-point-at": "^1.0.0",
             "is-fullwidth-code-point": "^1.0.0",

+ 3 - 3
src/mol-math/linear-algebra/matrix/principal-axes.ts

@@ -4,10 +4,10 @@
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  */
 
-import Matrix from './matrix.js';
-import { Vec3 } from '../3d.js';
+import Matrix from './matrix';
+import { Vec3 } from '../3d';
 // import { Vec3, Mat4 } from '../3d.js';
-import { svd } from './svd.js';
+import { svd } from './svd';
 
 // const negateVector = Vec3.create(-1, -1, -1)
 // const tmpMatrix = Mat4.identity()

+ 69 - 69
src/mol-model/structure/query/queries/modifiers.ts

@@ -4,7 +4,7 @@
  * @author David Sehnal <david.sehnal@gmail.com>
  */
 
-import { Segmentation, SortedArray } from 'mol-data/int';
+import { Segmentation } from 'mol-data/int';
 import { Structure, Unit } from '../../structure';
 import { StructureQuery } from '../query';
 import { StructureSelection } from '../selection';
@@ -310,73 +310,73 @@ export function includeConnected({ query, layerCount, wholeResidues, bondTest }:
     }
 }
 
-function defaultBondTest(ctx: QueryContext) {
-    return true;
-}
-
-interface IncludeConnectedCtx {
-    queryCtx: QueryContext,
-    input: Structure,
-    bondTest: QueryFn<boolean>,
-    wholeResidues: boolean
-}
-
-type FrontierSet = UniqueArray<StructureElement.UnitIndex, StructureElement.UnitIndex>
-type Frontier = { unitIds: UniqueArray<number>, elements: Map<number /* unit id */, FrontierSet> }
-
-namespace Frontier {
-    export function has({ elements }: Frontier, unitId: number, element: StructureElement.UnitIndex) {
-        if (!elements.has(unitId)) return false;
-        const xs = elements.get(unitId)!;
-        return xs.keys.has(element);
-    }
-
-    export function create(pivot: Structure, input: Structure) {
-        const unitIds = UniqueArray.create<number>();
-        const elements: Frontier['elements'] = new Map();
-        for (const unit of pivot.units) {
-            if (!Unit.isAtomic(unit)) continue;
-
-            UniqueArray.add(unitIds, unit.id, unit.id);
-            const xs: FrontierSet = UniqueArray.create();
-            elements.set(unit.id, xs);
-
-            const pivotElements = unit.elements;
-            const inputElements = input.unitMap.get(unit.id).elements;
-            for (let i = 0, _i = pivotElements.length; i < _i; i++) {
-                const idx = SortedArray.indexOf(inputElements, pivotElements[i]) as StructureElement.UnitIndex;
-                UniqueArray.add(xs, idx, idx);
-            }
-        }
-
-        return { unitIds, elements };
-    }
-
-    export function addFrontier(target: Frontier, from: Frontier) {
-        for (const unitId of from.unitIds.array) {
-            let xs: FrontierSet;
-            if (target.elements.has(unitId)) {
-                xs = target.elements.get(unitId)!;
-            } else {
-                xs = UniqueArray.create();
-                target.elements.set(unitId, xs);
-                UniqueArray.add(target.unitIds, unitId, unitId);
-            }
-
-            for (const e of from.elements.get(unitId)!.array) {
-                UniqueArray.add(xs, e, e);
-            }
-        }
-        return target;
-    }
-
-    export function includeWholeResidues(structure: Structure, frontier: Frontier) {
-        // ...
-    }
-}
-
-function expandFrontier(ctx: IncludeConnectedCtx, currentFrontier: Frontier, result: Frontier): Frontier {
-    return 0 as any;
-}
+// function defaultBondTest(ctx: QueryContext) {
+//     return true;
+// }
+
+// interface IncludeConnectedCtx {
+//     queryCtx: QueryContext,
+//     input: Structure,
+//     bondTest: QueryFn<boolean>,
+//     wholeResidues: boolean
+// }
+
+// type FrontierSet = UniqueArray<StructureElement.UnitIndex, StructureElement.UnitIndex>
+// type Frontier = { unitIds: UniqueArray<number>, elements: Map<number /* unit id */, FrontierSet> }
+
+// namespace Frontier {
+//     export function has({ elements }: Frontier, unitId: number, element: StructureElement.UnitIndex) {
+//         if (!elements.has(unitId)) return false;
+//         const xs = elements.get(unitId)!;
+//         return xs.keys.has(element);
+//     }
+
+//     export function create(pivot: Structure, input: Structure) {
+//         const unitIds = UniqueArray.create<number>();
+//         const elements: Frontier['elements'] = new Map();
+//         for (const unit of pivot.units) {
+//             if (!Unit.isAtomic(unit)) continue;
+
+//             UniqueArray.add(unitIds, unit.id, unit.id);
+//             const xs: FrontierSet = UniqueArray.create();
+//             elements.set(unit.id, xs);
+
+//             const pivotElements = unit.elements;
+//             const inputElements = input.unitMap.get(unit.id).elements;
+//             for (let i = 0, _i = pivotElements.length; i < _i; i++) {
+//                 const idx = SortedArray.indexOf(inputElements, pivotElements[i]) as StructureElement.UnitIndex;
+//                 UniqueArray.add(xs, idx, idx);
+//             }
+//         }
+
+//         return { unitIds, elements };
+//     }
+
+//     export function addFrontier(target: Frontier, from: Frontier) {
+//         for (const unitId of from.unitIds.array) {
+//             let xs: FrontierSet;
+//             if (target.elements.has(unitId)) {
+//                 xs = target.elements.get(unitId)!;
+//             } else {
+//                 xs = UniqueArray.create();
+//                 target.elements.set(unitId, xs);
+//                 UniqueArray.add(target.unitIds, unitId, unitId);
+//             }
+
+//             for (const e of from.elements.get(unitId)!.array) {
+//                 UniqueArray.add(xs, e, e);
+//             }
+//         }
+//         return target;
+//     }
+
+//     export function includeWholeResidues(structure: Structure, frontier: Frontier) {
+//         // ...
+//     }
+// }
+
+// function expandFrontier(ctx: IncludeConnectedCtx, currentFrontier: Frontier, result: Frontier): Frontier {
+//     return 0 as any;
+// }
 
 // TODO: unionBy (skip this one?), cluster