Skip to main content

Computation core for PySATL

Project description

PySATL Core

CI MIT License

PySATL Core is the computational core of the PySATL project, providing abstractions and infrastructure for probability distributions, parametric families, characteristic-based computations, transformations, and sampling.

The library is designed as a foundational kernel rather than a ready-to-use end-user package. Its primary goals are explicit probabilistic structure, extensibility, and suitability as a basis for further stochastic and statistical tooling.

Project status
PySATL Core is currently in early alpha.
The public API may change between alpha releases.


✨ Key features

  • Parametric families of distributions with multiple parametrizations
    (e.g. Normal: meanStd, meanPrec).
  • A global family registry for configuring, querying, and extending available distribution families.
  • Characteristic computation graph (CharacteristicRegistry) that allows computing arbitrary characteristics by specifying only a minimal analytical subset.
  • Transformations module for derived distributions: affine transformations (aX + b), binary operations (X ± Y, X * Y, X / Y), finite weighted mixtures, and characteristic-level approximations.
  • Distribution objects exposing common probabilistic operations (sampling, analytical and fitted computations).
  • Clear separation between distribution definitions, parametrizations, computation strategies, and characteristics.
  • Modern Python with strict static typing (PEP 695).

Requirements

  • Python 3.12+ (the project relies on PEP 695 syntax)
  • NumPy 2.x
  • SciPy 1.13+
  • A C toolchain when building from source or from an sdist:
    • Linux/macOS: GCC (or Clang) plus standard build utilities.
    • Windows: Microsoft Visual C++ Build Tools (MSVC) from Visual Studio or the standalone Build Tools installer.
  • Poetry (recommended for development)

Installation

Install from PyPI:

pip install pysatl-core

Linux wheels are not published yet. On Linux, pip builds the package from the source distribution and requires a working C toolchain.

For development, install from source.

Clone the repository:

git clone https://github.com/PySATL/pysatl-core.git
cd pysatl-core
git submodule update --init --recursive

Development install

poetry install --with dev,docs

Editable runtime install

pip install -e .

🚀 Quickstart

Below is a compact example demonstrating the use of a built-in Normal distribution. It mirrors the example shown in the documentation (examples/overview.ipynb).

from pysatl_core import (
    FamilyName,
    ParametricFamilyRegister,
    configure_normal_family,
)

configure_normal_family()
normal_family = ParametricFamilyRegister.get(FamilyName.NORMAL)

normal = normal_family.distribution(
    parametrization_name="meanStd",
    mu=0.0,
    sigma=1.0,
)

normal_alt = normal_family.distribution(
    parametrization_name="meanPrec",
    mu=0.0,
    tau=1.0,
)

samples = normal.sample(n=10_000)
print(samples[:5])

mean = normal.query_method("mean")()
variance = normal.query_method("variance")()

print(mean, variance)

This example uses a predefined family and predefined parametrizations. PySATL Core also supports defining custom families, parametrizations, and characteristic graphs.

For transformation workflows, see examples/transformations_overview.ipynb.


📓 Notebooks

  • examples/overview.ipynb — base walkthrough for families, parametrizations, and characteristic queries.
  • examples/transformations_overview.ipynb — affine, binary, finite-mixture, and approximation workflows.
  • examples/example_sampling_methods.ipynb — sampling backends and UNURAN-oriented scenarios.

📖 Documentation

👉 Online documentation:
https://pysatl.github.io/pysatl-core/

Documentation previews are automatically generated for pull requests and can be inspected via CI artifacts.


🧠 Concepts & design

  • ParametricFamily — a family of distributions sharing a common mathematical form.
  • Parametrization — a concrete coordinate system for a family.
  • Distribution — a probabilistic object instantiated from a family and parametrization.
  • Characteristic graph — a directed graph describing relationships between computable characteristics.
  • Registries — explicit global registries enabling controlled extensibility.

🛠 Development

poetry install --with dev
poetry run pytest
poetry run pre-commit run --all-files

Package sanity check

poetry run python -m build
poetry run twine check dist/*

These commands build the local distribution artifacts and validate their metadata. They do not publish anything.


🗺 Roadmap

  • Extension of the transformations module (functional transforms, performance improvements).
  • Extension of characteristic graphs.
  • Stabilization of APIs and publishing PySATL Core as an installable package.

License

Distributed under the MIT License. See LICENSE.

Project details


Download files

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

Source Distribution

pysatl_core-0.1.0a0.tar.gz (905.3 kB view details)

Uploaded Source

Built Distributions

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

pysatl_core-0.1.0a0-cp313-cp313-win_amd64.whl (335.6 kB view details)

Uploaded CPython 3.13Windows x86-64

pysatl_core-0.1.0a0-cp313-cp313-macosx_11_0_arm64.whl (757.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pysatl_core-0.1.0a0-cp312-cp312-win_amd64.whl (251.2 kB view details)

Uploaded CPython 3.12Windows x86-64

pysatl_core-0.1.0a0-cp312-cp312-macosx_11_0_arm64.whl (463.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file pysatl_core-0.1.0a0.tar.gz.

File metadata

  • Download URL: pysatl_core-0.1.0a0.tar.gz
  • Upload date:
  • Size: 905.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pysatl_core-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 4ea3677aea961dbf23d9691e8e4c87ddbb78c58b9724404265e5a10808908128
MD5 ca30792c9fcd2cb78d0681569e89cc61
BLAKE2b-256 4fafc870bfde7bfbffd3e5bb34d06d344801246a7c1c6f77a77fea4a2a43fe76

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysatl_core-0.1.0a0.tar.gz:

Publisher: release.yml on PySATL/pysatl-core

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

File details

Details for the file pysatl_core-0.1.0a0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pysatl_core-0.1.0a0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 869fc68da14e422e2f33703981bb1ad8c654444dcfab7e9a96643d0b4768eed2
MD5 801b2719ed7571808269bc71e0e4f118
BLAKE2b-256 ae4e5a1840367ec94d47d0a896516641742c6a330ed980608d9b6f98a6b46ef9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysatl_core-0.1.0a0-cp313-cp313-win_amd64.whl:

Publisher: release.yml on PySATL/pysatl-core

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

File details

Details for the file pysatl_core-0.1.0a0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pysatl_core-0.1.0a0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fefb47a9480430c533dd771b0e8bceb0584401d87b26bd1f9faf9370f55ef2ee
MD5 dafdfab2ceccef0448b950e73efbc744
BLAKE2b-256 47a79c6ff4083f6b1c311baf1429636e1b999561269f5ae41ad2950c354c68c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysatl_core-0.1.0a0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on PySATL/pysatl-core

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

File details

Details for the file pysatl_core-0.1.0a0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pysatl_core-0.1.0a0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bc96dff178a5d62b4918f9de8ff63dc4ab08f520f01b1098c3e502409556399a
MD5 e1a381071cd47dc2048d05b2699a6882
BLAKE2b-256 3a909f309e397fe48e8ffeefe632ea04ec3f1a24c9f0bf0cababb48cb9ad3e5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysatl_core-0.1.0a0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on PySATL/pysatl-core

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

File details

Details for the file pysatl_core-0.1.0a0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pysatl_core-0.1.0a0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2d440cfc7caccde2476dbac4e7cef68a67066f432eeb996ea1adc2ed5134685
MD5 4665db36344d60cca1274467361141f4
BLAKE2b-256 b963fb3189a8df916c575cc845a84fb8b26159916543b71a602b9d9035e6b390

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysatl_core-0.1.0a0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on PySATL/pysatl-core

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page