@@ -66,9 +66,7 @@ def convert_simulation_results(
66
66
route_begin_occupancy , route_end_occupancy = convert_route_occupancies (
67
67
simulation_result ["route_occupancies" ], projection_path_payload , departure_time
68
68
)
69
- route_aspects = project_signal_updates (
70
- simulation_result ["signal_updates" ], projection_path_payload , departure_time
71
- )
69
+ route_aspects = project_signal_updates (simulation_result ["signal_updates" ], projection_path_payload , departure_time )
72
70
73
71
speeds = [{** speed , "time" : speed ["time" ] + departure_time } for speed in simulation_result ["speeds" ]]
74
72
stops = [{** stop , "time" : stop ["time" ] + departure_time } for stop in simulation_result ["stops" ]]
@@ -161,14 +159,16 @@ def build_signal_updates(signal_updates, departure_time):
161
159
results = []
162
160
163
161
for update in signal_updates :
164
- results .append ({
165
- "signal_id" : update ["signal_id" ],
166
- "time_start" : update ["time_start" ] + departure_time ,
167
- "time_end" : update ["time_end" ] + departure_time ,
168
- "color" : update ["color" ],
169
- "blinking" : update ["blinking" ],
170
- "aspect_label" : update ["aspect_label" ]
171
- })
162
+ results .append (
163
+ {
164
+ "signal_id" : update ["signal_id" ],
165
+ "time_start" : update ["time_start" ] + departure_time ,
166
+ "time_end" : update ["time_end" ] + departure_time ,
167
+ "color" : update ["color" ],
168
+ "blinking" : update ["blinking" ],
169
+ "aspect_label" : update ["aspect_label" ],
170
+ }
171
+ )
172
172
return results
173
173
174
174
@@ -189,16 +189,18 @@ def project_signal_updates(signal_updates, projection_path_payload: PathPayload,
189
189
end_pos += track_range .length ()
190
190
191
191
for update in updates_by_route_id [route_id ]:
192
- results .append ({
193
- "signal_id" : update ["signal_id" ],
194
- "route_id" : route_id ,
195
- "time_start" : update ["time_start" ] + departure_time ,
196
- "time_end" : update ["time_end" ] + departure_time ,
197
- "position_start" : start_pos ,
198
- "position_end" : end_pos ,
199
- "color" : update ["color" ],
200
- "blinking" : update ["blinking" ]
201
- })
192
+ results .append (
193
+ {
194
+ "signal_id" : update ["signal_id" ],
195
+ "route_id" : route_id ,
196
+ "time_start" : update ["time_start" ] + departure_time ,
197
+ "time_end" : update ["time_end" ] + departure_time ,
198
+ "position_start" : start_pos ,
199
+ "position_end" : end_pos ,
200
+ "color" : update ["color" ],
201
+ "blinking" : update ["blinking" ],
202
+ }
203
+ )
202
204
start_pos = end_pos
203
205
return results
204
206
0 commit comments