Skip to main content

PySATS

This is a bridge to use some features of SATS in a Python project.

Requirements

  • Python: 3.8+ (required for guaranteeing insertion order in dicts)
  • Pyjnius 1.3.0

Set up

  1. Create a Python environment that satisfied above requirements. To install Pyjnius, follow the steps in https://pyjnius.readthedocs.io/en/stable/installation.html#.
  2. Download the latest SATS JAR from https://github.com/spectrumauctions/sats/releases/
  3. Place the SATS JAR together with the cplex.jar (which can be found in the CPLEX installation's bin folder) together in some directory on your machine, and set the PYJNIUS_CLASSPATH environment variable to the absolute path of this directory.

Usage

After having set up the environment according the the previous section, install the package

$ pip install pysats
...

Use it in your project as follows. Have a look at the test/ directory for more examples.

from pysats import PySats

gsvm = PySats.getInstance().create_gsvm()
for bidder_id in gsvm.get_bidder_ids():
    goods_of_interest = gsvm.get_goods_of_interest(bidder_id)
    print(f'Bidder_{bidder_id}: {goods_of_interest}')

Verify installation

The best way to verify installation, and check if everything is wired up correctly, is to check out the project and to run the tests:

$ python -m unittest
...

Alternative to set up locally: Poetry

You can use Poetry to set up and test pysats locally. Install it as described in https://python-poetry.org/docs/#installation, and then run:

$ poetry install
...

This will install all dependencies automatically. To test the setup, run:

$ poetry run python -m unittest
...

Metadata

Release files for pysats 0.2.2

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

Source distribution (sdist)

Source distribution for pysats 0.2.2
File Size Uploaded
pysats-0.2.2.tar.gz 19.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pysats 0.2.2
File Interpreter ABI Platform
pysats-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 41.9 kB

Release files / pysats-0.2.2.tar.gz

Download URL pysats-0.2.2.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7a52724b0f17198dac96ac91a159c0a5d4c4e94f4716e825c86c336c8acfc7db
BLAKE2b-256 checksum
How to use checksums
2c93f77a3a38d11fce84382a7baaf762babc154d3de5ddfcb8f28c1f660cf97c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.1 Linux/5.15.90.1-microsoft-standard-WSL2

Release files / pysats-0.2.2-py3-none-any.whl

Download URL pysats-0.2.2-py3-none-any.whl
Size 22.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca8c24fb1212b69c55ab24564a4075da34134f7ff5bff892166ab57acab05950
BLAKE2b-256 checksum
How to use checksums
caff0fb0ba04b65e20015dfaa5ec3c3c323b30ee151a7a16379b4298128c56cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.1 Linux/5.15.90.1-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

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