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.3

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.3
File Actions
wccs-1.0.3-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for wccs-1.0.3-py3-none-win_amd64.whl
wccs-1.0.3-py3-none-win32.whl Python 3 none Windows x86-32 Details for wccs-1.0.3-py3-none-win32.whl
wccs-1.0.3-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details for wccs-1.0.3-py3-none-manylinux_2_35_x86_64.whl
wccs-1.0.3-py3-none-manylinux_2_35_i686.whl Python 3 none Linux glibc 2.35+ x86-32 Details for wccs-1.0.3-py3-none-manylinux_2_35_i686.whl
wccs-1.0.3-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for wccs-1.0.3-py3-none-macosx_11_0_arm64.whl

Total release size: 127.9 kB

Release files / wccs-1.0.3-py3-none-win_amd64.whl

Download URL wccs-1.0.3-py3-none-win_amd64.whl
Size 12.8 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
29f4f1208fc98a9ed6033dc008fe730d36b036a33aaef491d11d6253e5bbc0cc
BLAKE2b-256 checksum
How to use checksums
8bc1923bd8366e587a5e5655a09a95c44327dc40bf770bb9c89cf056f35463aa
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.3-py3-none-win32.whl

Download URL wccs-1.0.3-py3-none-win32.whl
Size 83.3 kB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
827d5af856118dea2f3248bc05f181534b4d67321724b6161d9c1df5a259a43d
BLAKE2b-256 checksum
How to use checksums
39aabd58d385f3d0540697a8d56a5d3dc6be1c183bf991db2bd02018ca83b514
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.3-py3-none-manylinux_2_35_x86_64.whl

Download URL wccs-1.0.3-py3-none-manylinux_2_35_x86_64.whl
Size 11.2 kB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
97f4eb39bbd9c15fab75a8616ea9e12c5c71887397ca597d398d3ce8f0f05acf
BLAKE2b-256 checksum
How to use checksums
624f174ba17df1dd2f38e507b443e9c55dca9f524fae5d64007f0f3fe569e171
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.3-py3-none-manylinux_2_35_i686.whl

Download URL wccs-1.0.3-py3-none-manylinux_2_35_i686.whl
Size 11.7 kB
Tags Linux glibc 2.35+ x86-32 Python 3
SHA-256 checksum
How to use checksums
6c0a8a75963bc99780c4ab3abe29e6b8007c8ac357519acdec45fa0529909047
BLAKE2b-256 checksum
How to use checksums
091d12c1c64134444c142ece45dcfc64b162c3104d3b20df852fc2d6b84f3adb
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.3-py3-none-macosx_11_0_arm64.whl

Download URL wccs-1.0.3-py3-none-macosx_11_0_arm64.whl
Size 8.9 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
abe8ddfcfd75bbaabec38dde61182ffce00d74fc99abffe8edb16c811204b2fc
BLAKE2b-256 checksum
How to use checksums
7a8934ffdfec9763946ed62b1135e2542d936d6f4f30b46e5fbcb8325f50d022
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.3

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.

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