Python binding for the pls4all C ABI — a portable PLS / NIRS engine.
Project description
pls4all
pls4all is the slim, PLS-only subset of nirs4all-methods — a thin Python
binding over the portable libn4m C ABI (a C++17 PLS / NIRS engine). The wheel
bundles the libn4m shared library, so pip install pls4all is self-contained;
no separate native build is required. For the full method surface (preprocessing,
selectors, diagnostics, augmenters, …) install the nirs4all-methods package
instead — both load the same libn4m.
The binding loads libn4m with ctypes.CDLL (so the GIL is released during
native calls) and exposes:
version()/abi_version()introspection,- a Pythonic
ContextandConfig(RAII lifecycle wrappers), - the PLS fit/predict surface and a scikit-learn-compatible
pls4all.sklearn.PLSRegression(and the other PLS-family estimators), - a typed
Pls4allErrorraised on any non-OK status, carrying the context'slast_errormessage.
Quick start
import numpy as np
import pls4all
from pls4all.sklearn import PLSRegression
print(pls4all.version()) # e.g. "0.98.0+abi.1.9.0"
print(pls4all.abi_version()) # (1, 9, 0)
rng = np.random.default_rng(0)
X = rng.standard_normal((40, 12))
y = X @ rng.standard_normal(12)
model = PLSRegression(n_components=5).fit(X, y)
print(model.predict(X).shape) # (40,)
Low-level lifecycle, if you need it:
with pls4all.Context() as ctx, pls4all.Config() as cfg:
cfg.algorithm = pls4all.Algorithm.PLS_REGRESSION
cfg.solver = pls4all.Solver.SIMPLS
cfg.n_components = 5
# ... drive a fit through the C ABI ...
scikit-learn is an optional dependency (only pls4all.sklearn needs it); the
core import pls4all works with NumPy alone.
Loading libn4m
The bundled wheel ships libn4m inside pls4all/lib/, found automatically. For
development against a local build the loader searches, in order:
$PLS4ALL_LIB_PATH— explicit path tolibn4m(most direct),pls4all/lib/libn4m*next to the installed package (wheel layout),<repo-root>/build/dev-release/cpp/src/libn4m*(developer convenience),- the standard system search path (
LD_LIBRARY_PATH, macOS rpath, WindowsPATH).
Building libn4m from source (developers)
cmake --preset dev-release
cmake --build --preset dev-release --parallel
This produces build/dev-release/cpp/src/libn4m.so (.dylib / .dll on
macOS / Windows), which the loader rules above pick up.
See https://github.com/GBeurier/nirs4all-methods for the full project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pls4all-0.99.0.tar.gz.
File metadata
- Download URL: pls4all-0.99.0.tar.gz
- Upload date:
- Size: 125.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25890c7a6819b7ea941ab370e317275894c15c2ef7d60318daa719dea549f394
|
|
| MD5 |
15879d031e3b5218bf6970b1ea7c3c92
|
|
| BLAKE2b-256 |
33fbd0b3b0062bafeff39949a86c372a7a2bc04e87246fd59d49fd5b15ec0aeb
|
Provenance
The following attestation bundles were made for pls4all-0.99.0.tar.gz:
Publisher:
release-python.yml on GBeurier/nirs4all-methods
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pls4all-0.99.0.tar.gz -
Subject digest:
25890c7a6819b7ea941ab370e317275894c15c2ef7d60318daa719dea549f394 - Sigstore transparency entry: 1793364297
- Sigstore integration time:
-
Permalink:
GBeurier/nirs4all-methods@cbfc0acc494c663e6a31791896b6000c818500e0 -
Branch / Tag:
refs/tags/v0.99.0 - Owner: https://github.com/GBeurier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@cbfc0acc494c663e6a31791896b6000c818500e0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pls4all-0.99.0-py3-none-win_amd64.whl.
File metadata
- Download URL: pls4all-0.99.0-py3-none-win_amd64.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07d9bef30c0f09b010d8c597e899d643b36819347736bd9af8202614bf321bbd
|
|
| MD5 |
a6771e5c89df86f8ea4af8ccd677950e
|
|
| BLAKE2b-256 |
828aaa1ea39182c5abe84e9ce38f1cdd9fb6da836eac7e00ed472f624c3f0537
|
Provenance
The following attestation bundles were made for pls4all-0.99.0-py3-none-win_amd64.whl:
Publisher:
release-python.yml on GBeurier/nirs4all-methods
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pls4all-0.99.0-py3-none-win_amd64.whl -
Subject digest:
07d9bef30c0f09b010d8c597e899d643b36819347736bd9af8202614bf321bbd - Sigstore transparency entry: 1793365730
- Sigstore integration time:
-
Permalink:
GBeurier/nirs4all-methods@cbfc0acc494c663e6a31791896b6000c818500e0 -
Branch / Tag:
refs/tags/v0.99.0 - Owner: https://github.com/GBeurier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@cbfc0acc494c663e6a31791896b6000c818500e0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pls4all-0.99.0-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: pls4all-0.99.0-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 4.7 MB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c19d434ce4089931f2f5a80bef8b02ca3135cbac59a974c543c2aa92bb08734
|
|
| MD5 |
c7ba38ce805fd6b280e3d765e265378a
|
|
| BLAKE2b-256 |
52bcbe7725d8adeacb1c8a78a7b600e9b1f73c30392ef2d62de9fa83897e06d0
|
Provenance
The following attestation bundles were made for pls4all-0.99.0-py3-none-musllinux_1_2_x86_64.whl:
Publisher:
release-python.yml on GBeurier/nirs4all-methods
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pls4all-0.99.0-py3-none-musllinux_1_2_x86_64.whl -
Subject digest:
1c19d434ce4089931f2f5a80bef8b02ca3135cbac59a974c543c2aa92bb08734 - Sigstore transparency entry: 1793365542
- Sigstore integration time:
-
Permalink:
GBeurier/nirs4all-methods@cbfc0acc494c663e6a31791896b6000c818500e0 -
Branch / Tag:
refs/tags/v0.99.0 - Owner: https://github.com/GBeurier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@cbfc0acc494c663e6a31791896b6000c818500e0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pls4all-0.99.0-py3-none-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: pls4all-0.99.0-py3-none-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 4.1 MB
- Tags: Python 3, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bf49d11d34036a4d15ac5c2735fe63c7179db88ae6169fc7c9e18f1affac734
|
|
| MD5 |
0d4f47087821b5f9d6fb0dbc8e2b1a1f
|
|
| BLAKE2b-256 |
be800b8f4967cf362dcb366e9aa8b74692e6bad5d2fa53935ce34acc99f7d193
|
Provenance
The following attestation bundles were made for pls4all-0.99.0-py3-none-musllinux_1_2_aarch64.whl:
Publisher:
release-python.yml on GBeurier/nirs4all-methods
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pls4all-0.99.0-py3-none-musllinux_1_2_aarch64.whl -
Subject digest:
7bf49d11d34036a4d15ac5c2735fe63c7179db88ae6169fc7c9e18f1affac734 - Sigstore transparency entry: 1793365883
- Sigstore integration time:
-
Permalink:
GBeurier/nirs4all-methods@cbfc0acc494c663e6a31791896b6000c818500e0 -
Branch / Tag:
refs/tags/v0.99.0 - Owner: https://github.com/GBeurier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@cbfc0acc494c663e6a31791896b6000c818500e0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pls4all-0.99.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pls4all-0.99.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.7 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e1d94abfed89d883dadfc177d7ec91e47f6935b95e10f8b41dfd593a32b0068
|
|
| MD5 |
2bbba7d070a6eb2f896f019093b73f3e
|
|
| BLAKE2b-256 |
7b4ed053a35d9f95f53830bf52c3db04ec984f0420bd434583680fbb60e8dbd7
|
Provenance
The following attestation bundles were made for pls4all-0.99.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release-python.yml on GBeurier/nirs4all-methods
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pls4all-0.99.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
3e1d94abfed89d883dadfc177d7ec91e47f6935b95e10f8b41dfd593a32b0068 - Sigstore transparency entry: 1793365135
- Sigstore integration time:
-
Permalink:
GBeurier/nirs4all-methods@cbfc0acc494c663e6a31791896b6000c818500e0 -
Branch / Tag:
refs/tags/v0.99.0 - Owner: https://github.com/GBeurier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@cbfc0acc494c663e6a31791896b6000c818500e0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pls4all-0.99.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: pls4all-0.99.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 3.7 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00c9ce2082cb1d0a3ac29b03a5be75e99e95b2df90ff2c60462d86a6297d557d
|
|
| MD5 |
a23b851c1eb2ccbe53f365acde139bf6
|
|
| BLAKE2b-256 |
ac60333344c065f968bb2624038cc505361e602d8db94ef6edf06e117f9a8d12
|
Provenance
The following attestation bundles were made for pls4all-0.99.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release-python.yml on GBeurier/nirs4all-methods
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pls4all-0.99.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
00c9ce2082cb1d0a3ac29b03a5be75e99e95b2df90ff2c60462d86a6297d557d - Sigstore transparency entry: 1793364651
- Sigstore integration time:
-
Permalink:
GBeurier/nirs4all-methods@cbfc0acc494c663e6a31791896b6000c818500e0 -
Branch / Tag:
refs/tags/v0.99.0 - Owner: https://github.com/GBeurier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@cbfc0acc494c663e6a31791896b6000c818500e0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pls4all-0.99.0-py3-none-macosx_11_0_universal2.whl.
File metadata
- Download URL: pls4all-0.99.0-py3-none-macosx_11_0_universal2.whl
- Upload date:
- Size: 7.2 MB
- Tags: Python 3, macOS 11.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbbdccdab79b0bd850d2b83458e6b086a6734cb41ebe971ace2cdea442bd5351
|
|
| MD5 |
893a6cde76c80a90845cc382e13ca81c
|
|
| BLAKE2b-256 |
dc4a6aa523adbf4c9148c4aac80acced31e86a6760dcd8e1e679bdbf2281acd7
|
Provenance
The following attestation bundles were made for pls4all-0.99.0-py3-none-macosx_11_0_universal2.whl:
Publisher:
release-python.yml on GBeurier/nirs4all-methods
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pls4all-0.99.0-py3-none-macosx_11_0_universal2.whl -
Subject digest:
cbbdccdab79b0bd850d2b83458e6b086a6734cb41ebe971ace2cdea442bd5351 - Sigstore transparency entry: 1793365646
- Sigstore integration time:
-
Permalink:
GBeurier/nirs4all-methods@cbfc0acc494c663e6a31791896b6000c818500e0 -
Branch / Tag:
refs/tags/v0.99.0 - Owner: https://github.com/GBeurier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@cbfc0acc494c663e6a31791896b6000c818500e0 -
Trigger Event:
push
-
Statement type: