nirs4all 0.2.10 → 0.2.12
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 +6 -4
- package/package.json +1 -1
- package/src/index.d.ts +10 -0
- package/src/index.js +39 -0
package/README.md
CHANGED
|
@@ -26,10 +26,12 @@ preserves explicit methods-backed modes (`mirror`, `constant`, `nearest`,
|
|
|
26
26
|
`wrap`, `interp`) plus `cval` in the serialized preprocessing chain.
|
|
27
27
|
|
|
28
28
|
Custom app hosts can inspect `capabilityManifest()`, `controllerCapabilities`,
|
|
29
|
-
and `
|
|
30
|
-
manifest schema is `nirs4all-core.capabilities.v1`; it
|
|
31
|
-
controller IDs for Kennard-Stone, SNV, Savitzky-Golay,
|
|
32
|
-
portable methods pipeline, with parameter lists
|
|
29
|
+
`runtimeSurfaces`, and `runtimeContracts` before rendering graph nodes or
|
|
30
|
+
selecting a runtime. The manifest schema is `nirs4all-core.capabilities.v1`; it
|
|
31
|
+
exposes the stable V1 controller IDs for Kennard-Stone, SNV, Savitzky-Golay,
|
|
32
|
+
PLS regression, and the portable methods pipeline, with parameter lists
|
|
33
|
+
matching the executable parser. `runtimeContracts` also makes explicit that
|
|
34
|
+
standalone serialized-model prediction is currently a WASM-only contract.
|
|
33
35
|
|
|
34
36
|
For a browser-only custom host, pair this package with `nirs4all-ui`: keep
|
|
35
37
|
runtime loading and portable execution in `nirs4all`, and consume shared React
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -19,6 +19,14 @@ export interface PipelineDefinition {
|
|
|
19
19
|
export type RuntimeSurface = 'python' | 'r' | 'javascript_wasm' | 'rust' | 'matlab_octave';
|
|
20
20
|
export type CapabilityLevel = 'metadata' | 'plan' | 'execute-local' | 'execute-remote' | 'parity-validated';
|
|
21
21
|
|
|
22
|
+
export interface RuntimeContract {
|
|
23
|
+
surface: RuntimeSurface;
|
|
24
|
+
pipelineExecution: CapabilityLevel;
|
|
25
|
+
pipelineEntrypoint: string;
|
|
26
|
+
serializedModelPredict: boolean;
|
|
27
|
+
predictEntrypoint: string | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
22
30
|
export interface ControllerCapability {
|
|
23
31
|
id: string;
|
|
24
32
|
kind: 'splitter' | 'transform' | 'model' | 'pipeline';
|
|
@@ -39,6 +47,7 @@ export interface CapabilityManifest {
|
|
|
39
47
|
schema: 'nirs4all-core.capabilities.v1';
|
|
40
48
|
aggregate: 'nirs4all-core';
|
|
41
49
|
runtimeSurfaces: readonly RuntimeSurface[];
|
|
50
|
+
runtimeContracts: readonly RuntimeContract[];
|
|
42
51
|
portableOperatorClasses: readonly string[];
|
|
43
52
|
controllers: readonly ControllerCapability[];
|
|
44
53
|
}
|
|
@@ -96,6 +105,7 @@ export interface PortablePredictionResult {
|
|
|
96
105
|
export const upstreams: readonly Upstream[];
|
|
97
106
|
export const portableOperatorClasses: readonly string[];
|
|
98
107
|
export const runtimeSurfaces: readonly RuntimeSurface[];
|
|
108
|
+
export const runtimeContracts: readonly RuntimeContract[];
|
|
99
109
|
export const controllerCapabilities: readonly ControllerCapability[];
|
|
100
110
|
export function capabilityManifest(): CapabilityManifest;
|
|
101
111
|
|
package/src/index.js
CHANGED
|
@@ -53,6 +53,44 @@ export const runtimeSurfaces = Object.freeze([
|
|
|
53
53
|
'matlab_octave',
|
|
54
54
|
]);
|
|
55
55
|
|
|
56
|
+
export const runtimeContracts = Object.freeze([
|
|
57
|
+
Object.freeze({
|
|
58
|
+
surface: 'python',
|
|
59
|
+
pipelineExecution: 'parity-validated',
|
|
60
|
+
pipelineEntrypoint: 'run_portable_pipeline',
|
|
61
|
+
serializedModelPredict: false,
|
|
62
|
+
predictEntrypoint: null,
|
|
63
|
+
}),
|
|
64
|
+
Object.freeze({
|
|
65
|
+
surface: 'r',
|
|
66
|
+
pipelineExecution: 'parity-validated',
|
|
67
|
+
pipelineEntrypoint: 'nirs4all_run_portable_pipeline',
|
|
68
|
+
serializedModelPredict: false,
|
|
69
|
+
predictEntrypoint: null,
|
|
70
|
+
}),
|
|
71
|
+
Object.freeze({
|
|
72
|
+
surface: 'javascript_wasm',
|
|
73
|
+
pipelineExecution: 'parity-validated',
|
|
74
|
+
pipelineEntrypoint: 'runPortablePipeline',
|
|
75
|
+
serializedModelPredict: true,
|
|
76
|
+
predictEntrypoint: 'predictPortablePipeline',
|
|
77
|
+
}),
|
|
78
|
+
Object.freeze({
|
|
79
|
+
surface: 'rust',
|
|
80
|
+
pipelineExecution: 'parity-validated',
|
|
81
|
+
pipelineEntrypoint: 'run_portable_pipeline_with_library',
|
|
82
|
+
serializedModelPredict: false,
|
|
83
|
+
predictEntrypoint: null,
|
|
84
|
+
}),
|
|
85
|
+
Object.freeze({
|
|
86
|
+
surface: 'matlab_octave',
|
|
87
|
+
pipelineExecution: 'parity-validated',
|
|
88
|
+
pipelineEntrypoint: 'runPortablePipeline',
|
|
89
|
+
serializedModelPredict: false,
|
|
90
|
+
predictEntrypoint: null,
|
|
91
|
+
}),
|
|
92
|
+
]);
|
|
93
|
+
|
|
56
94
|
const parityRuntime = Object.freeze(Object.fromEntries(
|
|
57
95
|
runtimeSurfaces.map((surface) => [surface, 'parity-validated']),
|
|
58
96
|
));
|
|
@@ -154,6 +192,7 @@ export function capabilityManifest() {
|
|
|
154
192
|
schema: 'nirs4all-core.capabilities.v1',
|
|
155
193
|
aggregate: 'nirs4all-core',
|
|
156
194
|
runtimeSurfaces,
|
|
195
|
+
runtimeContracts,
|
|
157
196
|
portableOperatorClasses,
|
|
158
197
|
controllers: controllerCapabilities,
|
|
159
198
|
});
|