diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2025-04-25 10:31:05 +0200 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2025-04-25 10:31:05 +0200 |
| commit | c23ff03ae771fec32bdad3249d45276f5fbfb6f0 (patch) | |
| tree | fb3cdf1f8d5b50f14c85edd70935e3df517d3b35 /data/download-stops.py | |
| parent | ea164bf4eb4f713f15c4aa9077d68dc5157cb99f (diff) | |
Sort stops consistently to avoid PRs where they are reordered
Diffstat (limited to 'data/download-stops.py')
| -rw-r--r-- | data/download-stops.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/data/download-stops.py b/data/download-stops.py index 002b093..0b7d77a 100644 --- a/data/download-stops.py +++ b/data/download-stops.py @@ -99,7 +99,10 @@ def main(): # Filter out hidden stops visible_stops = [stop for stop in processed_stops if not stop.get("hide")] print(f"Removed {len(processed_stops) - len(visible_stops)} hidden stops") - + + # Sort stops by ID ascending + visible_stops.sort(key=lambda x: x["stopId"]) + # Save to public directory output_file = os.path.join(script_dir, "..", "public", "stops.json") |
