From 26bdb4c61c9c1588103a7ae9e11684d67ce669bf Mon Sep 17 00:00:00 2001 From: Sven Geboers Date: Wed, 1 Apr 2026 01:40:40 +0200 Subject: [PATCH] refactor(trajectory): fix code quality issues in centroid diagnostics --- explorer_helpers.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/explorer_helpers.py b/explorer_helpers.py index 1abb9ea..6d3e3ea 100644 --- a/explorer_helpers.py +++ b/explorer_helpers.py @@ -254,17 +254,18 @@ def compute_party_centroids( - party_centroids: mapping party -> list of (x,y) tuples of length len(windows). Entries without MPs are (np.nan, np.nan). - metadata: dict with keys 'per_party_counts', 'total_windows', 'parties', - 'input_windows', 'input_party_map_entries', 'windows_processed', - 'parties_with_positions', 'parties_all_nan', 'name_mismatch_samples' + 'windows_with_data_count', 'input_party_map_entries', 'windows_processed', + 'parties_with_positions', 'parties_all_nan' """ # Initialize diagnostics metadata metadata = { - "input_windows": len(positions_by_window) if positions_by_window else 0, + "windows_with_data_count": len(positions_by_window) + if positions_by_window + else 0, "input_party_map_entries": len(party_map) if party_map else 0, "windows_processed": 0, "parties_with_positions": set(), "parties_all_nan": [], - "name_mismatch_samples": [], "per_party_counts": {}, "total_windows": len(windows), "parties": [],