Skip to main content

Glicko-2 based rating engine for competitive hot-air balloon pilots.

Project description

balloon-ranking-glicko

A Glicko-2 based rating engine for competitive hot-air balloon pilots.

This is the public, open-source rating math behind the Global Balloon Pilot Ranking System. It is a pure-Python package with zero runtime dependencies. Given a chronological history of competition events, it produces a Glicko-2 rating, rating deviation (RD), and volatility for every pilot, plus derived values (Strength of Field, tier assignments).

Design

  • Algorithm: Glicko-2, implemented directly from Mark Glickman's specification.
  • Input signal: task finishing position, not raw points. Position is the cleaner signal of "did this pilot beat that pilot in this task".
  • Rating period: one per event. All pairwise outcomes from all of an event's tasks are pooled into a single Glicko-2 update per pilot.
  • No-result handling: no-result pilots are tied for last within the no-result group. This matches FAI scoring conventions.
  • Pure functions, zero I/O: no database, no network, no file I/O. The caller supplies events and prior ratings; the engine returns new ratings.

The engine has no opinions about storage or identity. The caller supplies events plus the rating state entering each event; the engine returns the state coming out.

Install

pip install balloon-ranking-glicko

Quick start

from datetime import date
from balloon_ranking_glicko import Event, Task, TaskResult, RatingEngine

event = Event(
    event_id="example-2026",
    event_date=date(2026, 6, 1),
    tasks=(
        Task(
            task_id="t1",
            results=(
                TaskResult(pilot_id="alice", position=1),
                TaskResult(pilot_id="bob", position=2),
                TaskResult(pilot_id="carol", position=3),
            ),
        ),
    ),
)

engine = RatingEngine()
ratings = engine.process_history([event])
for pid, r in sorted(ratings.items(), key=lambda kv: -kv[1].rating):
    print(f"{pid}: {r.rating:.1f} (RD {r.rd:.1f})")

Public API

  • Event, Task, TaskResult, PilotRating — frozen dataclasses
  • RatingEngine(tau, initial_rating, initial_rd, initial_volatility)
    • process_event(event, prior_ratings) -> dict[str, PilotRating]
    • process_history(events) -> dict[str, PilotRating]
    • process_history_with_snapshots(events) -> Iterator[(Event, dict[str, PilotRating])]
  • compute_sof(event, ratings) -> float
  • assign_tiers(ratings, cutoffs=None) -> dict[str, str]

Development

pip install -e ".[dev]"
pytest
mypy

The Glicko-2 implementation is validated against the worked example from Glickman's paper (final rating 1464.06, RD 151.52, volatility 0.05999).

License

MIT

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

balloon_ranking_glicko-0.1.1.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

balloon_ranking_glicko-0.1.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file balloon_ranking_glicko-0.1.1.tar.gz.

File metadata

  • Download URL: balloon_ranking_glicko-0.1.1.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for balloon_ranking_glicko-0.1.1.tar.gz
Algorithm Hash digest
SHA256 eed9052f93a9c43713754855009503bb80a3dfbecc14791711cf6cef423e9d39
MD5 42ba2e8273e560ca60c2178028d943f9
BLAKE2b-256 b3f00a9095e95c8bb42545906f3f59423e90f8785cf3ee9fabab2e7838fcb82a

See more details on using hashes here.

File details

Details for the file balloon_ranking_glicko-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for balloon_ranking_glicko-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67df33020d022e6da16543baaaf0fcb5e5d0cee98802200bd59aaaffecedde66
MD5 63ec770db6fa0526996a647f7a3097f3
BLAKE2b-256 142d3e144435c715e59424da4bca41d37bde48335956e01d5b231cd00af65971

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