@mat3ra/made 2024.6.3-0 → 2024.6.4-0

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.
@@ -1,6 +1,7 @@
1
+ import CodeMath from "@mat3ra/code/dist/js/math";
1
2
  import { Coordinate } from "../basis/types";
2
3
  import { Vector, VectorsAsArray } from "../lattice/types";
3
- type Point = Coordinate | math.Matrix | math.MathType;
4
+ type Point = Coordinate | CodeMath.Matrix | CodeMath.MathType;
4
5
  export declare class Cell {
5
6
  tolerance: number;
6
7
  vector1: Vector;
@@ -21,7 +22,7 @@ export declare class Cell {
21
22
  /**
22
23
  * Convert a point (in crystal coordinates) to cartesian.
23
24
  */
24
- convertPointToCartesian(point: Point): import("mathjs").MathType;
25
+ convertPointToCartesian(point: Point): CodeMath.MathType;
25
26
  /**
26
27
  * Convert a point (in cartesian coordinates) to crystal (fractional).
27
28
  */
@@ -83,7 +83,7 @@ export declare class Lattice extends LatticeBravais implements LatticeSchema {
83
83
  beta: number;
84
84
  gamma: number;
85
85
  units: {
86
- length?: "bohr" | "angstrom" | undefined;
86
+ length?: "angstrom" | "bohr" | undefined;
87
87
  angle?: "degree" | "radian" | undefined;
88
88
  };
89
89
  type: "CUB" | "BCC" | "FCC" | "TET" | "MCL" | "ORC" | "ORCC" | "ORCF" | "ORCI" | "HEX" | "BCT" | "TRI" | "MCLC" | "RHL";
@@ -1,5 +1,5 @@
1
1
  import { HasConsistencyChecksHasMetadataNamedDefaultableInMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
- import { AnyObject } from "@mat3ra/code/dist/js/entity/in_memory";
2
+ import { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
3
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";
@@ -483,9 +483,7 @@ export declare const Material: {
483
483
  setProps(json?: AnyObject | undefined): any;
484
484
  toJSON(exclude?: string[] | undefined): AnyObject;
485
485
  toJSONSafe(exclude?: string[] | undefined): AnyObject;
486
- toJSONQuick(exclude?: string[] | undefined): AnyObject; /**
487
- * Returns a copy of the material with conventional cell constructed instead of primitive.
488
- */
486
+ toJSONQuick(exclude?: string[] | undefined): AnyObject;
489
487
  clone(extraContext?: object | undefined): any;
490
488
  validate(): void;
491
489
  clean(config: AnyObject): AnyObject;
@@ -511,10 +509,7 @@ export declare const Material: {
511
509
  toJSONQuick(exclude?: string[] | undefined): AnyObject;
512
510
  clone(extraContext?: object | undefined): any;
513
511
  validate(): void;
514
- clean(config: AnyObject): AnyObject; /**
515
- * @summary a series of checks for the material's basis and returns an array of results in ConsistencyChecks format.
516
- * @returns Array of checks results
517
- */
512
+ clean(config: AnyObject): AnyObject;
518
513
  isValid(): boolean;
519
514
  id: string;
520
515
  readonly cls: string;
package/dist/js/math.d.ts CHANGED
@@ -35,7 +35,7 @@ declare const _default: {
35
35
  uninitialized: any;
36
36
  version: string;
37
37
  expression: import("mathjs").MathNode;
38
- json: mathjs.MathJsJson;
38
+ json: import("mathjs").MathJsJson;
39
39
  config: (options: any) => void;
40
40
  lsolve(L: import("mathjs").Matrix | import("mathjs").MathArray, b: import("mathjs").Matrix | import("mathjs").MathArray): import("mathjs").Matrix | import("mathjs").MathArray;
41
41
  lup(A?: import("mathjs").Matrix | import("mathjs").MathArray | undefined): import("mathjs").MathArray;
@@ -184,7 +184,7 @@ declare const _default: {
184
184
  re(x: number | import("mathjs").Matrix | import("mathjs").BigNumber | import("mathjs").Complex | import("mathjs").MathArray): number | import("mathjs").Matrix | import("mathjs").BigNumber | import("mathjs").MathArray;
185
185
  bignumber(x?: string | number | boolean | import("mathjs").Matrix | import("mathjs").MathArray | undefined): import("mathjs").BigNumber;
186
186
  boolean(x: string | number | boolean | import("mathjs").Matrix | import("mathjs").MathArray): boolean | import("mathjs").Matrix | import("mathjs").MathArray;
187
- chain(value?: any): any;
187
+ chain(value?: any): import("mathjs").MathJsChain;
188
188
  complex(arg?: string | import("mathjs").Complex | import("mathjs").MathArray | import("mathjs").PolarCoordinates | undefined): import("mathjs").Complex;
189
189
  complex(re: number, im: number): import("mathjs").Complex;
190
190
  fraction(numerator: string | number | import("mathjs").Matrix | import("mathjs").MathArray, denominator?: string | number | import("mathjs").Matrix | import("mathjs").MathArray | undefined): import("mathjs").Matrix | import("mathjs").Fraction | import("mathjs").MathArray;
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const mathjs_1 = __importDefault(require("mathjs"));
3
+ const math_1 = require("@mat3ra/code/dist/js/math");
7
4
  const constants_1 = require("../constants");
8
5
  const lattice_1 = require("../lattice/lattice");
9
6
  /**
@@ -40,8 +37,8 @@ function getBasisConfigTranslatedToCenter(material) {
40
37
  material.toCartesian();
41
38
  const updatedBasis = material.Basis;
42
39
  const centerOfCoordinates = updatedBasis.centerOfCoordinatesPoint;
43
- const centerOfLattice = mathjs_1.default.multiply(0.5, material.Lattice.vectorArrays.reduce((a, b) => mathjs_1.default.add(a, b)));
44
- const translationVector = mathjs_1.default.subtract(centerOfLattice, centerOfCoordinates);
40
+ const centerOfLattice = math_1.math.multiply(0.5, material.Lattice.vectorArrays.reduce((a, b) => math_1.math.add(a, b)));
41
+ const translationVector = math_1.math.subtract(centerOfLattice, centerOfCoordinates);
45
42
  updatedBasis.translateByVector(translationVector);
46
43
  material.setBasis(updatedBasis.toJSON());
47
44
  if (originalUnits !== constants_1.ATOMIC_COORD_UNITS.cartesian)
@@ -1,3 +1,3 @@
1
- import { AnyObject } from "@mat3ra/code/dist/js/entity/in_memory";
1
+ import { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
2
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.6.3-0",
3
+ "version": "2024.6.4-0",
4
4
  "description": "MAterials DEsign library",
5
5
  "scripts": {
6
6
  "lint": "eslint --cache src/js tests/js && prettier --write src/js tests/js",
@@ -33,11 +33,10 @@
33
33
  "@babel/register": "^7.22.15",
34
34
  "@babel/runtime-corejs3": "^7.16.8",
35
35
  "@exabyte-io/eslint-config": "^2023.8.29-1",
36
- "@mat3ra/code": "2024.3.25-3",
37
- "@mat3ra/esse": "2024.3.25-6",
38
- "@mat3ra/tsconfig": "^2024.3.25-5",
36
+ "@mat3ra/code": "2024.6.4-0",
37
+ "@mat3ra/esse": "2024.6.4-1",
38
+ "@mat3ra/tsconfig": "2024.6.3-0",
39
39
  "@types/crypto-js": "^4.2.2",
40
- "@types/mathjs": "^3.21.1",
41
40
  "@typescript-eslint/eslint-plugin": "^5.9.1",
42
41
  "@typescript-eslint/parser": "^5.9.1",
43
42
  "chai": "^4.3.4",
@@ -72,7 +71,6 @@
72
71
  "array-almost-equal": "^1.0.0",
73
72
  "crypto-js": "4.2.0",
74
73
  "lodash": "^4.17.*",
75
- "mathjs": "12.4.1",
76
74
  "ts-node": "^10.9.1",
77
75
  "typescript": "^4.5.5",
78
76
  "underscore": "^1.8.3",
@@ -1,4 +1,4 @@
1
- import { math } from "@mat3ra/code/dist/js/math";
1
+ import CodeMath, { math } from "@mat3ra/code/dist/js/math";
2
2
 
3
3
  import { Coordinate } from "../basis/types";
4
4
  import constants from "../constants";
@@ -10,7 +10,7 @@ const INV = math.inv;
10
10
  // @ts-ignore
11
11
  const MATRIX_MULT = (...args) => MULT(...args.map((x) => MATRIX(x))).toArray();
12
12
 
13
- type Point = Coordinate | math.Matrix | math.MathType;
13
+ type Point = Coordinate | CodeMath.Matrix | CodeMath.MathType;
14
14
 
15
15
  /*
16
16
  * Cell represents a unit cell in geometrical form: 3x3 matrix where rows are cell vectors.
@@ -64,7 +64,7 @@ export class Cell {
64
64
  /**
65
65
  * Convert a point (in crystal coordinates) to cartesian.
66
66
  */
67
- convertPointToCartesian(point: Point) {
67
+ convertPointToCartesian(point: Point): CodeMath.MathType {
68
68
  return MULT(point, this.vectorsAsArray);
69
69
  }
70
70
 
@@ -1,5 +1,5 @@
1
1
  import { HasConsistencyChecksHasMetadataNamedDefaultableInMemoryEntity } from "@mat3ra/code/dist/js/entity";
2
- import { AnyObject } from "@mat3ra/code/dist/js/entity/in_memory";
2
+ import { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
3
3
  import {
4
4
  ConsistencyCheck,
5
5
  DerivedPropertiesSchema,
@@ -1,6 +1,6 @@
1
1
  // TODO: adjust the imports and remove the need for re-exporting
2
- import { math as codeJSMath } from "@mat3ra/code/dist/js/math";
2
+ import { math } from "@mat3ra/code/dist/js/math";
3
3
 
4
4
  export default {
5
- ...codeJSMath,
5
+ ...math,
6
6
  };
@@ -1,4 +1,4 @@
1
- import math from "mathjs";
1
+ import { math } from "@mat3ra/code/dist/js/math";
2
2
 
3
3
  import { ATOMIC_COORD_UNITS } from "../constants";
4
4
  import { Lattice } from "../lattice/lattice";
package/src/js/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AnyObject } from "@mat3ra/code/dist/js/entity/in_memory";
1
+ import { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
2
2
  import { MaterialSchema } from "@mat3ra/esse/dist/js/types";
3
3
 
4
4
  export type MaterialJSON = MaterialSchema & AnyObject;