Skip to main content

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 and import it as n4m — 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 Context and Config (RAII lifecycle wrappers),
  • the PLS fit/predict surface and a scikit-learn-compatible pls4all.sklearn.PLSRegression (and the other PLS-family estimators),
  • a typed Pls4allError raised on any non-OK status, carrying the context's last_error message.

Quick start

import numpy as np
import pls4all
from pls4all.sklearn import PLSRegression

print(pls4all.version())      # e.g. "1.0.3+abi.2.0.0"
print(pls4all.abi_version())  # (2, 0, 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:

  1. $PLS4ALL_LIB_PATH — explicit path to libn4m for this package,
  2. $N4M_LIB_PATH — shared libn4m override honoured by both pls4all and n4m,
  3. pls4all/lib/libn4m* next to the installed package (wheel layout),
  4. <repo-root>/build/dev-release/cpp/src/libn4m* (developer convenience),
  5. the standard system search path (LD_LIBRARY_PATH, macOS rpath, Windows PATH).

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pls4all-1.0.9.tar.gz (131.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pls4all-1.0.9-py3-none-win_amd64.whl (1.3 MB view details)

Uploaded Python 3Windows x86-64

pls4all-1.0.9-py3-none-musllinux_1_2_x86_64.whl (4.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

pls4all-1.0.9-py3-none-musllinux_1_2_aarch64.whl (4.1 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

pls4all-1.0.9-py3-none-manylinux_2_28_x86_64.whl (4.7 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

pls4all-1.0.9-py3-none-manylinux_2_28_aarch64.whl (3.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

pls4all-1.0.9-py3-none-macosx_11_0_universal2.whl (7.2 MB view details)

Uploaded Python 3macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file pls4all-1.0.9.tar.gz.

File metadata

  • Download URL: pls4all-1.0.9.tar.gz
  • Upload date:
  • Size: 131.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pls4all-1.0.9.tar.gz
Algorithm Hash digest
SHA256 46d81e8eb56e63d71bdcd548a01b3dd0089e4a378717b40a4693a79019df6248
MD5 f9fc2c6109f7bb9353fbfa5b1f57ffe8
BLAKE2b-256 ecb7334ba783470644baf549cb777d8fd7827deacfaa8e79dbf705dcbd157346

See more details on using hashes here.

Provenance

The following attestation bundles were made for pls4all-1.0.9.tar.gz:

Publisher: release-python.yml on GBeurier/nirs4all-methods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pls4all-1.0.9-py3-none-win_amd64.whl.

File metadata

  • Download URL: pls4all-1.0.9-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

Hashes for pls4all-1.0.9-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 40ce69607f8bb4c472a55fa120fc83f3d1b8e7e8405814e7d9198cb6e899934f
MD5 eccfa7edc57174d3af946d1123a737bf
BLAKE2b-256 9f730919e0f91f876bfcddde3178a7273d39c18385e41c5938a1021c32e1443f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pls4all-1.0.9-py3-none-win_amd64.whl:

Publisher: release-python.yml on GBeurier/nirs4all-methods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pls4all-1.0.9-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pls4all-1.0.9-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e6b2cce2841957d95c5290e3dba4b1c432b89344527faf7d66cd3b9264945a9a
MD5 5730d7593849142748f52cadf6fb2606
BLAKE2b-256 905cec5e0bedb2a8a9b0539f80905d633a1b4c3051ed1378835cc860a81b6fe7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pls4all-1.0.9-py3-none-musllinux_1_2_x86_64.whl:

Publisher: release-python.yml on GBeurier/nirs4all-methods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pls4all-1.0.9-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pls4all-1.0.9-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 fefdf82775a5c7495008915bfbe1d67e6ac01ccb844514c88d3c9acefad282fc
MD5 d2f057954cc4271d72cacb651bbc3a2b
BLAKE2b-256 352372a2db32c6565c53a1c2e9b757806105d0bba9311f6e84011401e9430d24

See more details on using hashes here.

Provenance

The following attestation bundles were made for pls4all-1.0.9-py3-none-musllinux_1_2_aarch64.whl:

Publisher: release-python.yml on GBeurier/nirs4all-methods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pls4all-1.0.9-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pls4all-1.0.9-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c22c2c62a8a27438bac693f4ac5f86ae4d415d1d33bdf0b0e7c9f14d57d9f1bc
MD5 45b5535162133980b5128d08f402c640
BLAKE2b-256 86a1dac42fcac653021bbfb92a34c664624274864723abd35176331c4725f85e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pls4all-1.0.9-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release-python.yml on GBeurier/nirs4all-methods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pls4all-1.0.9-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pls4all-1.0.9-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cb2bb0c42dfa7cd1cf4c97f7e5684f77b10604a84e4ccbdebd503c906d86cfa3
MD5 9157e1a24e1fd1dfa1025b7aaebea179
BLAKE2b-256 06d61d03d440ab6e2d0eac7395c26eecfff71fb1a70b6f31f890524869be1b16

See more details on using hashes here.

Provenance

The following attestation bundles were made for pls4all-1.0.9-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release-python.yml on GBeurier/nirs4all-methods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pls4all-1.0.9-py3-none-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for pls4all-1.0.9-py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 9032d337554ea8c4363195ea36b836fe218753ad71dc300668ced069cfb5a039
MD5 61bb5ccc53116aa023de7723678fc61b
BLAKE2b-256 65540498509053d6424892a30241077438602a10e707ec29ef205362fbf2f82b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pls4all-1.0.9-py3-none-macosx_11_0_universal2.whl:

Publisher: release-python.yml on GBeurier/nirs4all-methods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.0.18

7 files

1.0.17

7 files

1.0.16

7 files

1.0.15

7 files

1.0.13

7 files

1.0.12

7 files

1.0.11

7 files

1.0.10

7 files

This release

1.0.9 This release

7 files

1.0.8

7 files

1.0.7

7 files

1.0.6

7 files

1.0.5

7 files

1.0.2

7 files

1.0.1

7 files

0.99.0

7 files

0.97.3

7 files

0.97.2

7 files

0.97.1

7 files

0.97.0

7 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page