@spglib/moyo-wasm 0.8.0 → 0.10.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/moyo_wasm.d.ts +162 -0
- package/moyo_wasm.js +432 -7
- package/moyo_wasm_bg.wasm +0 -0
- package/package.json +2 -2
package/moyo_wasm.d.ts
CHANGED
|
@@ -4,6 +4,13 @@ export interface Lattice {
|
|
|
4
4
|
basis: [number, number, number, number, number, number, number, number, number];
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
export interface MoyoArithmeticCrystalClass {
|
|
8
|
+
arithmetic_number: number;
|
|
9
|
+
symbol: string;
|
|
10
|
+
geometric_crystal_class: string;
|
|
11
|
+
bravais_class: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
7
14
|
export interface MoyoCell {
|
|
8
15
|
lattice: Lattice;
|
|
9
16
|
positions: [number, number, number][];
|
|
@@ -31,28 +38,183 @@ export interface MoyoDataset {
|
|
|
31
38
|
angle_tolerance: AngleTolerance;
|
|
32
39
|
}
|
|
33
40
|
|
|
41
|
+
export interface MoyoHallSymbolEntry {
|
|
42
|
+
hall_number: number;
|
|
43
|
+
number: number;
|
|
44
|
+
arithmetic_number: number;
|
|
45
|
+
setting: string;
|
|
46
|
+
hall_symbol: string;
|
|
47
|
+
hm_short: string;
|
|
48
|
+
hm_full: string;
|
|
49
|
+
centering: MoyoCentering;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface MoyoLayerArithmeticCrystalClass {
|
|
53
|
+
arithmetic_number: number;
|
|
54
|
+
symbol: string;
|
|
55
|
+
geometric_crystal_class: string;
|
|
56
|
+
bravais_class: string;
|
|
57
|
+
lattice_system: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface MoyoLayerGroupType {
|
|
61
|
+
number: number;
|
|
62
|
+
hall_number: number;
|
|
63
|
+
hm_short: string;
|
|
64
|
+
hm_full: string;
|
|
65
|
+
arithmetic_number: number;
|
|
66
|
+
arithmetic_symbol: string;
|
|
67
|
+
geometric_crystal_class: string;
|
|
68
|
+
crystal_system: string;
|
|
69
|
+
bravais_class: string;
|
|
70
|
+
lattice_system: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface MoyoLayerHallSymbolEntry {
|
|
74
|
+
hall_number: number;
|
|
75
|
+
number: number;
|
|
76
|
+
arithmetic_number: number;
|
|
77
|
+
setting: string;
|
|
78
|
+
hall_symbol: string;
|
|
79
|
+
hm_short: string;
|
|
80
|
+
hm_full: string;
|
|
81
|
+
centering: MoyoLayerCentering;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface MoyoMagneticHallSymbolEntry {
|
|
85
|
+
uni_number: number;
|
|
86
|
+
magnetic_hall_symbol: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface MoyoMagneticOperation {
|
|
90
|
+
rotation: [number, number, number, number, number, number, number, number, number];
|
|
91
|
+
translation: [number, number, number];
|
|
92
|
+
time_reversal: boolean;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface MoyoMagneticSpaceGroupType {
|
|
96
|
+
uni_number: number;
|
|
97
|
+
litvin_number: number;
|
|
98
|
+
bns_number: string;
|
|
99
|
+
og_number: string;
|
|
100
|
+
number: number;
|
|
101
|
+
construct_type: number;
|
|
102
|
+
}
|
|
103
|
+
|
|
34
104
|
export interface MoyoOperation {
|
|
35
105
|
rotation: [number, number, number, number, number, number, number, number, number];
|
|
36
106
|
translation: [number, number, number];
|
|
37
107
|
}
|
|
38
108
|
|
|
109
|
+
export interface MoyoSpaceGroupType {
|
|
110
|
+
number: number;
|
|
111
|
+
hall_number: number;
|
|
112
|
+
hm_short: string;
|
|
113
|
+
hm_full: string;
|
|
114
|
+
arithmetic_number: number;
|
|
115
|
+
arithmetic_symbol: string;
|
|
116
|
+
geometric_crystal_class: string;
|
|
117
|
+
crystal_system: string;
|
|
118
|
+
bravais_class: string;
|
|
119
|
+
lattice_system: string;
|
|
120
|
+
crystal_family: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
39
123
|
export type AngleTolerance = { type: "Radian"; value: number } | { type: "Default" };
|
|
40
124
|
|
|
125
|
+
export type MoyoCentering = "P" | "A" | "B" | "C" | "I" | "R" | "F";
|
|
126
|
+
|
|
127
|
+
export type MoyoLayerCentering = "P" | "C";
|
|
128
|
+
|
|
129
|
+
export type MoyoLayerSetting = { type: "Spglib" } | { type: "Standard" } | { type: "HallNumber"; value: number };
|
|
130
|
+
|
|
131
|
+
export type MoyoSetting = { type: "Spglib" } | { type: "Standard" } | { type: "HallNumber"; value: number };
|
|
132
|
+
|
|
41
133
|
|
|
42
134
|
/**
|
|
43
135
|
* Return a strongly-typed DTO; wasm-bindgen + tsify will emit .d.ts based on these Rust types
|
|
44
136
|
*/
|
|
45
137
|
export function analyze_cell(cell_json: string, symprec: number, setting: string): MoyoDataset;
|
|
46
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Return the arithmetic-crystal-class entry for the given `arithmetic_number` (1 - 73).
|
|
141
|
+
*/
|
|
142
|
+
export function arithmetic_crystal_class(arithmetic_number: number): MoyoArithmeticCrystalClass;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Return the Hall-symbol entry for the given `hall_number` (1 - 530).
|
|
146
|
+
*/
|
|
147
|
+
export function hall_symbol_entry(hall_number: number): MoyoHallSymbolEntry;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Return the layer arithmetic-crystal-class entry for the given `arithmetic_number` (1 - 43).
|
|
151
|
+
*/
|
|
152
|
+
export function layer_arithmetic_crystal_class(arithmetic_number: number): MoyoLayerArithmeticCrystalClass;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Return the layer-group-type description for the given `number` (1 - 80).
|
|
156
|
+
*/
|
|
157
|
+
export function layer_group_type(number: number): MoyoLayerGroupType;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Return the layer Hall-symbol entry for the given `hall_number` (1 - 116).
|
|
161
|
+
*/
|
|
162
|
+
export function layer_hall_symbol_entry(hall_number: number): MoyoLayerHallSymbolEntry;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Return the magnetic Hall-symbol entry for the given `uni_number` (1 - 1651).
|
|
166
|
+
*/
|
|
167
|
+
export function magnetic_hall_symbol_entry(uni_number: number): MoyoMagneticHallSymbolEntry;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Return magnetic symmetry operations for the given `uni_number` (1 - 1651).
|
|
171
|
+
*/
|
|
172
|
+
export function magnetic_operations_from_uni_number(uni_number: number, primitive: boolean): MoyoMagneticOperation[];
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Return the magnetic-space-group-type description for the given `uni_number` (1 - 1651).
|
|
176
|
+
*/
|
|
177
|
+
export function magnetic_space_group_type(uni_number: number): MoyoMagneticSpaceGroupType;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Return symmetry operations for the given layer-group `number` (1 - 80).
|
|
181
|
+
*/
|
|
182
|
+
export function operations_from_layer_number(number: number, setting: MoyoLayerSetting, primitive: boolean): MoyoOperation[];
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Return symmetry operations for the given space-group ITA `number`.
|
|
186
|
+
*/
|
|
187
|
+
export function operations_from_number(number: number, setting: MoyoSetting, primitive: boolean): MoyoOperation[];
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Return the space-group-type description for the given ITA `number` (1 - 230).
|
|
191
|
+
*/
|
|
192
|
+
export function space_group_type(number: number): MoyoSpaceGroupType;
|
|
193
|
+
|
|
47
194
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
48
195
|
|
|
49
196
|
export interface InitOutput {
|
|
50
197
|
readonly memory: WebAssembly.Memory;
|
|
198
|
+
readonly layer_arithmetic_crystal_class: (a: number) => [number, number, number];
|
|
199
|
+
readonly layer_group_type: (a: number) => [number, number, number];
|
|
200
|
+
readonly layer_hall_symbol_entry: (a: number) => [number, number, number];
|
|
201
|
+
readonly operations_from_layer_number: (a: number, b: any, c: number) => [number, number, number, number];
|
|
202
|
+
readonly arithmetic_crystal_class: (a: number) => [number, number, number];
|
|
203
|
+
readonly hall_symbol_entry: (a: number) => [number, number, number];
|
|
204
|
+
readonly operations_from_number: (a: number, b: any, c: number) => [number, number, number, number];
|
|
205
|
+
readonly space_group_type: (a: number) => [number, number, number];
|
|
51
206
|
readonly analyze_cell: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
207
|
+
readonly magnetic_hall_symbol_entry: (a: number) => [number, number, number];
|
|
208
|
+
readonly magnetic_operations_from_uni_number: (a: number, b: number) => [number, number, number, number];
|
|
209
|
+
readonly magnetic_space_group_type: (a: number) => [number, number, number];
|
|
52
210
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
53
211
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
212
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
213
|
+
readonly __externref_table_alloc: () => number;
|
|
54
214
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
55
215
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
216
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
217
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
56
218
|
readonly __wbindgen_start: () => void;
|
|
57
219
|
}
|
|
58
220
|
|
package/moyo_wasm.js
CHANGED
|
@@ -18,13 +18,171 @@ export function analyze_cell(cell_json, symprec, setting) {
|
|
|
18
18
|
}
|
|
19
19
|
return takeFromExternrefTable0(ret[0]);
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Return the arithmetic-crystal-class entry for the given `arithmetic_number` (1 - 73).
|
|
24
|
+
* @param {number} arithmetic_number
|
|
25
|
+
* @returns {MoyoArithmeticCrystalClass}
|
|
26
|
+
*/
|
|
27
|
+
export function arithmetic_crystal_class(arithmetic_number) {
|
|
28
|
+
const ret = wasm.arithmetic_crystal_class(arithmetic_number);
|
|
29
|
+
if (ret[2]) {
|
|
30
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
31
|
+
}
|
|
32
|
+
return takeFromExternrefTable0(ret[0]);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Return the Hall-symbol entry for the given `hall_number` (1 - 530).
|
|
37
|
+
* @param {number} hall_number
|
|
38
|
+
* @returns {MoyoHallSymbolEntry}
|
|
39
|
+
*/
|
|
40
|
+
export function hall_symbol_entry(hall_number) {
|
|
41
|
+
const ret = wasm.hall_symbol_entry(hall_number);
|
|
42
|
+
if (ret[2]) {
|
|
43
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
44
|
+
}
|
|
45
|
+
return takeFromExternrefTable0(ret[0]);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Return the layer arithmetic-crystal-class entry for the given `arithmetic_number` (1 - 43).
|
|
50
|
+
* @param {number} arithmetic_number
|
|
51
|
+
* @returns {MoyoLayerArithmeticCrystalClass}
|
|
52
|
+
*/
|
|
53
|
+
export function layer_arithmetic_crystal_class(arithmetic_number) {
|
|
54
|
+
const ret = wasm.layer_arithmetic_crystal_class(arithmetic_number);
|
|
55
|
+
if (ret[2]) {
|
|
56
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
57
|
+
}
|
|
58
|
+
return takeFromExternrefTable0(ret[0]);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Return the layer-group-type description for the given `number` (1 - 80).
|
|
63
|
+
* @param {number} number
|
|
64
|
+
* @returns {MoyoLayerGroupType}
|
|
65
|
+
*/
|
|
66
|
+
export function layer_group_type(number) {
|
|
67
|
+
const ret = wasm.layer_group_type(number);
|
|
68
|
+
if (ret[2]) {
|
|
69
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
70
|
+
}
|
|
71
|
+
return takeFromExternrefTable0(ret[0]);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Return the layer Hall-symbol entry for the given `hall_number` (1 - 116).
|
|
76
|
+
* @param {number} hall_number
|
|
77
|
+
* @returns {MoyoLayerHallSymbolEntry}
|
|
78
|
+
*/
|
|
79
|
+
export function layer_hall_symbol_entry(hall_number) {
|
|
80
|
+
const ret = wasm.layer_hall_symbol_entry(hall_number);
|
|
81
|
+
if (ret[2]) {
|
|
82
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
83
|
+
}
|
|
84
|
+
return takeFromExternrefTable0(ret[0]);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Return the magnetic Hall-symbol entry for the given `uni_number` (1 - 1651).
|
|
89
|
+
* @param {number} uni_number
|
|
90
|
+
* @returns {MoyoMagneticHallSymbolEntry}
|
|
91
|
+
*/
|
|
92
|
+
export function magnetic_hall_symbol_entry(uni_number) {
|
|
93
|
+
const ret = wasm.magnetic_hall_symbol_entry(uni_number);
|
|
94
|
+
if (ret[2]) {
|
|
95
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
96
|
+
}
|
|
97
|
+
return takeFromExternrefTable0(ret[0]);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Return magnetic symmetry operations for the given `uni_number` (1 - 1651).
|
|
102
|
+
* @param {number} uni_number
|
|
103
|
+
* @param {boolean} primitive
|
|
104
|
+
* @returns {MoyoMagneticOperation[]}
|
|
105
|
+
*/
|
|
106
|
+
export function magnetic_operations_from_uni_number(uni_number, primitive) {
|
|
107
|
+
const ret = wasm.magnetic_operations_from_uni_number(uni_number, primitive);
|
|
108
|
+
if (ret[3]) {
|
|
109
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
110
|
+
}
|
|
111
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
112
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
113
|
+
return v1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Return the magnetic-space-group-type description for the given `uni_number` (1 - 1651).
|
|
118
|
+
* @param {number} uni_number
|
|
119
|
+
* @returns {MoyoMagneticSpaceGroupType}
|
|
120
|
+
*/
|
|
121
|
+
export function magnetic_space_group_type(uni_number) {
|
|
122
|
+
const ret = wasm.magnetic_space_group_type(uni_number);
|
|
123
|
+
if (ret[2]) {
|
|
124
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
125
|
+
}
|
|
126
|
+
return takeFromExternrefTable0(ret[0]);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Return symmetry operations for the given layer-group `number` (1 - 80).
|
|
131
|
+
* @param {number} number
|
|
132
|
+
* @param {MoyoLayerSetting} setting
|
|
133
|
+
* @param {boolean} primitive
|
|
134
|
+
* @returns {MoyoOperation[]}
|
|
135
|
+
*/
|
|
136
|
+
export function operations_from_layer_number(number, setting, primitive) {
|
|
137
|
+
const ret = wasm.operations_from_layer_number(number, setting, primitive);
|
|
138
|
+
if (ret[3]) {
|
|
139
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
140
|
+
}
|
|
141
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
142
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
143
|
+
return v1;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Return symmetry operations for the given space-group ITA `number`.
|
|
148
|
+
* @param {number} number
|
|
149
|
+
* @param {MoyoSetting} setting
|
|
150
|
+
* @param {boolean} primitive
|
|
151
|
+
* @returns {MoyoOperation[]}
|
|
152
|
+
*/
|
|
153
|
+
export function operations_from_number(number, setting, primitive) {
|
|
154
|
+
const ret = wasm.operations_from_number(number, setting, primitive);
|
|
155
|
+
if (ret[3]) {
|
|
156
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
157
|
+
}
|
|
158
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
159
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
160
|
+
return v1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Return the space-group-type description for the given ITA `number` (1 - 230).
|
|
165
|
+
* @param {number} number
|
|
166
|
+
* @returns {MoyoSpaceGroupType}
|
|
167
|
+
*/
|
|
168
|
+
export function space_group_type(number) {
|
|
169
|
+
const ret = wasm.space_group_type(number);
|
|
170
|
+
if (ret[2]) {
|
|
171
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
172
|
+
}
|
|
173
|
+
return takeFromExternrefTable0(ret[0]);
|
|
174
|
+
}
|
|
21
175
|
function __wbg_get_imports() {
|
|
22
176
|
const import0 = {
|
|
23
177
|
__proto__: null,
|
|
24
|
-
|
|
178
|
+
__wbg_Error_bce6d499ff0a4aff: function(arg0, arg1) {
|
|
25
179
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
26
180
|
return ret;
|
|
27
181
|
},
|
|
182
|
+
__wbg_Number_b7972a139bfbfdf0: function(arg0) {
|
|
183
|
+
const ret = Number(arg0);
|
|
184
|
+
return ret;
|
|
185
|
+
},
|
|
28
186
|
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
29
187
|
const ret = String(arg1);
|
|
30
188
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -32,34 +190,201 @@ function __wbg_get_imports() {
|
|
|
32
190
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
33
191
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
34
192
|
},
|
|
35
|
-
|
|
193
|
+
__wbg___wbindgen_bigint_get_as_i64_410e28c7b761ad83: function(arg0, arg1) {
|
|
194
|
+
const v = arg1;
|
|
195
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
196
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
197
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
198
|
+
},
|
|
199
|
+
__wbg___wbindgen_boolean_get_2304fb8c853028c8: function(arg0) {
|
|
200
|
+
const v = arg0;
|
|
201
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
202
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
203
|
+
},
|
|
204
|
+
__wbg___wbindgen_debug_string_edece8177ad01481: function(arg0, arg1) {
|
|
205
|
+
const ret = debugString(arg1);
|
|
206
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
207
|
+
const len1 = WASM_VECTOR_LEN;
|
|
208
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
209
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
210
|
+
},
|
|
211
|
+
__wbg___wbindgen_in_07056af4f902c445: function(arg0, arg1) {
|
|
212
|
+
const ret = arg0 in arg1;
|
|
213
|
+
return ret;
|
|
214
|
+
},
|
|
215
|
+
__wbg___wbindgen_is_bigint_aeae3893f30ed54e: function(arg0) {
|
|
216
|
+
const ret = typeof(arg0) === 'bigint';
|
|
217
|
+
return ret;
|
|
218
|
+
},
|
|
219
|
+
__wbg___wbindgen_is_function_5cd60d5cf78b4eef: function(arg0) {
|
|
220
|
+
const ret = typeof(arg0) === 'function';
|
|
221
|
+
return ret;
|
|
222
|
+
},
|
|
223
|
+
__wbg___wbindgen_is_object_b4593df85baada48: function(arg0) {
|
|
224
|
+
const val = arg0;
|
|
225
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
226
|
+
return ret;
|
|
227
|
+
},
|
|
228
|
+
__wbg___wbindgen_is_string_dde0fd9020db4434: function(arg0) {
|
|
229
|
+
const ret = typeof(arg0) === 'string';
|
|
230
|
+
return ret;
|
|
231
|
+
},
|
|
232
|
+
__wbg___wbindgen_is_undefined_35bb9f4c7fd651d5: function(arg0) {
|
|
233
|
+
const ret = arg0 === undefined;
|
|
234
|
+
return ret;
|
|
235
|
+
},
|
|
236
|
+
__wbg___wbindgen_jsval_eq_c0ed08b3e0f393b9: function(arg0, arg1) {
|
|
237
|
+
const ret = arg0 === arg1;
|
|
238
|
+
return ret;
|
|
239
|
+
},
|
|
240
|
+
__wbg___wbindgen_jsval_loose_eq_0ad77b7717db155c: function(arg0, arg1) {
|
|
241
|
+
const ret = arg0 == arg1;
|
|
242
|
+
return ret;
|
|
243
|
+
},
|
|
244
|
+
__wbg___wbindgen_number_get_f73a1244370fcc2c: function(arg0, arg1) {
|
|
245
|
+
const obj = arg1;
|
|
246
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
247
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
248
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
249
|
+
},
|
|
250
|
+
__wbg___wbindgen_string_get_d109740c0d18f4d7: function(arg0, arg1) {
|
|
251
|
+
const obj = arg1;
|
|
252
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
253
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
254
|
+
var len1 = WASM_VECTOR_LEN;
|
|
255
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
256
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
257
|
+
},
|
|
258
|
+
__wbg___wbindgen_throw_9c31b086c2b26051: function(arg0, arg1) {
|
|
36
259
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
37
260
|
},
|
|
38
|
-
|
|
261
|
+
__wbg_call_13665d9f14390edc: function() { return handleError(function (arg0, arg1) {
|
|
262
|
+
const ret = arg0.call(arg1);
|
|
263
|
+
return ret;
|
|
264
|
+
}, arguments); },
|
|
265
|
+
__wbg_done_54b8da57023b7ed2: function(arg0) {
|
|
266
|
+
const ret = arg0.done;
|
|
267
|
+
return ret;
|
|
268
|
+
},
|
|
269
|
+
__wbg_entries_564a7e8b1e54ede5: function(arg0) {
|
|
270
|
+
const ret = Object.entries(arg0);
|
|
271
|
+
return ret;
|
|
272
|
+
},
|
|
273
|
+
__wbg_get_3e9a707ab7d352eb: function() { return handleError(function (arg0, arg1) {
|
|
274
|
+
const ret = Reflect.get(arg0, arg1);
|
|
275
|
+
return ret;
|
|
276
|
+
}, arguments); },
|
|
277
|
+
__wbg_get_98fdf51d029a75eb: function(arg0, arg1) {
|
|
278
|
+
const ret = arg0[arg1 >>> 0];
|
|
279
|
+
return ret;
|
|
280
|
+
},
|
|
281
|
+
__wbg_get_unchecked_1dfe6d05ad91d9b7: function(arg0, arg1) {
|
|
282
|
+
const ret = arg0[arg1 >>> 0];
|
|
283
|
+
return ret;
|
|
284
|
+
},
|
|
285
|
+
__wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
|
|
286
|
+
const ret = arg0[arg1];
|
|
287
|
+
return ret;
|
|
288
|
+
},
|
|
289
|
+
__wbg_instanceof_ArrayBuffer_53db37b06f6b9afe: function(arg0) {
|
|
290
|
+
let result;
|
|
291
|
+
try {
|
|
292
|
+
result = arg0 instanceof ArrayBuffer;
|
|
293
|
+
} catch (_) {
|
|
294
|
+
result = false;
|
|
295
|
+
}
|
|
296
|
+
const ret = result;
|
|
297
|
+
return ret;
|
|
298
|
+
},
|
|
299
|
+
__wbg_instanceof_Map_16f217b9a2a08d8c: function(arg0) {
|
|
300
|
+
let result;
|
|
301
|
+
try {
|
|
302
|
+
result = arg0 instanceof Map;
|
|
303
|
+
} catch (_) {
|
|
304
|
+
result = false;
|
|
305
|
+
}
|
|
306
|
+
const ret = result;
|
|
307
|
+
return ret;
|
|
308
|
+
},
|
|
309
|
+
__wbg_instanceof_Uint8Array_abd07d4bd221d50b: function(arg0) {
|
|
310
|
+
let result;
|
|
311
|
+
try {
|
|
312
|
+
result = arg0 instanceof Uint8Array;
|
|
313
|
+
} catch (_) {
|
|
314
|
+
result = false;
|
|
315
|
+
}
|
|
316
|
+
const ret = result;
|
|
317
|
+
return ret;
|
|
318
|
+
},
|
|
319
|
+
__wbg_isArray_94898ed3aad6947b: function(arg0) {
|
|
320
|
+
const ret = Array.isArray(arg0);
|
|
321
|
+
return ret;
|
|
322
|
+
},
|
|
323
|
+
__wbg_isSafeInteger_01e964d144ad3a55: function(arg0) {
|
|
324
|
+
const ret = Number.isSafeInteger(arg0);
|
|
325
|
+
return ret;
|
|
326
|
+
},
|
|
327
|
+
__wbg_iterator_1441b47f341dc34f: function() {
|
|
328
|
+
const ret = Symbol.iterator;
|
|
329
|
+
return ret;
|
|
330
|
+
},
|
|
331
|
+
__wbg_length_2591a0f4f659a55c: function(arg0) {
|
|
332
|
+
const ret = arg0.length;
|
|
333
|
+
return ret;
|
|
334
|
+
},
|
|
335
|
+
__wbg_length_56fcd3e2b7e0299d: function(arg0) {
|
|
336
|
+
const ret = arg0.length;
|
|
337
|
+
return ret;
|
|
338
|
+
},
|
|
339
|
+
__wbg_new_02d162bc6cf02f60: function() {
|
|
39
340
|
const ret = new Object();
|
|
40
341
|
return ret;
|
|
41
342
|
},
|
|
42
|
-
|
|
343
|
+
__wbg_new_310879b66b6e95e1: function() {
|
|
43
344
|
const ret = new Array();
|
|
44
345
|
return ret;
|
|
45
346
|
},
|
|
347
|
+
__wbg_new_7ddec6de44ff8f5d: function(arg0) {
|
|
348
|
+
const ret = new Uint8Array(arg0);
|
|
349
|
+
return ret;
|
|
350
|
+
},
|
|
351
|
+
__wbg_next_2a4e19f4f5083b0f: function(arg0) {
|
|
352
|
+
const ret = arg0.next;
|
|
353
|
+
return ret;
|
|
354
|
+
},
|
|
355
|
+
__wbg_next_6429a146bf756f93: function() { return handleError(function (arg0) {
|
|
356
|
+
const ret = arg0.next();
|
|
357
|
+
return ret;
|
|
358
|
+
}, arguments); },
|
|
359
|
+
__wbg_prototypesetcall_5f9bdc8d75e07276: function(arg0, arg1, arg2) {
|
|
360
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
361
|
+
},
|
|
46
362
|
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
47
363
|
arg0[arg1] = arg2;
|
|
48
364
|
},
|
|
49
|
-
|
|
365
|
+
__wbg_set_78ea6a19f4818587: function(arg0, arg1, arg2) {
|
|
50
366
|
arg0[arg1 >>> 0] = arg2;
|
|
51
367
|
},
|
|
368
|
+
__wbg_value_9cc0518af87a489c: function(arg0) {
|
|
369
|
+
const ret = arg0.value;
|
|
370
|
+
return ret;
|
|
371
|
+
},
|
|
52
372
|
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
53
373
|
// Cast intrinsic for `F64 -> Externref`.
|
|
54
374
|
const ret = arg0;
|
|
55
375
|
return ret;
|
|
56
376
|
},
|
|
57
|
-
__wbindgen_cast_0000000000000002: function(arg0
|
|
377
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
378
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
379
|
+
const ret = arg0;
|
|
380
|
+
return ret;
|
|
381
|
+
},
|
|
382
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
58
383
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
59
384
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
60
385
|
return ret;
|
|
61
386
|
},
|
|
62
|
-
|
|
387
|
+
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
63
388
|
// Cast intrinsic for `U64 -> Externref`.
|
|
64
389
|
const ret = BigInt.asUintN(64, arg0);
|
|
65
390
|
return ret;
|
|
@@ -80,6 +405,93 @@ function __wbg_get_imports() {
|
|
|
80
405
|
};
|
|
81
406
|
}
|
|
82
407
|
|
|
408
|
+
function addToExternrefTable0(obj) {
|
|
409
|
+
const idx = wasm.__externref_table_alloc();
|
|
410
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
411
|
+
return idx;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
function debugString(val) {
|
|
415
|
+
// primitive types
|
|
416
|
+
const type = typeof val;
|
|
417
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
418
|
+
return `${val}`;
|
|
419
|
+
}
|
|
420
|
+
if (type == 'string') {
|
|
421
|
+
return `"${val}"`;
|
|
422
|
+
}
|
|
423
|
+
if (type == 'symbol') {
|
|
424
|
+
const description = val.description;
|
|
425
|
+
if (description == null) {
|
|
426
|
+
return 'Symbol';
|
|
427
|
+
} else {
|
|
428
|
+
return `Symbol(${description})`;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
if (type == 'function') {
|
|
432
|
+
const name = val.name;
|
|
433
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
434
|
+
return `Function(${name})`;
|
|
435
|
+
} else {
|
|
436
|
+
return 'Function';
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
// objects
|
|
440
|
+
if (Array.isArray(val)) {
|
|
441
|
+
const length = val.length;
|
|
442
|
+
let debug = '[';
|
|
443
|
+
if (length > 0) {
|
|
444
|
+
debug += debugString(val[0]);
|
|
445
|
+
}
|
|
446
|
+
for(let i = 1; i < length; i++) {
|
|
447
|
+
debug += ', ' + debugString(val[i]);
|
|
448
|
+
}
|
|
449
|
+
debug += ']';
|
|
450
|
+
return debug;
|
|
451
|
+
}
|
|
452
|
+
// Test for built-in
|
|
453
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
454
|
+
let className;
|
|
455
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
456
|
+
className = builtInMatches[1];
|
|
457
|
+
} else {
|
|
458
|
+
// Failed to match the standard '[object ClassName]'
|
|
459
|
+
return toString.call(val);
|
|
460
|
+
}
|
|
461
|
+
if (className == 'Object') {
|
|
462
|
+
// we're a user defined class or Object
|
|
463
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
464
|
+
// easier than looping through ownProperties of `val`.
|
|
465
|
+
try {
|
|
466
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
467
|
+
} catch (_) {
|
|
468
|
+
return 'Object';
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
// errors
|
|
472
|
+
if (val instanceof Error) {
|
|
473
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
474
|
+
}
|
|
475
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
476
|
+
return className;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
480
|
+
ptr = ptr >>> 0;
|
|
481
|
+
const mem = getDataViewMemory0();
|
|
482
|
+
const result = [];
|
|
483
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
484
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
485
|
+
}
|
|
486
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
487
|
+
return result;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
491
|
+
ptr = ptr >>> 0;
|
|
492
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
493
|
+
}
|
|
494
|
+
|
|
83
495
|
let cachedDataViewMemory0 = null;
|
|
84
496
|
function getDataViewMemory0() {
|
|
85
497
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
@@ -100,6 +512,19 @@ function getUint8ArrayMemory0() {
|
|
|
100
512
|
return cachedUint8ArrayMemory0;
|
|
101
513
|
}
|
|
102
514
|
|
|
515
|
+
function handleError(f, args) {
|
|
516
|
+
try {
|
|
517
|
+
return f.apply(this, args);
|
|
518
|
+
} catch (e) {
|
|
519
|
+
const idx = addToExternrefTable0(e);
|
|
520
|
+
wasm.__wbindgen_exn_store(idx);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
function isLikeNone(x) {
|
|
525
|
+
return x === undefined || x === null;
|
|
526
|
+
}
|
|
527
|
+
|
|
103
528
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
104
529
|
if (realloc === undefined) {
|
|
105
530
|
const buf = cachedTextEncoder.encode(arg);
|
package/moyo_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@spglib/moyo-wasm",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "WebAssembly bindings for moyo crystal symmetry analysis",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.10.0",
|
|
6
6
|
"license": "MIT OR Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
"sideEffects": [
|
|
19
19
|
"./snippets/*"
|
|
20
20
|
]
|
|
21
|
-
}
|
|
21
|
+
}
|