Skip to content

Commit

Permalink
fix: fix virtual stop selection if MAX_STOPS_PER_TRIP is exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
hbruch committed Mar 21, 2024
1 parent 036fd0c commit f5642cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion amarillo/services/trips.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def enhance_carpool(self, carpool):
if len(virtual_stops) > MAX_STOPS_PER_TRIP:
# in case we found more than MAX_STOPS_PER_TRIP, we retain first and last
# half of MAX_STOPS_PER_TRIP
virtual_stops = virtual_stops.iloc[np.r_[0:int(MAX_STOPS_PER_TRIP/2), int(MAX_STOPS_PER_TRIP/2):]]
virtual_stops = virtual_stops.iloc[np.r_[0:int(MAX_STOPS_PER_TRIP/2), -int(MAX_STOPS_PER_TRIP/2):0]]

trip_id = f"{carpool.agency}:{carpool.id}"
stop_times = self._stops_and_stop_times(carpool.departureTime, trip_id, virtual_stops)
Expand Down

0 comments on commit f5642cd

Please sign in to comment.