@mat3ra/made 2026.11.3-0 → 2026.11.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.
- package/dist/js/basis/basis.js +4 -4
- package/package.json +1 -1
package/dist/js/basis/basis.js
CHANGED
|
@@ -165,7 +165,7 @@ class Basis extends entity_1.InMemoryEntity {
|
|
|
165
165
|
}
|
|
166
166
|
toStandardRepresentation() {
|
|
167
167
|
this.toCrystal();
|
|
168
|
-
this._coordinates.mapArrayInPlace((point) => point.map((x) => utils_1.Utils.math.mod(x)));
|
|
168
|
+
this._coordinates.mapArrayInPlace((point) => point.map((x) => utils_1.Utils.math.mod(x, 0)));
|
|
169
169
|
}
|
|
170
170
|
/** A representation where all coordinates are within 0 and 1 in crystal units */
|
|
171
171
|
get standardRepresentation() {
|
|
@@ -286,12 +286,12 @@ class Basis extends entity_1.InMemoryEntity {
|
|
|
286
286
|
* This guarantees the independence from the order in the elements array.
|
|
287
287
|
*/
|
|
288
288
|
getAsSortedString() {
|
|
289
|
-
const
|
|
290
|
-
const standardRep =
|
|
289
|
+
const storedBasis = new Basis(this.clone().standardRepresentation);
|
|
290
|
+
const standardRep = storedBasis.elementsAndCoordinatesAndLabelsArray.map((entry) => {
|
|
291
291
|
const element = entry[0];
|
|
292
292
|
const coordinate = entry[1];
|
|
293
293
|
const atomicLabel = entry[2];
|
|
294
|
-
const toleratedCoordinate = coordinate.map((x) => utils_1.Utils.math.mod(utils_1.Utils.math.roundCustom(
|
|
294
|
+
const toleratedCoordinate = coordinate.map((x) => utils_1.Utils.math.mod(utils_1.Utils.math.roundCustom(x, constants_1.HASH_TOLERANCE), 0));
|
|
295
295
|
return `${element}${atomicLabel} ${toleratedCoordinate.join()}`;
|
|
296
296
|
});
|
|
297
297
|
return `${standardRep.sort().join(";")};`;
|