Exclude indoor/virtual activities from records and power curve
This commit is contained in:
@@ -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", "")
|
||||
|
||||
Reference in New Issue
Block a user