Skip to main content

League ranking for arbitrary numbers of competitors.

Project description

Build Status

Given a collection of entrants and their scores, sort them and return their ranked points.

The mechanism used to allocate the ranked points is a generalised form of that used for the Student Robotics league points (quote from the SR rulebook):

The team with the most game points will be awarded 8 points towards the competition league. The team with the second most will be awarded 6. The team with the third most will be awarded 4 points, and the team with the fewest game points will be awarded 2 points. Teams whose robot was not entered into the round, or who were disqualified from the round, will be awarded no points.

Tied robots will be awarded the average of the points that their combined positions would be awarded. Thus, three robots tied for first place would receive 6 points each (since this is (8+6+4)/3).

The ranker supports an arbitrary number of entrants and zones (as long as there are fewer entrants than zones) and will return points which follow the pattern described above.

The points for the winning team will be 2 × the number of zones, points for subsequent places reduce by 2 points per place. Ties are resolved as described and as a result of the points per place reducing by two, the points for any entrant will always be an integer.

It supports Python 3.7+.

Tests

Tests can be run for the current interpreter by running ./run-tests or for all supported available interpreters by running tox.

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

league-ranker-1.0.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

league_ranker-1.0.1-py2.py3-none-any.whl (6.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file league-ranker-1.0.1.tar.gz.

File metadata

  • Download URL: league-ranker-1.0.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for league-ranker-1.0.1.tar.gz
Algorithm Hash digest
SHA256 51b848fb6c3cc76143d21ae213c32f6a5ff63e62b797372bdff919fd53ad02fc
MD5 95e6905ef55b5401a5594701522cf817
BLAKE2b-256 069d43f356bccbc2b20a6548b7b99d6ca878dc27fd065f2ad65513411199f96e

See more details on using hashes here.

Provenance

File details

Details for the file league_ranker-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: league_ranker-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for league_ranker-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5af1bc7018c3043780aef0d581a2838f7e4d6e104b92dae772638d4b0ecd9cbb
MD5 c5f5dc957619aafe09bfae630400f3e6
BLAKE2b-256 f6c0bdf588577cc309183dc78b109493a3066b4af74d52d7e95af7a657eadfca

See more details on using hashes here.

Provenance

Supported by

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