transitmatters / mbta-performance

For processing performance data for the data dashboard
MIT License
1 stars 1 forks source link

Ignore phantom starting departures for trips #16

Closed hamima-halim closed 4 months ago

hamima-halim commented 5 months ago

For certain routes, the first "event" of the trip is a departure from a stop with a stop_id=None. Wicked spooky! Here's an example of a Green line train departing from who-knows-where before arriving to Riverside:

image

We want to ensure that the first event of any given trip is an ARRIVAL into a sensible stop (like Wonderland on the Blue.) It's pretty important because these are the first/last stops of their respective lines, and this can really screw over the route_starts calculations in this line https://github.com/transitmatters/mbta-performance/blob/a03170700e41d55b7e43d771b54787249f7c46b5/mbta-performance/chalicelib/lamp/ingest.py#L170

hamima-halim commented 4 months ago

17 was able to fix this particular issue and we are now returning sane behavior on the Blue, Orange, and most Green lines (besides the D). We might need to try a more subtle trick later if we want to start picking up/intuiting stop_id's for Null events, and this can benefit gobble as well.