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
switzerland: add rules for all cantons #497
Conversation
nice try, but your tests are failing apparently ;o) |
@brutasse do you need help to fix this branch? |
@brunobord I do lack a bit of time to refactor the tests (the ones based on the base switzerland calandar are a bit too simplistic) and for proper coverage I'd need 2-3 years for all cantons… mostly mechanical, but time-consuming. Maintainers can push to my branch if they're up for it, otherwise it'll take a while :) |
Ok, I think I'll take your branch over when I can. |
@brutasse Currently working on Switzerland, based on your work... I've got a question: does that make sense to have a Switzerland calendar without it being a Canton? Would anybody use a "generic" Switzerland calendar, do you think? |
@brunobord a generic Switzeland calendar could be provided but it'd make sense for it to only contain the federal holiday, that is, 1st of august - even though 3 more days are common to all cantons. In the context of Workalendar, a user could think it'd be a good "average" Switzerland calendar so I'm not sure it would be super valuable in practice. How does it work for other federated states? |
Well, there's a test suite for the USA, because historically, there was only this one for the US. Then it expanded as tests for each State and sub-variants (counties, cities, etc). But there are a lot more Federal days in common for the USA (a bit less than 10, IIRC), so it made sense to have a "USACalendarTest" and mixins for specifics. Starting off what you've just said, I think I'll leave the |
Release 9.2.0 uploaded on PyPI. Happy upgrading! |
🎉 thanks a lot @brunobord! |
Information based on https://en.wikipedia.org/wiki/Public_holidays_in_Switzerland
For the days that are shared across multiple cantons, I built a base Switzerland calendar with opt-out and opt-in days for cantons to set.
Raising this in non-final state in case it may already be useful to others, I'll complete the checklist later on once I'm done moving to Luzern which is one of the best cantons from a public holiday PoV :)
workalendar.registry_tools.iso_register
decorator to register your new calendar using ISO codes (optional).<country>
by@pseudo
(#)". Note Please do NOT change the version number here. It's the project maintainers' duty.