Skip to main content

wccs (Python)

Python binding for WCCS, the Weighted Credit-Cooldown Sampler.

This package is a thin ctypes layer over the versioned C ABI. It contains no algorithm logic — all sampling happens in the C core. By default it calls wccs_new_default, which injects the core's deterministic PCG64, so the same seed produces the same sequence in every language (L2).

Install

pip install wccs                # from PyPI: platform wheel, native library included
pip install ./bindings/python   # or from a source checkout

Release wheels bundle the native library inside the wccs package, so nothing else is required. For a source checkout without a bundled library, build it with CMake (cmake -B build && cmake --build build) or point the loader at an existing build:

export WCCS_LIBRARY_PATH=/path/to/libwccs.so   # or .dll / .dylib

Usage

from wccs import Sampler

with Sampler([1, 2, 3, 4], L=3, beta_q=0, R=1000, seed=42) as s:
    for _ in range(10):
        print(s.sample())
    print(s.step, s.total)

Pass rng= (a callable returning a 64-bit integer) to exercise the C ABI's random-source injection via wccs_new. Doing so gives up the L2 guarantee unless every language injects the identical engine.

Errors are raised as wccs.WccsError with a stable .code.

Tests

PYTHONPATH=. python -m unittest discover -s tests -v
PYTHONPATH=. python tests/vector.py     # cross-language vector emitter

License: Apache-2.0

Metadata

Release files for wccs 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for wccs 1.0.0
File Interpreter ABI Platform Actions
wccs-1.0.0-1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for wccs-1.0.0-1-py3-none-win_amd64.whl
wccs-1.0.0-1-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details for wccs-1.0.0-1-py3-none-manylinux_2_35_x86_64.whl
wccs-1.0.0-1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for wccs-1.0.0-1-py3-none-macosx_11_0_arm64.whl

Total release size: 41.1 kB

Release files / wccs-1.0.0-1-py3-none-win_amd64.whl

Download URL wccs-1.0.0-1-py3-none-win_amd64.whl
Size 23.4 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b3c259831ad5b1419a0b6fb20b666c68198e6273ed2783d38a626c9e225cc991
BLAKE2b-256 checksum
How to use checksums
79880e3ed0a62c1e484f63479142d9c9b16c6caf7993559d5f7ff8392fbec087
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / wccs-1.0.0-1-py3-none-manylinux_2_35_x86_64.whl

Download URL wccs-1.0.0-1-py3-none-manylinux_2_35_x86_64.whl
Size 9.7 kB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
1abd56527c9190e144f2a907d834bef88d9e3e2fe5f62f56ff5a7e3bc9d12cd6
BLAKE2b-256 checksum
How to use checksums
c361d031b5e5b159033ab10ae9b1794bc88c4e3df123787812e6e59bdc569ebf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wccs-1.0.0-1-py3-none-macosx_11_0_arm64.whl

Download URL wccs-1.0.0-1-py3-none-macosx_11_0_arm64.whl
Size 8.0 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
009bc016d67425f182376a5825ebf35c1836b456990097e25057b00d77da9fda
BLAKE2b-256 checksum
How to use checksums
eb1db7923bac89d87468e2b8922b3c189447f4a5febfa114149edfeaa226b8eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for wccs 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

3 release files No provenance

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