# haarshadd/superr-hackathon architecture

> Architecture diagram of the GitHub repository haarshadd/superr-hackathon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/haarshadd/superr-hackathon
- Repository: https://github.com/haarshadd/superr-hackathon

## Overview

RR auction scout is an offline cricket-data analysis tool that ranks Rajasthan Royals auction targets. Its main workflow loads ball-by-ball and reference data, profiles players, compares candidates with RR’s curated core, identifies squad-skill gaps and rival demand, then writes scouting shortlists and supporting reports. A separate pressure-rating workflow reconstructs match states, estimates win probability and opposition strength, scores high-pressure performance, and reports auction availability. The excerpts show both orchestration scripts and key algorithms; some documented stages are unsampled, so links to them are limited to documented orchestration.

Main entry points: [`run_pipeline.py`](https://github.com/haarshadd/superr-hackathon/blob/main/run_pipeline.py) (Scouting run), [`run_pressure.py`](https://github.com/haarshadd/superr-hackathon/blob/main/run_pressure.py) (Pressure run), [`rr_scout/similarity.py`](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/similarity.py) (Replacement ranking), [`rr_scout/features.py`](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/features.py) (Style and value profiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scouting["Auction scouting"]
  node_scout_run["Scouting run<br/>[run_pipeline.py]"]
  node_config["Rules and thresholds<br/>[config.py]"]
  node_ball_data["Ball preparation<br/>[data.py]"]
  node_player_meta["Player eligibility<br/>[players.py]"]
  node_profiles["Style and value profiles<br/>[features.py]"]
  node_similarity["Replacement ranking<br/>[similarity.py]"]
  node_core_gaps["Core gap analysis<br/>[gaps.py]"]
  node_rival_demand["Rival demand<br/>[contention.py]"]
end

subgraph group_pressure["Pressure ratings"]
  node_pressure_run["Pressure run<br/>[run_pressure.py]"]
  node_opposition["Opposition strength<br/>[opposition.py]"]
  node_winprob["Win probability<br/>[win_prob.py]"]
  node_pressure_calc["Ball pressure<br/>[pressure.py]"]
  node_ratings["Player ratings<br/>[ratings.py]"]
  node_availability["Auction availability<br/>[availability.py]"]
end

subgraph group_inputs["Inputs"]
  node_raw_data["Cricket data pack<br/>[ball_by_ball.csv]"]
  node_core_list["RR core list<br/>[cores.csv]"]
  node_watchlist["Watchlist<br/>[watchlist.csv]"]
end

subgraph group_results["Results"]
  node_scout_outputs["Scouting outputs<br/>[shortlist_10.csv]"]
  node_pressure_outputs["Pressure outputs<br/>[ratings_bat.csv]"]
end

node_analyst(("RR analyst"))

node_analyst -->|"runs"| node_scout_run
node_analyst -->|"runs"| node_pressure_run
node_scout_run -->|"loads and prepares"| node_ball_data
node_scout_run -->|"builds profiles"| node_profiles
node_scout_run -->|"segments players"| node_player_meta
node_scout_run -->|"ranks replacements"| node_similarity
node_scout_run -->|"scores gaps"| node_core_gaps
node_scout_run -->|"scores demand"| node_rival_demand
node_scout_run -->|"reads"| node_core_list
node_scout_run -->|"profiles"| node_watchlist
node_scout_run -->|"writes"| node_scout_outputs
node_profiles -->|"scores profiles"| node_similarity
node_core_gaps -->|"returns gap candidates"| node_scout_run
node_rival_demand -->|"uses similarity"| node_similarity
node_pressure_run -->|"prepares match state"| node_ball_data
node_pressure_run -->|"attaches strength"| node_opposition
node_pressure_run -->|"fits model"| node_winprob
node_pressure_run -->|"computes pressure"| node_pressure_calc
node_pressure_run -->|"rates players"| node_ratings
node_pressure_run -->|"filters auction pool"| node_availability
node_pressure_run -->|"checks retentions"| node_core_list
node_pressure_calc -->|"predicts states"| node_winprob
node_pressure_run -->|"writes ratings"| node_pressure_outputs
node_scout_run -->|"uses rules"| node_config
node_pressure_run -->|"uses thresholds"| node_config

click node_scout_run "https://github.com/haarshadd/superr-hackathon/blob/main/run_pipeline.py"
click node_pressure_run "https://github.com/haarshadd/superr-hackathon/blob/main/run_pressure.py"
click node_config "https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/config.py"
click node_ball_data "https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/data.py"
click node_player_meta "https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/players.py"
click node_profiles "https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/features.py"
click node_similarity "https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/similarity.py"
click node_core_gaps "https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/gaps.py"
click node_rival_demand "https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/contention.py"
click node_opposition "https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/opposition.py"
click node_winprob "https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/win_prob.py"
click node_pressure_calc "https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/pressure.py"
click node_ratings "https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/ratings.py"
click node_availability "https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/availability.py"
click node_raw_data "https://github.com/haarshadd/superr-hackathon/blob/main/data/ball_by_ball.csv"
click node_core_list "https://github.com/haarshadd/superr-hackathon/blob/main/cores.csv"
click node_watchlist "https://github.com/haarshadd/superr-hackathon/blob/main/watchlist.csv"
click node_scout_outputs "https://github.com/haarshadd/superr-hackathon/blob/main/outputs/shortlist_10.csv"
click node_pressure_outputs "https://github.com/haarshadd/superr-hackathon/blob/main/outputs/pressure/ratings_bat.csv"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_scout_run,node_config,node_ball_data,node_player_meta,node_profiles,node_similarity,node_core_gaps,node_rival_demand toneBlue
class node_pressure_run,node_opposition,node_winprob,node_pressure_calc,node_ratings,node_availability toneAmber
class node_raw_data,node_core_list,node_watchlist toneMint
class node_scout_outputs,node_pressure_outputs toneRose
class node_analyst toneIndigo
```

## Components

### Auction scouting

- [Scouting run](https://github.com/haarshadd/superr-hackathon/blob/main/run_pipeline.py): `run_pipeline.py`
- [Rules and thresholds](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/config.py): `rr_scout/config.py`
- [Ball preparation](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/data.py): `rr_scout/data.py`
- [Player eligibility](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/players.py): `rr_scout/players.py`
- [Style and value profiles](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/features.py): `rr_scout/features.py`
- [Replacement ranking](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/similarity.py): `rr_scout/similarity.py`
- [Core gap analysis](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/gaps.py): `rr_scout/gaps.py`
- [Rival demand](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/contention.py): `rr_scout/contention.py`

### Pressure ratings

- [Pressure run](https://github.com/haarshadd/superr-hackathon/blob/main/run_pressure.py): `run_pressure.py`
- [Opposition strength](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/opposition.py): `rr_scout/opposition.py`
- [Win probability](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/win_prob.py): `rr_scout/win_prob.py`
- [Ball pressure](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/pressure.py): `rr_scout/pressure.py`
- [Player ratings](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/ratings.py): `rr_scout/ratings.py`
- [Auction availability](https://github.com/haarshadd/superr-hackathon/blob/main/rr_scout/availability.py): `rr_scout/availability.py`

### Inputs

- [Cricket data pack](https://github.com/haarshadd/superr-hackathon/blob/main/data/ball_by_ball.csv): `data/ball_by_ball.csv`
- [RR core list](https://github.com/haarshadd/superr-hackathon/blob/main/cores.csv): `cores.csv`
- [Watchlist](https://github.com/haarshadd/superr-hackathon/blob/main/watchlist.csv): `watchlist.csv`

### Results

- [Scouting outputs](https://github.com/haarshadd/superr-hackathon/blob/main/outputs/shortlist_10.csv): `outputs/shortlist_10.csv`
- [Pressure outputs](https://github.com/haarshadd/superr-hackathon/blob/main/outputs/pressure/ratings_bat.csv): `outputs/pressure/ratings_bat.csv`

### Other components

- **RR analyst**

## Connections

- RR analyst → Scouting run: runs (evidence: `README.md`)
- RR analyst → Pressure run: runs (evidence: `run_pressure.py`)
- Scouting run → Ball preparation: loads and prepares (evidence: `run_pipeline.py`)
- Scouting run → Style and value profiles: builds profiles (evidence: `run_pipeline.py`)
- Scouting run → Player eligibility: segments players (evidence: `README.md`)
- Scouting run → Replacement ranking: ranks replacements (evidence: `run_pipeline.py`)
- Scouting run → Core gap analysis: scores gaps (evidence: `README.md`)
- Scouting run → Rival demand: scores demand (evidence: `run_pipeline.py`)
- Scouting run → RR core list: reads (evidence: `README.md`)
- Scouting run → Watchlist: profiles (evidence: `README.md`)
- Scouting run → Scouting outputs: writes (evidence: `run_pipeline.py`)
- Style and value profiles → Replacement ranking: scores profiles (evidence: `README.md`)
- Core gap analysis → Scouting run: returns gap candidates (evidence: `README.md`)
- Rival demand → Replacement ranking: uses similarity (evidence: `rr_scout/contention.py`)
- Pressure run → Ball preparation: prepares match state (evidence: `run_pressure.py`)
- Pressure run → Opposition strength: attaches strength (evidence: `run_pressure.py`)
- Pressure run → Win probability: fits model (evidence: `run_pressure.py`)
- Pressure run → Ball pressure: computes pressure (evidence: `run_pressure.py`)
- Pressure run → Player ratings: rates players (evidence: `run_pressure.py`)
- Pressure run → Auction availability: filters auction pool (evidence: `run_pressure.py`)
- Pressure run → RR core list: checks retentions
- Ball pressure → Win probability: predicts states (evidence: `rr_scout/pressure.py`)
- Pressure run → Pressure outputs: writes ratings (evidence: `run_pressure.py`)
- Scouting run → Rules and thresholds: uses rules (evidence: `run_pipeline.py`)
- Pressure run → Rules and thresholds: uses thresholds (evidence: `run_pressure.py`)
