parent
efae1b9b14
commit
17eca6a95a
3 changed files with 9 additions and 0 deletions
|
|
@ -388,6 +388,11 @@ def calculate_yearly_stats(trips: list[Trip]) -> dict[int, StrDict]:
|
|||
dist = trip.total_distance()
|
||||
yearly_stats[year].setdefault("count", 0)
|
||||
yearly_stats[year]["count"] += 1
|
||||
|
||||
for c in trip.conferences:
|
||||
yearly_stats[c["start"].year].setdefault("conferences", 0)
|
||||
yearly_stats[c["start"].year]["conferences"] += 1
|
||||
|
||||
if dist:
|
||||
yearly_stats[year]["total_distance"] = (
|
||||
yearly_stats[year].get("total_distance", 0) + trip.total_distance()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue