nirs4all-core

nirs4all-core (formerly nirs4all-lite) is the portable aggregate distribution of the nirs4all ecosystem. It is a thin portability layer that exposes the same upstream capabilities across Rust, Python, R, MATLAB/Octave, and JavaScript/WASM from one canonical package surface — without becoming a second implementation of parsing, datasets, ML orchestration, or numerical methods.

What it re-exports

nirs4all-core aggregates exactly six upstream libraries and delegates all real work to them:

  • dag-ml — reproducible, OOF/leakage-safe ML coordinator.

  • dag-ml-data — typed, sample-aligned multi-source data contracts.

  • nirs4all-formats — Rust readers for NIRS/spectroscopy vendor file formats.

  • nirs4all-io — dataset assembly bridge to a SpectroDataset.

  • nirs4all-datasets — curated, DOI-pinned NIRS dataset catalog.

  • nirs4all-methods — portable C-ABI PLS/NIRS numerical engine (libn4m).

Each binding exposes these upstream domains directly as formats, io, datasets, methods, dag_ml, and dag_ml_data.

Important

It only re-exports. nirs4all-core must never add a parser, estimator, numerical kernel, dataset catalog, or DAG compiler of its own. The upstream projects remain the single source of truth; this repository provides only a canonical package surface, native bindings, release glue, and parity checks.

Package names

The Python distribution is named nirs4all-core (RC V1 rename from nirs4all-lite; the canonical import root stays nirs4all_lite) so it does not collide with the full Python nirs4all library. Every other binding uses nirs4all.

Target

External name

Import / module name

Python

nirs4all-core

nirs4all_lite

Rust

nirs4all

nirs4all

JavaScript/WASM

nirs4all

nirs4all

R

nirs4all

library(nirs4all)

MATLAB/Octave

nirs4all

+nirs4all namespace

In Python the aggregate additionally exposes two additive, non-shadowing import facades (see Naming & aggregate facade (LOCK-GOV)): the brand root n4a (import n4a) and the nirs4all_core alias matching the distribution name. Both only re-export nirs4all_lite.

Note

This is the portable aggregate distribution. It is not nirs4all-web (the standalone browser/WASM client) and not nirs4all-studio (the desktop/web app). Those are separate projects that consume parts of this stack.

How the pieces fit

nirs4all-core is the seam where the low-level ecosystem becomes one portable surface. The aggregate composes upstream domains — it does not reimplement them:

nirs4all-formats ─┐
nirs4all-io ──────┤
nirs4all-datasets ┤──►  nirs4all-core  ──►  Python / Rust / R / MATLAB-Octave / JS-WASM
nirs4all-methods ─┤      (aggregate surface,      (one idiomatic API per host)
dag-ml ───────────┤       parity gates, release
dag-ml-data ──────┘       glue — no new logic)

The portable pipeline subset (Kennard-Stone, SNV, Savitzky-Golay, and a PLS component sweep) is parsed from the same JSON/YAML definition envelope used by the full Python nirs4all, then executed through nirs4all-methods and compared against the full Python nirs4all oracle in every binding. See Parity Strategy for the parity strategy and gates.

The nirs4all ecosystem

nirs4all

Main Python modelling library — pipelines, SpectroDataset, predictions.

https://nirs4all.readthedocs.io/en/latest/
nirs4all-formats

Rust readers for ~58 NIRS/spectroscopy file formats (re-exported).

https://nirs4all-formats.readthedocs.io/en/latest/
nirs4all-io

Dataset-assembly bridge → SpectroDataset (re-exported).

https://nirs4all-io.readthedocs.io/en/latest/
nirs4all-datasets

Curated DOI-pinned NIRS dataset catalog (re-exported).

https://nirs4all-datasets.readthedocs.io/en/latest/
nirs4all-methods

Portable C-ABI PLS/NIRS engine, libn4m (re-exported).

https://nirs4all-methods.readthedocs.io/en/latest/
dag-ml

Reproducible, OOF/leakage-safe ML coordinator (re-exported).

https://dag-ml.readthedocs.io/en/latest/
dag-ml-data

Typed sample-aligned multi-source data contracts (re-exported).

https://dag-ml-data.readthedocs.io/en/latest/