Skip to content

Holidays aren't handled correctly #6

@dwfreed

Description

@dwfreed

The current methods for looking up trains do not prefer trains whose calendar starts today, resulting in holidays getting incorrect trains. The new schedule has a holiday on Washington's Birthday, February 16, 2015. If you set your date to this, the trains you get are the regular weekday trains, since the trains for the holiday are at the end of the trips list.

I think the best way to fix this would be to do a search through the calendars (since that list is much much shorter than the trips list), looking for the calendar whose start date is closest to the current date. Then use that calendar when searching for trains (maybe have a trips file indexed by calendar, and then use that subset of trips in place of the full trips list? could probably then dump the full list, so your resource usage won't increase noticeably. Side benefit of reducing runtime memory usage, since you no longer need the full trips list in memory)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions