Skip to main content

muoblpbindings

Performance-critical MOLP solver algorithms implemented in C++20, exposed to Python via pybind11. Built with scikit-build-core + CMake. 4th subproject of the multiobjective-lp monorepo; consumed by solvers as a path dependency, and by experiments for native analysis metrics.

Build requirements

  • C++20 toolchain (gcc/clang/MSVC).
  • Python >=3.13 (CI: 3.13, 3.14; wheels: cp313, cp314).
  • CMake + Ninja: auto-provisioned by scikit-build-core during pip/poetry install (build isolation) — no manual install needed.
  • pybind11 >=3, scikit-build-core >=0.12 (build-system deps, auto-fetched).

Build happens transparently on poetry install in solvers/experiments (path dep). No auto-rebuild on C++ edits — re-run install to rebuild.

macOS broken-CommandLineTools workaround

If bare clang++ can't find c++/v1 headers (broken CommandLineTools install):

export SDKROOT=$(xcrun --show-sdk-path)
export CXXFLAGS="-cxx-isystem $SDKROOT/usr/include/c++/v1"

Proper fix: reinstall CLT (xcode-select --install).

Core-model-shape contract

common.cpp reads the muoblp LpProblem (core) directly — bindings depend on this shape implicitly (no compile-time link to core):

  • prob.objectives: list; each element has .name and is iterable as a dict {LpVariable: utility}. Utility is double in common.cpp (int or float accepted); equal_shares_* take flattened long long utilities — pybind rejects float there (non-dedup objective weights must be 1, not 1.0).
  • prob.objectives_weights: dict[name -> double].
  • prob.variables(), prob.constraints (first constraint = budget; budget = -constraint.constant, per-var cost from constraint dict). Solvers require exactly 1 constraint.

metrics (src/metrics/solved_instance.cpp) reads less, differently:

  • var.varValue for every variable (prob.variables() + objective-only variables); None → ValueError.
  • objective.constant + objective dict items (pulp order preserved).
  • prob.constraints: any number tolerated. Per-var cost = constraint coef, last write wins over all constraints. PB budget = abs(constant) of the unique <= constraint over all prob.variables() (mirrors validate_pb_constraint); none/many → ValueError only from metrics that need it (ejr_plus). Weights not read.

Exposed functions

  • equal_shares_utils(...), equal_shares_add1(...) — Method of Equal Shares.
  • expanding_approvals(prob), single_transferable_vote(prob), solid_coalition_refinement(prob).
  • metrics.SolvedInstance(prob) — opaque snapshot of solved problem; ro props num_voters, num_candidates.
  • metrics.exclusion_ratio(instance) — fraction of voters with objective value exactly 0 (bit-identical to python obj.value() == 0).
  • metrics.ejr_plus(instance, up_to_one=True) — number of unelected candidates violating EJR+ (up to one); parity with python ejr_plus.

See src/muoblpbindings/__init__.pyi and metrics.pyi for signatures.

Adding new algorithm

  1. Assuming algorithm is named x
  2. Create x.cpp and x.hpp files with implementation
  3. Bind method in binder.cpp
  4. Define import and method signature in __init__.py and __init__.pyi
  5. Add and link x.cpp as library in CMakeLists.txt
  6. Bump project version in pyproject.toml

Adding new metric

  1. Assuming metric is named x
  2. Pure core fn double metrics::x(const SolvedInstance&) in src/metrics/x.cpp, declared in src/metrics/metrics.hpp (no pybind/Python API inside: runs with GIL released)
  3. Need more data? Extend SolvedInstance + extraction in src/metrics/solved_instance.cpp
  4. Bind in binder.cpp (metrics_module.def) with py::gil_scoped_release
  5. Re-export in src/muoblpbindings/metrics.py, add stub in metrics.pyi
  6. Add x.cpp to metrics library in CMakeLists.txt
  7. Bump project version in pyproject.toml; relock solvers + analyzers + experiments
  8. In analyzers: python oracle + parity pairing in src/muoblpanalyzers/native_metrics.py (see analyzers README)

Publishing

Independent semver from the rest of the monorepo. Tag bindings@x.y.z (must match pyproject.toml version) triggers root .github/workflows/wheels.yml: sdist + cibuildwheel (ubuntu/macos-15/windows, cp313+cp314) → PyPI via OIDC. No rc/test.pypi route. workflow_dispatch runs a build-only dry run (upload skipped). Every PR additionally builds a linux wheel + import smoke test; solvers CI tests run against that artifact.

Metadata

Release files for muoblpbindings 0.0.20

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

Source distribution (sdist)

Source distribution for muoblpbindings 0.0.20
File Size Uploaded Provenance Actions
muoblpbindings-0.0.20.tar.gz 17.1 kB Without provenance Details for muoblpbindings-0.0.20.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for muoblpbindings 0.0.20
File Actions
muoblpbindings-0.0.20-cp314-cp314-win_arm64.whl CPython 3.14 CPython 3.14 Windows ARM64 Details for muoblpbindings-0.0.20-cp314-cp314-win_arm64.whl
muoblpbindings-0.0.20-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for muoblpbindings-0.0.20-cp314-cp314-win_amd64.whl
muoblpbindings-0.0.20-cp314-cp314-win32.whl CPython 3.14 CPython 3.14 Windows x86-32 Details for muoblpbindings-0.0.20-cp314-cp314-win32.whl
muoblpbindings-0.0.20-cp314-cp314-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 Linux musl 1.2+ x86-64 Details for muoblpbindings-0.0.20-cp314-cp314-musllinux_1_2_x86_64.whl
muoblpbindings-0.0.20-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for muoblpbindings-0.0.20-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
muoblpbindings-0.0.20-cp314-cp314-macosx_14_0_arm64.whl CPython 3.14 CPython 3.14 macOS 14.0+ ARM64 Details for muoblpbindings-0.0.20-cp314-cp314-macosx_14_0_arm64.whl
muoblpbindings-0.0.20-cp313-cp313-win_arm64.whl CPython 3.13 CPython 3.13 Windows ARM64 Details for muoblpbindings-0.0.20-cp313-cp313-win_arm64.whl
muoblpbindings-0.0.20-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for muoblpbindings-0.0.20-cp313-cp313-win_amd64.whl
muoblpbindings-0.0.20-cp313-cp313-win32.whl CPython 3.13 CPython 3.13 Windows x86-32 Details for muoblpbindings-0.0.20-cp313-cp313-win32.whl
muoblpbindings-0.0.20-cp313-cp313-musllinux_1_2_x86_64.whl CPython 3.13 CPython 3.13 Linux musl 1.2+ x86-64 Details for muoblpbindings-0.0.20-cp313-cp313-musllinux_1_2_x86_64.whl
muoblpbindings-0.0.20-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for muoblpbindings-0.0.20-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
muoblpbindings-0.0.20-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details for muoblpbindings-0.0.20-cp313-cp313-macosx_14_0_arm64.whl

Total release size: 5.0 MB

Release files / muoblpbindings-0.0.20.tar.gz

Download URL muoblpbindings-0.0.20.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1846c2f8c4b1593e75e3a908c7a4a62df55ff4d24bf741e95b249415cad779b4
BLAKE2b-256 checksum
How to use checksums
e0adf983b76623427331c042c64022102f8b2c49456e9c2340a4f3e2d502727b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / muoblpbindings-0.0.20-cp314-cp314-win_arm64.whl

Download URL muoblpbindings-0.0.20-cp314-cp314-win_arm64.whl
Size 231.8 kB
Tags CPython 3.14 Windows ARM64
SHA-256 checksum
How to use checksums
a85303827a3a5eeae1f45c63c77391eb29f088116626a0664bdaef2d73393dee
BLAKE2b-256 checksum
How to use checksums
3306e4a8e18b8bfa3151872253eccd19870fd9016828d3239e8cbbd63ac041f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / muoblpbindings-0.0.20-cp314-cp314-win_amd64.whl

Download URL muoblpbindings-0.0.20-cp314-cp314-win_amd64.whl
Size 235.4 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
ce31567d58fbc4745bd8e2a9dca6d69a6fa2285dbd4b57ea2263d61c0e55c675
BLAKE2b-256 checksum
How to use checksums
ade780da5738b429c65d818847afb3c1de17fc3e30ac94815e5a75df207af833
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / muoblpbindings-0.0.20-cp314-cp314-win32.whl

Download URL muoblpbindings-0.0.20-cp314-cp314-win32.whl
Size 218.4 kB
Tags CPython 3.14 Windows x86-32
SHA-256 checksum
How to use checksums
cf80318037b2307485aa30e2768f242ca555974d1824cd0a6a2896951028163d
BLAKE2b-256 checksum
How to use checksums
77939f4e3349547181645294d836334ac6ae12b739da0ce8734da6b6402bc909
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / muoblpbindings-0.0.20-cp314-cp314-musllinux_1_2_x86_64.whl

Download URL muoblpbindings-0.0.20-cp314-cp314-musllinux_1_2_x86_64.whl
Size 1.3 MB
Tags CPython 3.14 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
adf212fd79ce4c29942377c08d57b21cb8708d7ad96af0a1410d5be67a8b333c
BLAKE2b-256 checksum
How to use checksums
10c839c2151a50829ab743a5789a3829bbd643956202040b7edcf4ca771e91b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / muoblpbindings-0.0.20-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL muoblpbindings-0.0.20-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 352.1 kB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c6123b1b7cf534df577840dd526304206c0a008ac000f71f5bd5b869439e1e51
BLAKE2b-256 checksum
How to use checksums
26285de23aa2b75b46da01b6239ab5ef9d8e80791347068c4ea610f7dac7a686
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / muoblpbindings-0.0.20-cp314-cp314-macosx_14_0_arm64.whl

Download URL muoblpbindings-0.0.20-cp314-cp314-macosx_14_0_arm64.whl
Size 165.7 kB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
e6b940672ca297504ae90b79a7fbe2918c0180d55a6e72d7b9b7ea962d4d04b1
BLAKE2b-256 checksum
How to use checksums
9fe3f4dc6f9697eb46c838f065ab6f1b3fd31ba8c408bd269e90bd4a0022458d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / muoblpbindings-0.0.20-cp313-cp313-win_arm64.whl

Download URL muoblpbindings-0.0.20-cp313-cp313-win_arm64.whl
Size 225.7 kB
Tags CPython 3.13 Windows ARM64
SHA-256 checksum
How to use checksums
54ec7aa747bf022da7ee97ca73ec275219f5f67d5400fbbf39fb5b60ca0d625d
BLAKE2b-256 checksum
How to use checksums
76e4c4a74d83e88eac5cdd97a28ba336ae8c30275e4e165a27271692cdb8d3c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / muoblpbindings-0.0.20-cp313-cp313-win_amd64.whl

Download URL muoblpbindings-0.0.20-cp313-cp313-win_amd64.whl
Size 230.2 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
39d122d305b482c741b705f46dd4f8dc21300613afdb3440f36fe4d6eaf95bc6
BLAKE2b-256 checksum
How to use checksums
ade7ccaa28acba8a6032e2115dfe8a9463efade94780dadbd51aceb64ecf8557
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / muoblpbindings-0.0.20-cp313-cp313-win32.whl

Download URL muoblpbindings-0.0.20-cp313-cp313-win32.whl
Size 214.0 kB
Tags CPython 3.13 Windows x86-32
SHA-256 checksum
How to use checksums
d21765b5ba97d7cc0a3f03bb15ff29a70c749fd69cfa6e10c1563108ca16c5fa
BLAKE2b-256 checksum
How to use checksums
b16260efc171a08bd5b1e4ba7edcc23a1d36a807fa30bf697a6b0c6560639407
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / muoblpbindings-0.0.20-cp313-cp313-musllinux_1_2_x86_64.whl

Download URL muoblpbindings-0.0.20-cp313-cp313-musllinux_1_2_x86_64.whl
Size 1.3 MB
Tags CPython 3.13 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
e29c842437cfdc2108b8035db4eceddbe6bca56cb6eee23317b22c02a32f2aeb
BLAKE2b-256 checksum
How to use checksums
bf63c6c1e0aa0737b07535f8426e7827608d74a7625fc44a184fe56c9ee3dff7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / muoblpbindings-0.0.20-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL muoblpbindings-0.0.20-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 352.0 kB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
5eabbe367724da6518d611fe3e886498b7b4e63b77804cab41c6df6e3e790d2d
BLAKE2b-256 checksum
How to use checksums
be787d46acb3a0e44ffedd28b3166a5667f09dcd7bedf506bbac14e703f66c4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / muoblpbindings-0.0.20-cp313-cp313-macosx_14_0_arm64.whl

Download URL muoblpbindings-0.0.20-cp313-cp313-macosx_14_0_arm64.whl
Size 165.4 kB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
5b3a7a89859a751ebcea58a2642fa6d2bebb2166e58136e81f15e8a3f468cb69
BLAKE2b-256 checksum
How to use checksums
b78220edcdb409e368a8c44fbf29801f8ff010678ea1df29433bbd2559032f8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Security for muoblpbindings 0.0.20

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