@nirs4all/preflight 0.1.6 → 0.1.7
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/index.js +14 -0
- package/native/nirs4all_preflight_wasm_bg.wasm +0 -0
- package/native/package.json +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -138,6 +138,20 @@ export async function createQualificationRuntime(options = {}) {
|
|
|
138
138
|
result = { outputs, backend_version };
|
|
139
139
|
break;
|
|
140
140
|
}
|
|
141
|
+
case 'preprocess': {
|
|
142
|
+
const x = matrix(request.matrix);
|
|
143
|
+
const ctx = methods.Context.create();
|
|
144
|
+
let pipeline;
|
|
145
|
+
try {
|
|
146
|
+
pipeline = methods.NativePreprocessingPipeline.fit(ctx, request.steps, x);
|
|
147
|
+
const out = pipeline.transform(x);
|
|
148
|
+
result = { matrix: nested(out.data, out.cols), backend_version };
|
|
149
|
+
} finally {
|
|
150
|
+
pipeline?.destroy();
|
|
151
|
+
ctx.destroy();
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
141
155
|
case 'pca': {
|
|
142
156
|
const output = methods.preflightPca(matrix(request.matrix), request.n_components);
|
|
143
157
|
result = { eigenvalues: Array.from(output.eigenvalues), scores: nested(output.scores.data, output.scores.cols), full_moments: output.fullMoments, resolution: output.resolution, unresolved: Array.from(output.unresolved, Boolean), backend_version };
|
|
Binary file
|
package/native/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nirs4all/preflight",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Rust NIRS dataset qualification with reusable Methods diagnostics",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "(CECILL-2.1 OR AGPL-3.0-or-later)",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"THIRD_PARTY_NOTICES.md"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@nirs4all/methods": "1.3.
|
|
31
|
-
"dag-ml-wasm": "0.
|
|
30
|
+
"@nirs4all/methods": "1.3.15",
|
|
31
|
+
"dag-ml-wasm": "0.4.0"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build:native": "wasm-pack build . --target web --out-dir native --release && node scripts/prepare-native.mjs",
|