Skip to content

Commit

Permalink
Car docs: utilize post init (commaai#30912)
Browse files Browse the repository at this point in the history
move these to earlier post_init
  • Loading branch information
sshane authored Jan 5, 2024
1 parent 397c1e3 commit 002ab56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions selfdrive/car/docs_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,13 @@ class CarInfo:
# all the parts needed for the supported car
car_parts: CarParts = field(default_factory=CarParts)

def __post_init__(self):
self.make, self.model, self.years = split_name(self.name)
self.year_list = get_year_list(self.years)

def init(self, CP: car.CarParams, all_footnotes: Dict[Enum, int]):
self.car_name = CP.carName
self.car_fingerprint = CP.carFingerprint
self.make, self.model, self.years = split_name(self.name)

# longitudinal column
op_long = "Stock"
Expand Down Expand Up @@ -309,7 +312,6 @@ def display_func(parts):
self.row[Column.STEERING_TORQUE] = Star.FULL

self.all_footnotes = all_footnotes
self.year_list = get_year_list(self.years)
self.detail_sentence = self.get_detail_sentence(CP)

return self
Expand Down

0 comments on commit 002ab56

Please sign in to comment.