From c837464a281ccfbfa1040bae2e6d0d48d4558d21 Mon Sep 17 00:00:00 2001 From: Davide Scaini Date: Wed, 13 May 2026 16:05:26 +0200 Subject: [PATCH] Exclude indoor/virtual activities from records and power curve --- bincio/extract/writer.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bincio/extract/writer.py b/bincio/extract/writer.py index 3111fc7..d425c78 100644 --- a/bincio/extract/writer.py +++ b/bincio/extract/writer.py @@ -277,9 +277,12 @@ def write_athlete_json(summaries: list[dict], output_dir: Path, athlete_config: best[d] = w return [[d, w] for d, w in sorted(best.items())] - all_mmps = [s["mmp"] for s in summaries if s.get("mmp")] - mmps_365 = [s["mmp"] for s in summaries if s.get("mmp") and s["started_at"] >= cutoff_365] - mmps_90 = [s["mmp"] for s in summaries if s.get("mmp") and s["started_at"] >= cutoff_90] + def _is_outdoor(s: dict) -> bool: + return s.get("sub_sport") != "indoor" + + all_mmps = [s["mmp"] for s in summaries if s.get("mmp") and _is_outdoor(s)] + mmps_365 = [s["mmp"] for s in summaries if s.get("mmp") and _is_outdoor(s) and s["started_at"] >= cutoff_365] + mmps_90 = [s["mmp"] for s in summaries if s.get("mmp") and _is_outdoor(s) and s["started_at"] >= cutoff_90] # ── Personal records aggregation ────────────────────────────────────────── # records[sport][distance_km] = {time_s, activity_id, started_at, title} @@ -290,6 +293,8 @@ def write_athlete_json(summaries: list[dict], output_dir: Path, athlete_config: best_climb: list[dict] = [] # top 10 best climbs for cycling for s in summaries: + if not _is_outdoor(s): + continue sport = s.get("sport", "other") act_id = s.get("id", "") started = s.get("started_at", "")