-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set pickup/drop_off _type on in-seat transfers #21
Conversation
If a transfer is in_seat, passengers should be able to embark at the last stop of the from_trip of the continuation, and disembark at the first stop of the to_trip of the continuation. Update the stop_times to reflect this. Update a simple test case to ensure that this transformation is applied.
to_trip_ids_to_set.add(to_trip_id) | ||
|
||
for trip_id in from_trip_ids_to_set: | ||
gtfs.stop_times.get(trip_id)[-1].pickup_type = PickupType.REGULARLY_SCHEDULED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary to use a set to collect trip_ids
. You can directly manipulate gtfs.stop_times[from_trip_id]
or to_trip_id
in the innermost loop.
Regardless, .get(trip_id)
should be replaced with [trip_id]
this is because .get returns None for unset keys, and will then lead to an exception when you try to operate on it. The brackets will immediately raise an exception indicating that trip_id wasn't found, which is actually the underlying issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
…ectly assigned in split-trip cases
from_trip_ids_to_set = set() | ||
to_trip_ids_to_set = set() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These variables have now become unused,
if not (from_trip_id and to_trip_id): | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not (from_trip_id and to_trip_id): | |
continue | |
if not (from_trip_id and to_trip_id): | |
continue | |
I'm not a stickler for it but I usually leave a blank line between different if blocks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution to open source.
If a transfer is in_seat, passengers should be able to embark at the last stop of the from_trip of the continuation, and disembark at the first stop of the to_trip of the continuation. Update the stop_times to reflect this.
Update a simple test case to ensure that this transformation is applied.