@mat3ra/made 2024.3.23-2 → 2024.3.25-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/post-checkout +3 -0
- package/.husky/post-commit +3 -0
- package/.husky/post-merge +3 -0
- package/.husky/pre-commit +6 -0
- package/.husky/pre-push +3 -0
- package/dist/basis/basis.d.ts +7 -2
- package/dist/basis/basis.js +12 -2
- package/dist/cell/cell.js +1 -1
- package/dist/cell/conventional_cell.d.ts +1 -1
- package/dist/cell/primitive_cell.d.ts +1 -1
- package/dist/constants.d.ts +2 -2
- package/dist/constants.js +2 -2
- package/dist/lattice/lattice.d.ts +2 -2
- package/dist/lattice/lattice_bravais.d.ts +1 -1
- package/dist/lattice/lattice_vectors.d.ts +1 -1
- package/dist/lattice/reciprocal/lattice_reciprocal.js +1 -1
- package/dist/lattice/types.d.ts +1 -1
- package/dist/made.d.ts +4 -4
- package/dist/material.d.ts +27 -28
- package/dist/material.js +1 -1
- package/dist/math.d.ts +1 -1
- package/dist/math.js +1 -1
- package/dist/parsers/espresso.d.ts +1 -1
- package/dist/parsers/xyz.d.ts +2 -2
- package/dist/parsers/xyz_combinatorial_basis.d.ts +2 -2
- package/dist/tools/supercell.d.ts +1 -1
- package/dist/tools/surface.d.ts +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +5 -4
- package/src/js/basis/basis.ts +14 -3
- package/src/js/cell/cell.ts +1 -1
- package/src/js/cell/conventional_cell.ts +1 -1
- package/src/js/cell/primitive_cell.ts +1 -1
- package/src/js/constants.js +2 -2
- package/src/js/lattice/lattice.ts +1 -1
- package/src/js/lattice/lattice_bravais.ts +1 -1
- package/src/js/lattice/lattice_vectors.ts +1 -1
- package/src/js/lattice/reciprocal/lattice_reciprocal.js +1 -1
- package/src/js/lattice/reciprocal/symmetry_points.ts +1 -1
- package/src/js/lattice/types.ts +1 -1
- package/src/js/material.ts +4 -4
- package/src/js/math.js +1 -1
- package/src/js/parsers/espresso.ts +1 -1
- package/src/js/parsers/xyz.ts +1 -1
- package/src/js/types.ts +2 -2
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/post-checkout'.\n"; exit 2; }
|
|
3
|
+
git lfs post-checkout "$@"
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/post-commit'.\n"; exit 2; }
|
|
3
|
+
git lfs post-commit "$@"
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/post-merge'.\n"; exit 2; }
|
|
3
|
+
git lfs post-merge "$@"
|
package/.husky/pre-push
ADDED
package/dist/basis/basis.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export declare class Basis {
|
|
|
57
57
|
labels, }: BasisProps);
|
|
58
58
|
static get unitsOptionsConfig(): typeof ATOMIC_COORD_UNITS;
|
|
59
59
|
static get unitsOptionsDefaultValue(): string;
|
|
60
|
-
static get defaultCell(): [import("@mat3ra/esse/
|
|
60
|
+
static get defaultCell(): [import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema, import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema, import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema];
|
|
61
61
|
/**
|
|
62
62
|
* Serialize class instance to JSON.
|
|
63
63
|
* @example As below:
|
|
@@ -178,7 +178,12 @@ export declare class Basis {
|
|
|
178
178
|
* Returns a nested array with elements and their corresponding coordinates
|
|
179
179
|
* @example Output: [ ["Si", [0,0,0]], ["Si", [0.5,0.5,0.5]] ]
|
|
180
180
|
*/
|
|
181
|
-
get elementsAndCoordinatesArray(): [string, Coordinate
|
|
181
|
+
get elementsAndCoordinatesArray(): [string, Coordinate][];
|
|
182
|
+
/**
|
|
183
|
+
* Returns a nested array with elements and their corresponding coordinates with labels
|
|
184
|
+
* @example Output: [ ["Si", [0,0,0], ['1']], ["Si", [0.5,0.5,0.5]] , ['2']]
|
|
185
|
+
*/
|
|
186
|
+
get elementsAndCoordinatesAndLabelsArray(): [string, Coordinate, string][];
|
|
182
187
|
/**
|
|
183
188
|
* @summary Concatenates elements and sorts them in alphanumeric order.
|
|
184
189
|
* E.g.,
|
package/dist/basis/basis.js
CHANGED
|
@@ -276,6 +276,16 @@ class Basis {
|
|
|
276
276
|
* @example Output: [ ["Si", [0,0,0]], ["Si", [0.5,0.5,0.5]] ]
|
|
277
277
|
*/
|
|
278
278
|
get elementsAndCoordinatesArray() {
|
|
279
|
+
return this._elements.array.map((element, idx) => {
|
|
280
|
+
const coordinates = this.getCoordinateByIndex(idx);
|
|
281
|
+
return [element, coordinates];
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Returns a nested array with elements and their corresponding coordinates with labels
|
|
286
|
+
* @example Output: [ ["Si", [0,0,0], ['1']], ["Si", [0.5,0.5,0.5]] , ['2']]
|
|
287
|
+
*/
|
|
288
|
+
get elementsAndCoordinatesAndLabelsArray() {
|
|
279
289
|
return this._elements.array.map((element, idx) => {
|
|
280
290
|
const coordinates = this.getCoordinateByIndex(idx);
|
|
281
291
|
const atomicLabel = this.atomicLabelsArray[idx];
|
|
@@ -297,7 +307,7 @@ class Basis {
|
|
|
297
307
|
// make a copy to prevent modifying class values
|
|
298
308
|
const clsInstance = new Basis(this.toJSON());
|
|
299
309
|
clsInstance.toStandardRepresentation();
|
|
300
|
-
const standardRep = clsInstance.
|
|
310
|
+
const standardRep = clsInstance.elementsAndCoordinatesAndLabelsArray.map((entry) => {
|
|
301
311
|
const element = entry[0];
|
|
302
312
|
const coordinate = entry[1];
|
|
303
313
|
const atomicLabel = entry[2];
|
|
@@ -342,7 +352,7 @@ class Basis {
|
|
|
342
352
|
* E.g., ``` ['Si 0 0 0', 'Li 0.5 0.5 0.5']```
|
|
343
353
|
*/
|
|
344
354
|
get atomicPositions() {
|
|
345
|
-
return this.
|
|
355
|
+
return this.elementsAndCoordinatesAndLabelsArray.map((entry, idx) => {
|
|
346
356
|
const element = entry[0];
|
|
347
357
|
const coordinate = entry[1];
|
|
348
358
|
const atomicLabel = this.atomicLabelsArray[idx];
|
package/dist/cell/cell.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Cell = void 0;
|
|
7
|
-
const math_1 = require("@
|
|
7
|
+
const math_1 = require("@mat3ra/code/dist/js/math");
|
|
8
8
|
const constants_1 = __importDefault(require("../constants"));
|
|
9
9
|
const MATRIX = math_1.math.matrix;
|
|
10
10
|
const MULT = math_1.math.multiply;
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "@
|
|
2
|
-
export { default } from "@
|
|
1
|
+
export * from "@mat3ra/code/dist/js/constants";
|
|
2
|
+
export { default } from "@mat3ra/code/dist/js/constants";
|
package/dist/constants.js
CHANGED
|
@@ -19,7 +19,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.default = void 0;
|
|
21
21
|
// TODO: adjust the imports and remove the need for re-exporting
|
|
22
|
-
__exportStar(require("@
|
|
22
|
+
__exportStar(require("@mat3ra/code/dist/js/constants"), exports);
|
|
23
23
|
// eslint-disable-next-line no-restricted-exports
|
|
24
|
-
var constants_1 = require("@
|
|
24
|
+
var constants_1 = require("@mat3ra/code/dist/js/constants");
|
|
25
25
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(constants_1).default; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LatticeImplicitSchema, LatticeSchema, LatticeTypeExtendedSchema } from "@mat3ra/esse/
|
|
1
|
+
import { LatticeImplicitSchema, LatticeSchema, LatticeTypeExtendedSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
2
|
import { Cell } from "../cell/cell";
|
|
3
3
|
import { FromVectorsProps, LatticeBravais } from "./lattice_bravais";
|
|
4
4
|
import { BravaisConfigProps, LatticeVectors } from "./lattice_vectors";
|
|
@@ -61,7 +61,7 @@ export declare class Lattice extends LatticeBravais implements LatticeSchema {
|
|
|
61
61
|
/**
|
|
62
62
|
* Get lattice vectors as a nested array
|
|
63
63
|
*/
|
|
64
|
-
get vectorArrays(): [import("@mat3ra/esse/
|
|
64
|
+
get vectorArrays(): [import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema, import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema, import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema];
|
|
65
65
|
get Cell(): Cell;
|
|
66
66
|
/**
|
|
67
67
|
* Get a short label for the type of the lattice, eg. "MCLC".
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LatticeImplicitSchema, LatticeTypeSchema } from "@mat3ra/esse/
|
|
1
|
+
import { LatticeImplicitSchema, LatticeTypeSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
2
|
import { Vector, VectorsAsArray } from "./types";
|
|
3
3
|
export type Units = Required<LatticeImplicitSchema>["units"];
|
|
4
4
|
export interface FromVectorsProps {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LatticeExplicitUnit, LatticeImplicitSchema } from "@mat3ra/esse/
|
|
1
|
+
import { LatticeExplicitUnit, LatticeImplicitSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
2
|
import { Vector } from "./types";
|
|
3
3
|
type RequiredLatticeExplicitUnit = Required<LatticeExplicitUnit>;
|
|
4
4
|
export interface BravaisConfigProps extends Partial<LatticeImplicitSchema> {
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ReciprocalLattice = void 0;
|
|
7
|
-
const constants_1 = require("@
|
|
7
|
+
const constants_1 = require("@mat3ra/code/dist/js/constants");
|
|
8
8
|
const array_almost_equal_1 = __importDefault(require("array-almost-equal"));
|
|
9
9
|
const lodash_1 = __importDefault(require("lodash"));
|
|
10
10
|
const math_1 = __importDefault(require("../../math"));
|
package/dist/lattice/types.d.ts
CHANGED
package/dist/made.d.ts
CHANGED
|
@@ -20,10 +20,10 @@ export namespace Made {
|
|
|
20
20
|
export { ArrayWithIds };
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
import { coefficients } from "@
|
|
24
|
-
import { tolerance } from "@
|
|
25
|
-
import { units } from "@
|
|
26
|
-
import { ATOMIC_COORD_UNITS } from "@
|
|
23
|
+
import { coefficients } from "@mat3ra/code/dist/js/constants";
|
|
24
|
+
import { tolerance } from "@mat3ra/code/dist/js/constants";
|
|
25
|
+
import { units } from "@mat3ra/code/dist/js/constants";
|
|
26
|
+
import { ATOMIC_COORD_UNITS } from "@mat3ra/code/dist/js/constants";
|
|
27
27
|
import MadeMath from "./math";
|
|
28
28
|
import { Material } from "./material";
|
|
29
29
|
import { MaterialMixin } from "./material";
|
package/dist/material.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HasConsistencyChecksHasMetadataNamedDefaultableInMemoryEntity } from "@
|
|
2
|
-
import { AnyObject } from "@
|
|
3
|
-
import { ConsistencyCheck, DerivedPropertiesSchema, FileSourceSchema, MaterialSchema } from "@mat3ra/esse/
|
|
1
|
+
import { HasConsistencyChecksHasMetadataNamedDefaultableInMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
2
|
+
import { AnyObject } from "@mat3ra/code/dist/js/entity/in_memory";
|
|
3
|
+
import { ConsistencyCheck, DerivedPropertiesSchema, FileSourceSchema, MaterialSchema } from "@mat3ra/esse/dist/js/types";
|
|
4
4
|
import { ConstrainedBasis } from "./basis/constrained_basis";
|
|
5
5
|
import { Constraint } from "./constraints/constraints";
|
|
6
6
|
import { Lattice } from "./lattice/lattice";
|
|
@@ -194,6 +194,7 @@ export declare function MaterialMixin<T extends MaterialBaseEntityConstructor =
|
|
|
194
194
|
};
|
|
195
195
|
setProp: ((name: string, value: unknown) => void) & ((name: string, value: unknown) => void) & ((name: string, value: unknown) => void) & ((name: string, value: unknown) => void) & ((name: string, value: unknown) => void);
|
|
196
196
|
unsetProp: ((name: string) => void) & ((name: string) => void) & ((name: string) => void) & ((name: string) => void) & ((name: string) => void);
|
|
197
|
+
setProps: ((json?: AnyObject | undefined) => any) & ((json?: AnyObject | undefined) => any) & ((json?: AnyObject | undefined) => any) & ((json?: AnyObject | undefined) => any) & ((json?: AnyObject | undefined) => any);
|
|
197
198
|
toJSONSafe: ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject);
|
|
198
199
|
toJSONQuick: ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject);
|
|
199
200
|
clone: ((extraContext?: object | undefined) => any) & ((extraContext?: object | undefined) => any) & ((extraContext?: object | undefined) => any) & ((extraContext?: object | undefined) => any) & ((extraContext?: object | undefined) => any);
|
|
@@ -205,8 +206,8 @@ export declare function MaterialMixin<T extends MaterialBaseEntityConstructor =
|
|
|
205
206
|
getClsName: (() => string) & (() => string) & (() => string) & (() => string) & (() => string);
|
|
206
207
|
readonly slug: string;
|
|
207
208
|
readonly isSystemEntity: boolean;
|
|
208
|
-
getAsEntityReference: ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/
|
|
209
|
-
getEntityByName: ((entities: import("@
|
|
209
|
+
getAsEntityReference: ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema) & ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema) & ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema) & ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema) & ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema);
|
|
210
|
+
getEntityByName: ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity) & ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity) & ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity) & ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity) & ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity);
|
|
210
211
|
metadata: object;
|
|
211
212
|
updateMetadata(object: object): void;
|
|
212
213
|
name: string;
|
|
@@ -397,6 +398,7 @@ export declare const Material: {
|
|
|
397
398
|
};
|
|
398
399
|
setProp: ((name: string, value: unknown) => void) & ((name: string, value: unknown) => void) & ((name: string, value: unknown) => void) & ((name: string, value: unknown) => void) & ((name: string, value: unknown) => void);
|
|
399
400
|
unsetProp: ((name: string) => void) & ((name: string) => void) & ((name: string) => void) & ((name: string) => void) & ((name: string) => void);
|
|
401
|
+
setProps: ((json?: AnyObject | undefined) => any) & ((json?: AnyObject | undefined) => any) & ((json?: AnyObject | undefined) => any) & ((json?: AnyObject | undefined) => any) & ((json?: AnyObject | undefined) => any);
|
|
400
402
|
toJSONSafe: ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject);
|
|
401
403
|
toJSONQuick: ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject) & ((exclude?: string[] | undefined) => AnyObject);
|
|
402
404
|
clone: ((extraContext?: object | undefined) => any) & ((extraContext?: object | undefined) => any) & ((extraContext?: object | undefined) => any) & ((extraContext?: object | undefined) => any) & ((extraContext?: object | undefined) => any);
|
|
@@ -408,8 +410,8 @@ export declare const Material: {
|
|
|
408
410
|
getClsName: (() => string) & (() => string) & (() => string) & (() => string) & (() => string);
|
|
409
411
|
readonly slug: string;
|
|
410
412
|
readonly isSystemEntity: boolean;
|
|
411
|
-
getAsEntityReference: ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/
|
|
412
|
-
getEntityByName: ((entities: import("@
|
|
413
|
+
getAsEntityReference: ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema) & ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema) & ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema) & ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema) & ((byIdOnly?: boolean | undefined) => import("@mat3ra/esse/dist/js/types").EntityReferenceSchema);
|
|
414
|
+
getEntityByName: ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity) & ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity) & ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity) & ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity) & ((entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string) => import("@mat3ra/code/dist/js/entity").InMemoryEntity);
|
|
413
415
|
metadata: object;
|
|
414
416
|
updateMetadata(object: object): void;
|
|
415
417
|
name: string;
|
|
@@ -447,14 +449,11 @@ export declare const Material: {
|
|
|
447
449
|
consistencyChecks: object[];
|
|
448
450
|
addConsistencyChecks(array: object[]): void;
|
|
449
451
|
_json: AnyObject;
|
|
450
|
-
prop<T = undefined>(name: string, defaultValue: T): T;
|
|
451
|
-
|
|
452
|
-
*/
|
|
453
|
-
prop<T_1 = undefined>(name: string): T_1 | undefined; /**
|
|
454
|
-
* Converts basis to crystal/fractional coordinates.
|
|
455
|
-
*/
|
|
452
|
+
prop<T = undefined>(name: string, defaultValue: T): T;
|
|
453
|
+
prop<T_1 = undefined>(name: string): T_1 | undefined;
|
|
456
454
|
setProp(name: string, value: unknown): void;
|
|
457
455
|
unsetProp(name: string): void;
|
|
456
|
+
setProps(json?: AnyObject | undefined): any;
|
|
458
457
|
toJSON(exclude?: string[] | undefined): AnyObject;
|
|
459
458
|
toJSONSafe(exclude?: string[] | undefined): AnyObject;
|
|
460
459
|
toJSONQuick(exclude?: string[] | undefined): AnyObject;
|
|
@@ -467,8 +466,8 @@ export declare const Material: {
|
|
|
467
466
|
getClsName(): string;
|
|
468
467
|
readonly slug: string;
|
|
469
468
|
readonly isSystemEntity: boolean;
|
|
470
|
-
getAsEntityReference(byIdOnly?: boolean | undefined): import("@mat3ra/esse/
|
|
471
|
-
getEntityByName(entities: import("@
|
|
469
|
+
getAsEntityReference(byIdOnly?: boolean | undefined): import("@mat3ra/esse/dist/js/types").EntityReferenceSchema;
|
|
470
|
+
getEntityByName(entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string): import("@mat3ra/code/dist/js/entity").InMemoryEntity;
|
|
472
471
|
}) & (new (...args: any[]) => {
|
|
473
472
|
metadata: object;
|
|
474
473
|
updateMetadata(object: object): void;
|
|
@@ -477,9 +476,10 @@ export declare const Material: {
|
|
|
477
476
|
prop<T_1_1 = undefined>(name: string): T_1_1 | undefined;
|
|
478
477
|
setProp(name: string, value: unknown): void;
|
|
479
478
|
unsetProp(name: string): void;
|
|
480
|
-
|
|
481
|
-
* Returns
|
|
479
|
+
setProps(json?: AnyObject | undefined): any; /**
|
|
480
|
+
* Returns a copy of the material with conventional cell constructed instead of primitive.
|
|
482
481
|
*/
|
|
482
|
+
toJSON(exclude?: string[] | undefined): AnyObject;
|
|
483
483
|
toJSONSafe(exclude?: string[] | undefined): AnyObject;
|
|
484
484
|
toJSONQuick(exclude?: string[] | undefined): AnyObject;
|
|
485
485
|
clone(extraContext?: object | undefined): any;
|
|
@@ -491,8 +491,8 @@ export declare const Material: {
|
|
|
491
491
|
getClsName(): string;
|
|
492
492
|
readonly slug: string;
|
|
493
493
|
readonly isSystemEntity: boolean;
|
|
494
|
-
getAsEntityReference(byIdOnly?: boolean | undefined): import("@mat3ra/esse/
|
|
495
|
-
getEntityByName(entities: import("@
|
|
494
|
+
getAsEntityReference(byIdOnly?: boolean | undefined): import("@mat3ra/esse/dist/js/types").EntityReferenceSchema;
|
|
495
|
+
getEntityByName(entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string): import("@mat3ra/code/dist/js/entity").InMemoryEntity;
|
|
496
496
|
}) & (new (...args: any[]) => {
|
|
497
497
|
name: string;
|
|
498
498
|
setName(name: string): void;
|
|
@@ -501,23 +501,21 @@ export declare const Material: {
|
|
|
501
501
|
prop<T_1_2 = undefined>(name: string): T_1_2 | undefined;
|
|
502
502
|
setProp(name: string, value: unknown): void;
|
|
503
503
|
unsetProp(name: string): void;
|
|
504
|
+
setProps(json?: AnyObject | undefined): any;
|
|
504
505
|
toJSON(exclude?: string[] | undefined): AnyObject;
|
|
505
506
|
toJSONSafe(exclude?: string[] | undefined): AnyObject;
|
|
506
507
|
toJSONQuick(exclude?: string[] | undefined): AnyObject;
|
|
507
508
|
clone(extraContext?: object | undefined): any;
|
|
508
509
|
validate(): void;
|
|
509
510
|
clean(config: AnyObject): AnyObject;
|
|
510
|
-
isValid(): boolean;
|
|
511
|
-
* @summary a series of checks for the material and returns an array of results in ConsistencyChecks format.
|
|
512
|
-
* @returns Array of checks results
|
|
513
|
-
*/
|
|
511
|
+
isValid(): boolean;
|
|
514
512
|
id: string;
|
|
515
513
|
readonly cls: string;
|
|
516
514
|
getClsName(): string;
|
|
517
515
|
readonly slug: string;
|
|
518
516
|
readonly isSystemEntity: boolean;
|
|
519
|
-
getAsEntityReference(byIdOnly?: boolean | undefined): import("@mat3ra/esse/
|
|
520
|
-
getEntityByName(entities: import("@
|
|
517
|
+
getAsEntityReference(byIdOnly?: boolean | undefined): import("@mat3ra/esse/dist/js/types").EntityReferenceSchema;
|
|
518
|
+
getEntityByName(entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string): import("@mat3ra/code/dist/js/entity").InMemoryEntity;
|
|
521
519
|
}) & {
|
|
522
520
|
new (...args: any[]): {
|
|
523
521
|
readonly isDefault: boolean;
|
|
@@ -526,6 +524,7 @@ export declare const Material: {
|
|
|
526
524
|
prop<T_1_3 = undefined>(name: string): T_1_3 | undefined;
|
|
527
525
|
setProp(name: string, value: unknown): void;
|
|
528
526
|
unsetProp(name: string): void;
|
|
527
|
+
setProps(json?: AnyObject | undefined): any;
|
|
529
528
|
toJSON(exclude?: string[] | undefined): AnyObject;
|
|
530
529
|
toJSONSafe(exclude?: string[] | undefined): AnyObject;
|
|
531
530
|
toJSONQuick(exclude?: string[] | undefined): AnyObject;
|
|
@@ -538,11 +537,11 @@ export declare const Material: {
|
|
|
538
537
|
getClsName(): string;
|
|
539
538
|
readonly slug: string;
|
|
540
539
|
readonly isSystemEntity: boolean;
|
|
541
|
-
getAsEntityReference(byIdOnly?: boolean | undefined): import("@mat3ra/esse/
|
|
542
|
-
getEntityByName(entities: import("@
|
|
540
|
+
getAsEntityReference(byIdOnly?: boolean | undefined): import("@mat3ra/esse/dist/js/types").EntityReferenceSchema;
|
|
541
|
+
getEntityByName(entities: import("@mat3ra/code/dist/js/entity").InMemoryEntity[], entity: string, name: string): import("@mat3ra/code/dist/js/entity").InMemoryEntity;
|
|
543
542
|
};
|
|
544
543
|
readonly defaultConfig: object | null;
|
|
545
544
|
createDefault(): any;
|
|
546
|
-
} & typeof import("@
|
|
545
|
+
} & typeof import("@mat3ra/code/dist/js/entity").InMemoryEntity;
|
|
547
546
|
export type Material = InstanceType<typeof Material>;
|
|
548
547
|
export {};
|
package/dist/material.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Material = exports.MaterialMixin = exports.defaultMaterialConfig = void 0;
|
|
7
|
-
const entity_1 = require("@
|
|
7
|
+
const entity_1 = require("@mat3ra/code/dist/js/entity");
|
|
8
8
|
const crypto_js_1 = __importDefault(require("crypto-js"));
|
|
9
9
|
const constrained_basis_1 = require("./basis/constrained_basis");
|
|
10
10
|
const conventional_cell_1 = require("./cell/conventional_cell");
|
package/dist/math.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ declare const _default: {
|
|
|
17
17
|
combinationsFromIntervals: (arrA: number[], arrB: number[], arrC: number[]) => number[][];
|
|
18
18
|
calculateSegmentsBetweenPoints3D: (point1: (string | number)[], point2: (string | number)[], n: string | number) => number[][];
|
|
19
19
|
roundValueToNDecimals: (value: number, decimals?: number | undefined) => number;
|
|
20
|
-
numberToPrecision: typeof import("@
|
|
20
|
+
numberToPrecision: typeof import("@mat3ra/code/dist/js/math").numberToPrecision;
|
|
21
21
|
e: number;
|
|
22
22
|
pi: number;
|
|
23
23
|
i: number;
|
package/dist/math.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
// TODO: adjust the imports and remove the need for re-exporting
|
|
4
|
-
const math_1 = require("@
|
|
4
|
+
const math_1 = require("@mat3ra/code/dist/js/math");
|
|
5
5
|
exports.default = {
|
|
6
6
|
...math_1.math,
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MaterialSchema } from "@mat3ra/esse/
|
|
1
|
+
import { MaterialSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
2
|
/**
|
|
3
3
|
* Construct textual representation of a materialOrConfig according to Quantum ESPRESSO pw.x input format.
|
|
4
4
|
* @param materialOrConfig - material class instance or its config object
|
package/dist/parsers/xyz.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MaterialSchema } from "@mat3ra/esse/
|
|
1
|
+
import { MaterialSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
2
|
import { ConstrainedBasis } from "../basis/constrained_basis";
|
|
3
3
|
import { Constraint } from "../constraints/constraints";
|
|
4
4
|
import { Vector } from "../lattice/types";
|
|
@@ -36,7 +36,7 @@ export interface BasisConfig {
|
|
|
36
36
|
* @param units Coordinate units
|
|
37
37
|
* @param cell Basis Cell
|
|
38
38
|
*/
|
|
39
|
-
declare function toBasisConfig(txt: string, units?: string, cell?: [import("@mat3ra/esse/
|
|
39
|
+
declare function toBasisConfig(txt: string, units?: string, cell?: [import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema, import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema, import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema]): BasisConfig;
|
|
40
40
|
/**
|
|
41
41
|
* Create XYZ from Basis class instance.
|
|
42
42
|
* @param basisClsInstance Basis class instance.
|
|
@@ -3,11 +3,11 @@ export class WrongBasisFormat extends Error {
|
|
|
3
3
|
xyz: any;
|
|
4
4
|
}
|
|
5
5
|
export class CombinatorialBasis {
|
|
6
|
-
static toBasisConfig(array: any, units?: string, cell?: [import("@mat3ra/esse/
|
|
6
|
+
static toBasisConfig(array: any, units?: string, cell?: [import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema, import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema, import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema]): {
|
|
7
7
|
elements: any[];
|
|
8
8
|
coordinates: any[];
|
|
9
9
|
units: string;
|
|
10
|
-
cell: [import("@mat3ra/esse/
|
|
10
|
+
cell: [import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema, import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema, import("@mat3ra/esse/dist/js/types").ArrayOf3NumberElementsSchema];
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Creates Combinatorial basis
|
|
@@ -13,7 +13,7 @@ declare function generateNewBasisWithinSupercell(basis: Basis, cell: Cell, super
|
|
|
13
13
|
declare function generateConfig(material: Material, supercellMatrix: number[][]): {
|
|
14
14
|
name: string;
|
|
15
15
|
basis: import("../basis/basis").BasisSchema;
|
|
16
|
-
lattice: import("@mat3ra/esse/
|
|
16
|
+
lattice: import("@mat3ra/esse/dist/js/types").LatticeImplicitSchema;
|
|
17
17
|
};
|
|
18
18
|
declare const _default: {
|
|
19
19
|
generateConfig: typeof generateConfig;
|
package/dist/tools/surface.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export default _default;
|
|
|
5
5
|
declare function generateConfig(material: any, millerIndices: any, numberOfLayers?: number, vx?: number, vy?: number): {
|
|
6
6
|
name: string;
|
|
7
7
|
basis: import("../basis/basis").BasisSchema;
|
|
8
|
-
lattice: import("@mat3ra/esse/
|
|
8
|
+
lattice: import("@mat3ra/esse/dist/js/types").LatticeImplicitSchema;
|
|
9
9
|
outOfPlaneAxisIndex: any;
|
|
10
10
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AnyObject } from "@
|
|
2
|
-
import { MaterialSchema } from "@mat3ra/esse/
|
|
1
|
+
import { AnyObject } from "@mat3ra/code/dist/js/entity/in_memory";
|
|
2
|
+
import { MaterialSchema } from "@mat3ra/esse/dist/js/types";
|
|
3
3
|
export type MaterialJSON = MaterialSchema & AnyObject;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mat3ra/made",
|
|
3
|
-
"version": "2024.3.
|
|
3
|
+
"version": "2024.3.25-1",
|
|
4
4
|
"description": "MAterials DEsign library",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint --cache src/js tests/js && prettier --write src/js tests/js",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"@babel/preset-react": "^7.16.7",
|
|
33
33
|
"@babel/register": "^7.22.15",
|
|
34
34
|
"@babel/runtime-corejs3": "^7.16.8",
|
|
35
|
-
"@exabyte-io/code.js": "2024.2.29-0",
|
|
36
35
|
"@exabyte-io/eslint-config": "^2023.8.29-1",
|
|
37
|
-
"@mat3ra/
|
|
36
|
+
"@mat3ra/code": "2024.3.25-3",
|
|
37
|
+
"@mat3ra/esse": "2024.3.25-6",
|
|
38
38
|
"@mat3ra/tsconfig": "^2024.3.21-5",
|
|
39
39
|
"@types/crypto-js": "^4.2.2",
|
|
40
40
|
"@types/mathjs": "^3.21.1",
|
|
@@ -73,12 +73,13 @@
|
|
|
73
73
|
"crypto-js": "4.2.0",
|
|
74
74
|
"lodash": "^4.17.*",
|
|
75
75
|
"mathjs": "12.4.1",
|
|
76
|
+
"ts-node": "^10.9.1",
|
|
76
77
|
"typescript": "^4.5.5",
|
|
77
78
|
"underscore": "^1.8.3",
|
|
78
79
|
"underscore.string": "^3.3.4"
|
|
79
80
|
},
|
|
80
81
|
"peerDependencies": {
|
|
81
|
-
"@
|
|
82
|
+
"@mat3ra/code": "*",
|
|
82
83
|
"@mat3ra/esse": "*"
|
|
83
84
|
},
|
|
84
85
|
"lint-staged": {
|
package/src/js/basis/basis.ts
CHANGED
|
@@ -362,7 +362,18 @@ export class Basis {
|
|
|
362
362
|
* Returns a nested array with elements and their corresponding coordinates
|
|
363
363
|
* @example Output: [ ["Si", [0,0,0]], ["Si", [0.5,0.5,0.5]] ]
|
|
364
364
|
*/
|
|
365
|
-
get elementsAndCoordinatesArray(): [string, Coordinate
|
|
365
|
+
get elementsAndCoordinatesArray(): [string, Coordinate][] {
|
|
366
|
+
return this._elements.array.map((element, idx) => {
|
|
367
|
+
const coordinates = this.getCoordinateByIndex(idx);
|
|
368
|
+
return [element, coordinates];
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Returns a nested array with elements and their corresponding coordinates with labels
|
|
374
|
+
* @example Output: [ ["Si", [0,0,0], ['1']], ["Si", [0.5,0.5,0.5]] , ['2']]
|
|
375
|
+
*/
|
|
376
|
+
get elementsAndCoordinatesAndLabelsArray(): [string, Coordinate, string][] {
|
|
366
377
|
return this._elements.array.map((element, idx) => {
|
|
367
378
|
const coordinates = this.getCoordinateByIndex(idx);
|
|
368
379
|
const atomicLabel = this.atomicLabelsArray[idx];
|
|
@@ -385,7 +396,7 @@ export class Basis {
|
|
|
385
396
|
// make a copy to prevent modifying class values
|
|
386
397
|
const clsInstance = new Basis(this.toJSON());
|
|
387
398
|
clsInstance.toStandardRepresentation();
|
|
388
|
-
const standardRep = clsInstance.
|
|
399
|
+
const standardRep = clsInstance.elementsAndCoordinatesAndLabelsArray.map((entry) => {
|
|
389
400
|
const element = entry[0];
|
|
390
401
|
const coordinate = entry[1];
|
|
391
402
|
const atomicLabel = entry[2];
|
|
@@ -435,7 +446,7 @@ export class Basis {
|
|
|
435
446
|
* E.g., ``` ['Si 0 0 0', 'Li 0.5 0.5 0.5']```
|
|
436
447
|
*/
|
|
437
448
|
get atomicPositions(): string[] {
|
|
438
|
-
return this.
|
|
449
|
+
return this.elementsAndCoordinatesAndLabelsArray.map((entry, idx) => {
|
|
439
450
|
const element = entry[0];
|
|
440
451
|
const coordinate = entry[1];
|
|
441
452
|
const atomicLabel = this.atomicLabelsArray[idx];
|
package/src/js/cell/cell.ts
CHANGED
package/src/js/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// TODO: adjust the imports and remove the need for re-exporting
|
|
2
|
-
export * from "@
|
|
2
|
+
export * from "@mat3ra/code/dist/js/constants";
|
|
3
3
|
// eslint-disable-next-line no-restricted-exports
|
|
4
|
-
export { default } from "@
|
|
4
|
+
export { default } from "@mat3ra/code/dist/js/constants";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LatticeExplicitUnit, LatticeImplicitSchema } from "@mat3ra/esse/
|
|
1
|
+
import { LatticeExplicitUnit, LatticeImplicitSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
2
|
|
|
3
3
|
import { primitiveCell } from "../cell/primitive_cell";
|
|
4
4
|
import constants from "../constants";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This file contains information about the Brillouin zone symmetry points by lattice type.
|
|
5
5
|
* [AFLOW](https://arxiv.org/abs/1004.2974) methodology is used for implementation.
|
|
6
6
|
*/
|
|
7
|
-
import { LatticeImplicitSchema } from "@mat3ra/esse/
|
|
7
|
+
import { LatticeImplicitSchema } from "@mat3ra/esse/dist/js/types";
|
|
8
8
|
|
|
9
9
|
import { Lattice } from "../lattice";
|
|
10
10
|
|
package/src/js/lattice/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrayOf3NumberElementsSchema, LatticeTypeSchema } from "@mat3ra/esse/
|
|
1
|
+
import { ArrayOf3NumberElementsSchema, LatticeTypeSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
2
|
|
|
3
3
|
export const DEFAULT_LATTICE_UNITS = {
|
|
4
4
|
// by default lattice vectors shall be measured in angstrom, angles - in degrees
|
package/src/js/material.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { HasConsistencyChecksHasMetadataNamedDefaultableInMemoryEntity } from "@
|
|
2
|
-
import { AnyObject } from "@
|
|
3
|
-
// import MaterialJSONSchemaObject from "@mat3ra/esse/
|
|
1
|
+
import { HasConsistencyChecksHasMetadataNamedDefaultableInMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
2
|
+
import { AnyObject } from "@mat3ra/code/dist/js/entity/in_memory";
|
|
3
|
+
// import MaterialJSONSchemaObject from "@mat3ra/esse/dist/js/schema/material.json";
|
|
4
4
|
import {
|
|
5
5
|
ConsistencyCheck,
|
|
6
6
|
DerivedPropertiesSchema,
|
|
7
7
|
FileSourceSchema,
|
|
8
8
|
InChIRepresentationSchema,
|
|
9
9
|
MaterialSchema,
|
|
10
|
-
} from "@mat3ra/esse/
|
|
10
|
+
} from "@mat3ra/esse/dist/js/types";
|
|
11
11
|
import CryptoJS from "crypto-js";
|
|
12
12
|
|
|
13
13
|
import { ConstrainedBasis } from "./basis/constrained_basis";
|
package/src/js/math.js
CHANGED
package/src/js/parsers/xyz.ts
CHANGED
package/src/js/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject } from "@
|
|
2
|
-
import { MaterialSchema } from "@mat3ra/esse/
|
|
1
|
+
import { AnyObject } from "@mat3ra/code/dist/js/entity/in_memory";
|
|
2
|
+
import { MaterialSchema } from "@mat3ra/esse/dist/js/types";
|
|
3
3
|
|
|
4
4
|
export type MaterialJSON = MaterialSchema & AnyObject;
|