From 9d44f790b3fdbdc2c7742d1e4fc603bae0364bda Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 1 Apr 2022 15:43:54 -0700 Subject: [PATCH] CARS.md: sort cars in lowercase (#24086) * sort cars in lowercase * nicer name * skoda deserves better * lock --- Pipfile | 1 + Pipfile.lock | 50 ++++++++++++++++++++++++++++++++++++++----- docs/CARS.md | 28 ++++++++++++------------ selfdrive/car/docs.py | 3 ++- 4 files changed, 62 insertions(+), 20 deletions(-) diff --git a/Pipfile b/Pipfile index bed4cdab73..0b035e3778 100644 --- a/Pipfile +++ b/Pipfile @@ -16,6 +16,7 @@ markdown-it-py = "*" matplotlib = "*" mypy = "*" myst-parser = "*" +natsort = "*" numpy = "*" opencv-python-headless = "*" parameterized = "*" diff --git a/Pipfile.lock b/Pipfile.lock index fdad4cb64d..7f59edcaf8 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "40d9fa44e5b593786d40aa8a0276a1fbdfac46fbb78734687e6ef5b870813ed8" + "sha256": "8655469995735262ee407a18208428533c1f08f0b09e1e93215abb488571976e" }, "pipfile-spec": 6, "requires": { @@ -234,6 +234,14 @@ "index": "pypi", "version": "==0.29.28" }, + "dill": { + "hashes": [ + "sha256:7e40e4a70304fd9ceab3535d36e58791d9c4a776b38ec7f7ec9afc8d3dca4d4f", + "sha256:9f9734205146b2b353ab3fec9af0070237b6ddae78452af83d2fca84d739e675" + ], + "markers": "python_version >= '2.7' and python_version != '3.0'", + "version": "==0.3.4" + }, "flake8": { "hashes": [ "sha256:479b1304f72536a55948cb40a32dce8bb0ffe3501e26eaf292c7e60eb5e0428d", @@ -288,6 +296,14 @@ "markers": "python_version >= '3'", "version": "==3.3" }, + "importlib-metadata": { + "hashes": [ + "sha256:1208431ca90a8cca1a6b8af391bb53c1a2db74e5d1cef6ddced95d4b2062edc6", + "sha256:ea4c597ebf37142f827b8f39299579e31685c31d3a438b59f469406afd0f2539" + ], + "markers": "python_version < '3.10'", + "version": "==4.11.3" + }, "isort": { "hashes": [ "sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7", @@ -953,6 +969,14 @@ "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==0.10.2" }, + "tomli": { + "hashes": [ + "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" + ], + "markers": "python_version < '3.11'", + "version": "==2.0.1" + }, "tqdm": { "hashes": [ "sha256:8dd278a422499cd6b727e6ae4061c40b48fce8b76d1ccbf5d34fca9b7f925b0c", @@ -1056,6 +1080,14 @@ ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "==1.13.3" + }, + "zipp": { + "hashes": [ + "sha256:9f50f446828eb9d45b267433fd3e9da8d801f614129124863f9c51ebceafb87d", + "sha256:b47250dd24f92b7dd6a0a8fc5244da14608f3ca90a5efcd37a3b1642fac9a375" + ], + "markers": "python_version >= '3.7'", + "version": "==3.7.0" } }, "develop": { @@ -1384,11 +1416,11 @@ }, "importlib-metadata": { "hashes": [ - "sha256:175f4ee440a0317f6e8d81b7f8d4869f93316170a65ad2b007d2929186c8052c", - "sha256:e0bc84ff355328a4adfc5240c4f211e0ab386f80aa640d1b11f0618a1d282094" + "sha256:1208431ca90a8cca1a6b8af391bb53c1a2db74e5d1cef6ddced95d4b2062edc6", + "sha256:ea4c597ebf37142f827b8f39299579e31685c31d3a438b59f469406afd0f2539" ], "markers": "python_version < '3.10'", - "version": "==4.11.1" + "version": "==4.11.3" }, "iniconfig": { "hashes": [ @@ -1622,6 +1654,14 @@ "index": "pypi", "version": "==0.17.0" }, + "natsort": { + "hashes": [ + "sha256:c7c1f3f27c375719a4dfcab353909fe39f26c2032a062a8c80cc844eaaca0445", + "sha256:f59988d2f24e77b6b56f8a8f882d5df6b3b637e09e075abc67b486d59fba1a4b" + ], + "index": "pypi", + "version": "==8.1.0" + }, "nodeenv": { "hashes": [ "sha256:3ef13ff90291ba2a4a7a4ff9a979b63ffdd00a464dbe04acf0ea6471517a4c2b", @@ -2133,7 +2173,7 @@ "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" ], - "markers": "python_version >= '3.7'", + "markers": "python_version < '3.11'", "version": "==2.0.1" }, "typing-extensions": { diff --git a/docs/CARS.md b/docs/CARS.md index 024158ae25..5b77b1275e 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -109,6 +109,13 @@ How We Rate The Cars |Mazda|CX-5 2022|All|||||| |SEAT|Ateca 2018|Driver Assistance|||||| |SEAT|Leon 2014-20|Driver Assistance|||||| +|Škoda|Kamiq 2021[6](#footnotes)|Driver Assistance|||||| +|Škoda|Karoq 2019|Driver Assistance|||||| +|Škoda|Kodiaq 2018-19|Driver Assistance|||||| +|Škoda|Octavia 2015, 2018-19|Driver Assistance|||||| +|Škoda|Octavia RS 2016|Driver Assistance|||||| +|Škoda|Scala 2020|Driver Assistance|||||| +|Škoda|Superb 2015-18|Driver Assistance|||||| |Toyota|Avalon 2019-21|TSS-P|[3](#footnotes)||||| |Toyota|Avalon Hybrid 2019-21|TSS-P|[3](#footnotes)||||| |Toyota|C-HR 2017-21|All|||||| @@ -121,13 +128,14 @@ How We Rate The Cars |Toyota|Sienna 2018-20|All|[3](#footnotes)||||| |Volkswagen|Arteon 2018, 2021[8](#footnotes)|Driver Assistance|||||| |Volkswagen|Atlas 2018-19, 2022[8](#footnotes)|Driver Assistance|||||| +|Volkswagen|e-Golf 2014, 2019-20|Driver Assistance|||||| |Volkswagen|Golf 2015-20|Driver Assistance|||||| |Volkswagen|Golf Alltrack 2017-18|Driver Assistance|||||| |Volkswagen|Golf GTE 2016|Driver Assistance|||||| |Volkswagen|Golf GTI 2018-21|Driver Assistance|||||| |Volkswagen|Golf R 2016-19|Driver Assistance|||||| -|Volkswagen|Golf SportWagen 2015|Driver Assistance|||||| |Volkswagen|Golf SportsVan 2016|Driver Assistance|||||| +|Volkswagen|Golf SportWagen 2015|Driver Assistance|||||| |Volkswagen|Jetta 2018-21|Driver Assistance|||||| |Volkswagen|Jetta GLI 2021|Driver Assistance|||||| |Volkswagen|Passat 2016-18[7](#footnotes)|Driver Assistance|||||| @@ -137,14 +145,6 @@ How We Rate The Cars |Volkswagen|Taos 2022[8](#footnotes)|Driver Assistance|||||| |Volkswagen|Tiguan 2020-22[8](#footnotes)|Driver Assistance|||||| |Volkswagen|Touran 2017|Driver Assistance|||||| -|Volkswagen|e-Golf 2014, 2019-20|Driver Assistance|||||| -|Škoda|Kamiq 2021[6](#footnotes)|Driver Assistance|||||| -|Škoda|Karoq 2019|Driver Assistance|||||| -|Škoda|Kodiaq 2018-19|Driver Assistance|||||| -|Škoda|Octavia 2015, 2018-19|Driver Assistance|||||| -|Škoda|Octavia RS 2016|Driver Assistance|||||| -|Škoda|Scala 2020|Driver Assistance|||||| -|Škoda|Superb 2015-18|Driver Assistance|||||| ## Bronze Cars @@ -159,16 +159,17 @@ How We Rate The Cars |Chrysler|Pacifica 2020|Adaptive Cruise|||||| |Chrysler|Pacifica Hybrid 2017-18|Adaptive Cruise|||||| |Chrysler|Pacifica Hybrid 2019-21|Adaptive Cruise|||||| -|GMC|Acadia 2018[1](#footnotes)|Adaptive Cruise|||||| |Genesis|G90 2018|All|||||| +|GMC|Acadia 2018[1](#footnotes)|Adaptive Cruise|||||| |Honda|Accord 2018-21|All|||||| |Honda|Accord Hybrid 2018-21|All|||||| -|Honda|CR-V 2015-16|Touring|||||| -|Honda|CR-V 2017-21|Honda Sensing|||||| -|Honda|CR-V Hybrid 2017-19|Honda Sensing|||||| |Honda|Civic 2016-18|Honda Sensing|||||| |Honda|Civic 2019-20|All|||[2](#footnotes)||| |Honda|Civic Hatchback 2017-21|Honda Sensing|||||| +|Honda|CR-V 2015-16|Touring|||||| +|Honda|CR-V 2017-21|Honda Sensing|||||| +|Honda|CR-V Hybrid 2017-19|Honda Sensing|||||| +|Honda|e 2020|All|||||| |Honda|Fit 2018-19|Honda Sensing|||||| |Honda|Freed 2020|Honda Sensing|||||| |Honda|HR-V 2019-20|Honda Sensing|||||| @@ -178,7 +179,6 @@ How We Rate The Cars |Honda|Passport 2019-21|All|||||| |Honda|Pilot 2016-21|Honda Sensing|||||| |Honda|Ridgeline 2017-21|Honda Sensing|||||| -|Honda|e 2020|All|||||| |Hyundai|Elantra 2017-19|SCC + LKAS|||||| |Hyundai|Genesis 2015-16|SCC + LKAS|||||| |Hyundai|Ioniq Electric 2019|SCC + LKAS|||||| diff --git a/selfdrive/car/docs.py b/selfdrive/car/docs.py index baa5732648..a39e8df805 100755 --- a/selfdrive/car/docs.py +++ b/selfdrive/car/docs.py @@ -3,6 +3,7 @@ import argparse import jinja2 import os from enum import Enum +from natsort import natsorted from typing import Dict, List from common.basedir import BASEDIR @@ -47,7 +48,7 @@ def get_tier_car_info() -> Dict[Tier, List[CarInfo]]: # Sort cars by make and model + year for tier, cars in tier_car_info.items(): - tier_car_info[tier] = sorted(cars, key=lambda x: x.make + x.model) + tier_car_info[tier] = natsorted(cars, key=lambda car: (car.make + car.model).lower()) return tier_car_info