Skip to main content

GNU Affero General Public License v3

Project description

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

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

pysats-0.2.1.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysats-0.2.1-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file pysats-0.2.1.tar.gz.

File metadata

  • Download URL: pysats-0.2.1.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.1 Linux/5.15.79.1-microsoft-standard-WSL2

File hashes

Hashes for pysats-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6aa8b91e6d718dc11722888b4dbcbef7276d6c623aa4b14cea8da3ba1afee4be
MD5 3712b5f0f397c471004d1806ec367ebb
BLAKE2b-256 8c1c754e6f87da2b359b89bd81815d6fbf79d8fff7eda07580be6caab511f7c6

See more details on using hashes here.

File details

Details for the file pysats-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pysats-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.1 Linux/5.15.79.1-microsoft-standard-WSL2

File hashes

Hashes for pysats-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b339380a4d1cb4fabc5ce6f12b21e78d06fc3b220aafaea6bcdcaacc5c0403f7
MD5 a21b525ae812f4346f3749c4bf34c21f
BLAKE2b-256 87e78fb39ab90cfd69f5cf41771888be38f7878ea6ea705f9fd6402774e42185

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page