Measures on participatory budgeting elections
Project description
Pabumeasures
Installation
Prerequisites
- CMake
- Google OR-Tools (C++) – Install via a package manager (e.g.,
brew) or download a binary distribution.
Pabumeasures uses dynamic linking to reduce build times. You might need to make the OR-Tools headers and libraries discoverable at both build-time and runtime by exporting the variables as shown below.
Environment Configuration
⚠️ Note: The path to OR-Tools provided below must be the installation root containing the
libandincludesubdirectories.Linux
export CMAKE_PREFIX_PATH="/path/to/ortools" export LD_LIBRARY_PATH="$CMAKE_PREFIX_PATH/lib:$LD_LIBRARY_PATH"macOS
export CMAKE_PREFIX_PATH="/path/to/ortools" export DYLD_LIBRARY_PATH="$CMAKE_PREFIX_PATH/lib:$DYLD_LIBRARY_PATH"Windows
set CMAKE_PREFIX_PATH=C:\path\to\ortools set PATH=%CMAKE_PREFIX_PATH%\lib;%PATH%
Then, you can simply install pabumeasures from PyPI:
pip install pabumeasures
Documentation
Currently, there is no dedicated documentation. However, the interface is quite simple.
The general workflow is as follows: create or import PB instances using pabutools, then compute rule results and measures for those rules using pabumeasures.
from pabumeasures import Measure, mes_cost, mes_cost_measure
from pabutools.election import ApprovalBallot, ApprovalProfile, Instance, Project
p1 = Project("p1", 1)
p2 = Project("p2", 1)
p3 = Project("p3", 3)
b1 = ApprovalBallot([p1, p2])
b2 = ApprovalBallot([p1, p2, p3])
b3 = ApprovalBallot([p3])
instance = Instance([p1, p2, p3], budget_limit=3)
profile = ApprovalProfile([b1, b2, b3])
mes_cost(instance, profile) # returns [p1, p2]
mes_cost_measure(instance, profile, p3, Measure.ADD_APPROVAL_OPTIMIST) # returns 1
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
File details
Details for the file pabumeasures-0.2.1.tar.gz.
File metadata
- Download URL: pabumeasures-0.2.1.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd9b489a1d1e46fec83bae8fcb38afe78b826c07f872a8fc7f2a1f0d41368b7c
|
|
| MD5 |
f75fe5b4747892fef5244597936c9904
|
|
| BLAKE2b-256 |
998d17c43437c74ef322c5faeef7fd67f8a403cdda25e8bd48ca806485007f2a
|
Provenance
The following attestation bundles were made for pabumeasures-0.2.1.tar.gz:
Publisher:
release.yml on mdbrnowski/pabumeasures
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pabumeasures-0.2.1.tar.gz -
Subject digest:
dd9b489a1d1e46fec83bae8fcb38afe78b826c07f872a8fc7f2a1f0d41368b7c - Sigstore transparency entry: 849981766
- Sigstore integration time:
-
Permalink:
mdbrnowski/pabumeasures@0f9ea267ea056ff72f94d2dbb29b6c09eb6e7c28 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/mdbrnowski
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0f9ea267ea056ff72f94d2dbb29b6c09eb6e7c28 -
Trigger Event:
push
-
Statement type: