Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Honor the input stop_sequence if present #521

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions transitfeed/trip.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,14 @@ def AddStopTimeObject(self, stoptime, schedule=None, problems=None):
row = cursor.fetchone()
if row[0] is None:
# This is the first stop_time of the trip
stoptime.stop_sequence = 1
if stoptime.stop_sequence is None or stoptime.stop_sequence <= 1:
stoptime.stop_sequence = 1
if new_secs == None:
problems.OtherProblem(
'No time for first StopTime of trip_id "%s"' % (self.trip_id,))
else:
stoptime.stop_sequence = row[0] + 1
if stoptime.stop_sequence is None or stoptime.stop_sequence <= (row[0] + 1):
stoptime.stop_sequence = row[0] + 1
prev_secs = max(row[1], row[2])
if new_secs != None and new_secs < prev_secs:
problems.OtherProblem(
Expand Down