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.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: league-ranker-1.0.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.17

File hashes

Hashes for league-ranker-1.0.2.tar.gz
Algorithm Hash digest
SHA256 89fbee56f5ca15ae4cbcde99848b31450c708b9872cc883bc65a2c4b9e2a6dba
MD5 449c827605bed735567700ea520c1189
BLAKE2b-256 1bc5739a8cc2cd5aa8be2f72c1ac7057e85c765a45d2bd006f5d5c8dfcf39003

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for league_ranker-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5bb75732f76b27933712795276df33f5457fa4658c7366c6e2b0895148ce15cc
MD5 e6b9679e6c8888d8b38fe84759a90fbb
BLAKE2b-256 8e30043444639241d486f406e3c4e6d28bd12998e68d1ee25a3278b57ff6f7f9

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