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.
Release files for league-ranker 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| league-ranker-1.0.5.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| league_ranker-1.0.5-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 12.5 kB
Release files / league-ranker-1.0.5.tar.gz
| Download URL | league-ranker-1.0.5.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f05bdad57b9c848f66aebd6cb080744e0741d27845d87acd4e12518f188c821d
|
|
BLAKE2b-256 checksum How to use checksums |
eab7b268169c422f3f1c5b6c1b7df9bdb61db9cb6a8b11dcd04c46ae64bd89a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.17
|
Release files / league_ranker-1.0.5-py2.py3-none-any.whl
| Download URL | league_ranker-1.0.5-py2.py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
faaae3187ed89e99d4ed5d3945184a8fb3f86fa108df965c6d26d829cb538a03
|
|
BLAKE2b-256 checksum How to use checksums |
5c4787f934f1e8ef8932c5f0c41f7f37614bd612d5736b7fe4914eb796da940d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.17
|