Local-first analytics stack for the 2025 FIRST Global Challenge Eco Equilibrium.
The tools in this repository mirror the official rulebook so that our models, reports, and forecasts stay aligned with what the field referees record.
- Scout the field – ingest FIRST Global rankings, match schedules, and match-detail breakdowns straight from results.first.global.
- Score like the refs – reproduce the Eco Equilibrium scoring model (distribution factor, protection multiplier, coop bonuses, fouls) and recompute rankings locally for validation.
- Understand trends – track alliance and team form, defensive pressure, coop success, penalty drag, and other signals that matter in match strategy.
- Forecast the bracket – run a schedule-aware Monte Carlo simulator that incorporates the published future matchups, team momentum, alliance context, and score volatility to produce rank/score distributions and per-match win odds.
All of the above is orchestrated through a suite of CLI utilities backed by Polars, DuckDB, and Matplotlib so that iterating on scenarios is quick even without cloud infrastructure.
| Path / file | Purpose |
|---|---|
fgc/ |
Python package with core scoring logic, ingestion clients, statistics, visualization helpers, and the new forecast model. |
scripts/ |
Command line tools for fetching data, aggregating warehouses, reporting rankings, team breakdowns, and running forecasts. |
data/ |
Local storage (raw/ HTML snapshots, bronze/ JSONL exports, warehouse/ parquet tables). |
figures/ |
Generated PNG dashboards (created by the CLI tools). |
tests/ |
Pytest suite that guards scoring accuracy, ingestion outcomes, and the forecast pipeline. |
codex.md |
The working playbook / design document that seeds development decisions. |
2025 FIRST Global Challenge – Eco Equilibrium Robotics Challenge Game Manual.md |
Offline copy of the official rulebook. |
All commands below assume you are at the repository root.
python3.11 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"That editable install pulls in runtime and developer tooling (Polars, DuckDB, pytest, mypy, ruff, etc.).
When you need a clean slate, remove the .venv/ directory, recreate it, and reinstall using the same three commands.
-
Fetch the latest rankings and matches
source .venv/bin/activate python scripts/fetch_results.py --since 01/11/2025 --iterations 1This stores raw HTML in
data/raw/, JSONL snapshots indata/bronze/, and parquet tables indata/warehouse/. -
Rebuild warehouse aggregates
python scripts/aggregate.py
Produces/updates
team_matches.parquet,team_aggregates.parquet,rankings_recomputed.parquet, and related derived tables. -
Check the standings quickly
python scripts/show_rankings.py --source recompute --top 15
Compares the recomputed rankings (based on the drop-lowest rule) to the published board.
-
Dive into a country’s recent form
python scripts/show_team.py GEO --last 5
-
Run an event forecast (schedule-aware Monte Carlo)
python scripts/show_team_projection.py GEO \ --simulations 15000 \ --top-thresholds 5,10,20,32,48 \ --interactiveThe script prints rank outlooks, advancement probabilities, and match-by-match win odds for the selected team, then saves a six-panel dashboard to
figures/team_<team_key>_forecast.png. It also opens the Matplotlib window for immediate inspection. F1 When--interactiveis supplied, a Plotly dashboard is exported alongside the PNG (default:figures/team_<team_key>_dashboard.html). Open the HTML in any modern browser to explore hover-tooltips, ranked scatter clouds, placement bands, and win-probability bars with animated transitions. -
Validate with the automated test suite
pytest
The tests cover the scoring engine, aggregation utilities, ingestion client, forecast model, and path configuration introduced during the repository reorganisation.
- The local rulebook (
2025 FIRST Global Challenge – Eco Equilibrium Robotics Challenge Game Manual.md) is kept alongside the code for quick reference; the latest online copy remains at docs.google.com/.... - Running the scripts will create or update parquet files inside
data/warehouse/; that directory is ignored by Git so historical runs stay local. codex.mdis the authoritative plan—use it when prioritising future work (vision/video analytics, watchdog annotations, etc.).- All contributors and users are expected to follow the guidelines in
CODE_OF_CONDUCT.md. The project is distributed under the permissive BSD 3-Clause License.