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

[Data] Automatically check for CTA-observed holidays #38

Open
lauriemerrell opened this issue Oct 26, 2022 · 2 comments
Open

[Data] Automatically check for CTA-observed holidays #38

lauriemerrell opened this issue Oct 26, 2022 · 2 comments

Comments

@lauriemerrell
Copy link
Member

Spinout from: #37 (comment)

In compare_scheduled_and_rt.py we have a hard-coded list of holidays in a few places (ex: https://github.com/chihacknight/chn-ghost-buses/blob/main/data_analysis/compare_scheduled_and_rt.py#L99) and ideally that would be handled more automatically.

There is a holidays library in Python: https://github.com/dr-prodigy/python-holidays, which could help us. The thing is that we do not want to check for generic US (or even Chicago / Cook County) holidays, we only want to check for the specific holidays on which the CTA runs Sunday Service.

At time of posting, that is:

Our services operate on a Sunday schedule on New Year’s Day, Memorial Day, July 4th (Independence Day), Labor Day, Thanksgiving Day and Christmas Day.

@adrianleh
Copy link

adrianleh commented Nov 21, 2022

Unfortunately, I was unable to set up your project to run locally due to the AWS usage but I wrote up a little script that can parse the holidays out of the CTA site with the holidays package you suggested. This currently assumes that holidays are correctly named but seems to do the job right now. One could also add some word likeness checking but that doesn't seem necessary as is. Let me know if this is of help!

https://gist.github.com/adrianleh/a5c532fd693cdf19791f5a0382405e6f

@lauriemerrell
Copy link
Member Author

Thank you @adrianleh! We are on a bit of a hiatus this week for the holiday but I will take a look soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants