Skip to content

Commit

Permalink
Fix SPCH-13 report generation
Browse files Browse the repository at this point in the history
Close #161
  • Loading branch information
marioba committed Sep 17, 2021
1 parent 7406efc commit 02f8cc9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions comptages/report/report_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,19 @@ def _translate_class_hour(self, count_data, hour):
new_hour[7] = hour[8] + hour[9] + hour[10] + hour[13] + hour[14]
return new_hour

if count_data.attributes['class'] == 'SPCH-13':
new_hour = [0] * 8

new_hour[0] = hour[0]
new_hour[1] = hour[1]
new_hour[2] = hour[2] + hour[3]
new_hour[3] = hour[4] + hour[5] + hour[6]
new_hour[4] = hour[7]
new_hour[5] = hour[8]
new_hour[6] = hour[10] + hour[11]
new_hour[7] = hour[9] + hour[12] + hour[13]
return new_hour

return hour

def _translate_class_name(self, name):
Expand All @@ -316,3 +329,6 @@ def _translate_class_name(self, name):

if name is None:
return 'Volume'

if name == 'SPCH-13':
return 'SWISS7'

0 comments on commit 02f8cc9

Please sign in to comment.