Binding Contract¶
Python¶
Distribution name:
nirs4all-lite.Import name:
nirs4all_lite.Framework idioms: sklearn-style estimators,
fit/predict/transform, NumPy arrays, pandas data frames, and clear optional extras.External operators should look like normal sklearn-compatible transformers or estimators when they participate in Python execution.
Do not shadow the full Python
nirs4allpackage until the core replacement migration is intentional.
Rust¶
Crate name:
nirs4all.Use
Result-returning APIs and typed wrappers around upstream crates.External operators should use traits and typed builder APIs, with capabilities declared at compile time or through explicit runtime feature checks.
Keep FFI handles explicit; never hide ownership transfers.
The portable KS/SNV/Savitzky-Golay/PLS subset executes through a caller-supplied
libn4mpath and is covered by the shared full-Pythonnirs4alloracle.
JavaScript/WASM¶
npm package name:
nirs4all.Expose typed ESM APIs and browser-safe WASM loaders.
External operators should be ESM functions/classes over browser-safe values and
TypedArraydata, with async initialization where WASM is required.The portable KS/SNV/Savitzky-Golay/PLS subset executes with
runPortablePipeline()and predicts from its serialized selected model withpredictPortablePipeline(), both delegating to@nirs4all/methods-wasm.nirs4all-webconsumes this package; UI code does not live here.Current upstream package candidates are
nirs4all-formats-wasm,nirs4all-io-wasm,@nirs4all/datasets-wasm,dag-ml-wasm,dag-ml-data-wasm, and@nirs4all/methods-wasm.
R¶
Package name:
nirs4all.Provide formula/data-frame paths where appropriate.
External operators should expose S3 generics and formula/data-frame adapters where that is the natural R interface.
Keep native handles opaque and expose provenance in returned objects.
Current R package candidates include
nirs4allformats,nirs4allio,nirs4alldatasets,dagmldata, andn4m/pls4allfor methods.dag-mlhas no declared R binding yet and remains unavailable in the R aggregate.
MATLAB/Octave¶
Namespace:
+nirs4all.Prefer matrices/tables and explicit options structs.
External operators should use function handles or small handle classes with
fit/predict/transform-style methods when execution support exists.Keep Octave compatibility in the public subset unless a function is marked MATLAB-only.
The portable KS/SNV/Savitzky-Golay/PLS subset executes through
nirs4all.runPortablePipeline()by delegating to thenirs4all-methods+pls4allMEX shims. The aggregate binding still owns only parsing, orchestration, and result-shape translation.