@nirs4all/methods 1.3.17 → 1.3.19
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/README.md +68 -2
- package/dist/estimatorRolesGenerated.js +1 -1
- package/dist/explain.d.ts +124 -0
- package/dist/explain.js +554 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/n4m.js +1 -1
- package/dist/n4m.wasm +0 -0
- package/dist/preflightDiagnostics.js +2 -2
- package/package.json +2 -2
package/dist/n4m.wasm
CHANGED
|
Binary file
|
|
@@ -18,7 +18,7 @@ function validatePermutation(nPermutations, seed) {
|
|
|
18
18
|
function validateMatrix(X) {
|
|
19
19
|
if (!Number.isSafeInteger(X.rows) || !Number.isSafeInteger(X.cols) ||
|
|
20
20
|
X.rows < 1 || X.cols < 1 || X.data.length !== X.rows * X.cols) {
|
|
21
|
-
throw new RangeError("invalid
|
|
21
|
+
throw new RangeError("invalid diagnostic matrix dimensions");
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
/** Integer in [lo, hi] and representable as a C int32_t (Emscripten passes
|
|
@@ -46,7 +46,7 @@ class NativeScope {
|
|
|
46
46
|
releases = [];
|
|
47
47
|
alloc(bytes) {
|
|
48
48
|
if (!Number.isSafeInteger(bytes) || bytes < 0 || bytes > 0x7fffffff) {
|
|
49
|
-
throw new RangeError("
|
|
49
|
+
throw new RangeError("diagnostic buffer exceeds WASM allocation limit");
|
|
50
50
|
}
|
|
51
51
|
const m = getModule();
|
|
52
52
|
const ptr = m._malloc(Math.max(1, bytes));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nirs4all/methods",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.19",
|
|
4
4
|
"description": "WebAssembly build of libn4m (nirs4all-methods) — portable PLS/NIRS engine and native method bindings.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"build": "npm run clean && tsc -p .",
|
|
22
22
|
"stage:wasm": "node -e \"const fs=require('fs'),p='../../build/'+(process.env.N4M_WASM_PRESET||'emscripten')+'/bindings/js/';fs.mkdirSync('dist',{recursive:true});for(const f of ['n4m.js','n4m.wasm']){if(!fs.existsSync(p+f))throw new Error('missing WASM artifact '+p+f+' — run: cmake --preset emscripten && cmake --build --preset emscripten --target n4m_wasm');fs.copyFileSync(p+f,'dist/'+f)}fs.copyFileSync('../../THIRD_PARTY_LICENSES.md','dist/THIRD_PARTY_LICENSES.md');fs.cpSync('../../LICENSES','dist/LICENSES',{recursive:true});console.log('staged n4m.js + n4m.wasm + THIRD_PARTY_LICENSES.md into dist/')\"",
|
|
23
23
|
"prepack": "npm run build && npm run stage:wasm",
|
|
24
|
-
"test": "node --experimental-vm-modules test/run_smoke.mjs && node --experimental-vm-modules test/run_api.mjs && node --experimental-vm-modules test/run_generic_method.mjs && node --experimental-vm-modules test/run_pop_aom.mjs && node --experimental-vm-modules test/run_new_pack.mjs && node --experimental-vm-modules test/run_serialization_inspect.mjs && node --experimental-vm-modules test/run_method_result_model.mjs && node --experimental-vm-modules test/run_native_preprocessing_pipeline.mjs && node --experimental-vm-modules test/run_native_splitter.mjs && node --experimental-vm-modules test/run_native_augmentation.mjs && node --experimental-vm-modules test/run_estimator_roles.mjs && node --experimental-vm-modules test/run_estimator_roles_negative.mjs && node --experimental-vm-modules test/run_role_pipeline.mjs && node --experimental-vm-modules test/run_spectral_encoding.mjs && node --experimental-vm-modules test/run_optimization.mjs && node --experimental-vm-modules test/run_preflight_diagnostics.mjs && node --experimental-vm-modules test/run_pls_scale_equivariance.mjs && node --experimental-vm-modules test/run_pls_small_covariance.mjs && node --experimental-vm-modules test/run_pls_null_consumers.mjs && node --experimental-vm-modules test/run_pls_scale_consumers.mjs && node test/run_intrinsic_diagnostics.mjs && npm run test:shared-scoring && node test/run_snv_parameter_contract.mjs && node test/run_raw_i32_status.mjs && node --experimental-vm-modules test/ranking_mock.mjs && node test/run_ranking.mjs && node test/run_component_analysis.mjs && node test/run_multimodal_teaching.mjs",
|
|
24
|
+
"test": "node --experimental-vm-modules test/run_smoke.mjs && node --experimental-vm-modules test/run_api.mjs && node --experimental-vm-modules test/run_generic_method.mjs && node --experimental-vm-modules test/run_pop_aom.mjs && node --experimental-vm-modules test/run_new_pack.mjs && node --experimental-vm-modules test/run_serialization_inspect.mjs && node --experimental-vm-modules test/run_method_result_model.mjs && node --experimental-vm-modules test/run_native_preprocessing_pipeline.mjs && node --experimental-vm-modules test/run_native_splitter.mjs && node --experimental-vm-modules test/run_native_augmentation.mjs && node --experimental-vm-modules test/run_estimator_roles.mjs && node --experimental-vm-modules test/run_estimator_roles_negative.mjs && node --experimental-vm-modules test/run_role_pipeline.mjs && node --experimental-vm-modules test/run_spectral_encoding.mjs && node --experimental-vm-modules test/run_optimization.mjs && node --experimental-vm-modules test/run_preflight_diagnostics.mjs && node --experimental-vm-modules test/run_pls_scale_equivariance.mjs && node --experimental-vm-modules test/run_pls_small_covariance.mjs && node --experimental-vm-modules test/run_pls_null_consumers.mjs && node --experimental-vm-modules test/run_pls_scale_consumers.mjs && node test/run_intrinsic_diagnostics.mjs && npm run test:shared-scoring && node test/run_snv_parameter_contract.mjs && node test/run_raw_i32_status.mjs && node --experimental-vm-modules test/ranking_mock.mjs && node test/run_ranking.mjs && node test/run_component_analysis.mjs && node test/run_multimodal_teaching.mjs && node test/run_explain.mjs",
|
|
25
25
|
"test:shared-scoring": "node test/run_shared_scoring.mjs"
|
|
26
26
|
},
|
|
27
27
|
"license": "CECILL-2.1 OR AGPL-3.0-or-later",
|