Standardize powertrain type classification #1478
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wanted to add this so I could query powertrain type easier for opendbc-site
Problem
Currently I could parse the
name
which includes the make, model, and model years to see if hybrid, PHEV, or electric is in it or I could check if the certain car make, has ahybrid/EV
type flagProposed Solution
I am breaking it up into 3 PRs
Current PR:
PowertrainType = PowertrainType.ICE
for backward compatibility2nd PR: Added PowertrainType to individual cars #1484
PowertrainType
for all vehicle definitions invalues.py
3rd PR: Powertrain name formatter for all car makes #1502
values.py
opendbc/car/__init__.py
where if a car is a certainPowertrainType
then add specified string(EV, Hyrbid, PHEV) to end ofname
. This is similar to what/car/ford/values.py
line 83 does, which I think would be beneficial for all car makes to use versus every car make with their own slightly different solution of accomplishing this