Skip to content
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

Make service level calculations robust to shuttling #12

Open
idreyn opened this issue Apr 1, 2022 · 0 comments
Open

Make service level calculations robust to shuttling #12

idreyn opened this issue Apr 1, 2022 · 0 comments
Labels

Comments

@idreyn
Copy link
Collaborator

idreyn commented Apr 1, 2022

When the T shuttles a middle segment of a line, like when the GL was recently shuttled from Government Center to North Station, it creates twice as many Trip entries in our code for that line — intuitively, because riding the entire line means you have to take two trains. This makes it look like e.g. the Red Line runs 24 trains per hour instead of 12.

We need a way to detect and mitigate this so we can run make update-data while the T is shuttling.

Here be dragons. @mathcolo and I have taken a few different approaches to this, and not cracked it so far. This PR has a promising approach, but it also caused us to erroneously halve computed service levels on some lines. Another, possibly more generalizable approach would be to augment each Trip object with the total number of stops that it serves, and count fractions of a trip on this basis. This would require modifying the model here:

...which gets pickled into a binary file as a reduced representation of a GTFS bundle's trips, because a GTFS bundle takes a long time to load and parse and we don't want to do that every time we run the code.

In general please familiarize yourself with the GTFS spec and the MBTA's extensions to the spec, in particular lines.txt, before starting with this task.

@idreyn idreyn added the python label Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant