-
Notifications
You must be signed in to change notification settings - Fork 482
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
Add Sri Lanka holidays #2228
base: dev
Are you sure you want to change the base?
Add Sri Lanka holidays #2228
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2228 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 196 197 +1
Lines 11852 11918 +66
Branches 1712 1714 +2
=========================================
+ Hits 11852 11918 +66 ☔ View full report in Codecov by Sentry. |
This reverts commit 8b59449.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see new country being added 🚀
I'm working up a solution for Poya Day calculations at the moment and will create a suggestion PR with them later - I was originally planned to base them on Thai LuniSolar calendar ones but it appears the results aren't a 100% match yet |
If there's anything I can do to assist you with the Poya Day calculations, please let me know. I’d be more than happy to help out in any way I can! |
@PPsyrius anything we should wait from you or this is good for review? |
@arkid15r no, many poya days assignments are still incorrect at the moment |
Thanks for the update, @PPsyrius! If there's anything specific you'd like me to look into, just let me know. I'm happy to contribute! |
@Prateekshit73 I've created a PR to address Poya day assignment and some other issues I've come across while working on them. Sinhala Lunar calendar method of inserting an extra lunar month every 33-month cycle makes it impractical to compute so I've ended up hardcoding 2023-2025 ones for now.
I think I might have missed a test case somewhere, but the results from local tests sadly aren't that descriptive so I'm leaving that for you to sort out later 🙏 |
Implements SinhalaCalendarHolidays
I feel that instead of helping, I often end up increasing your workload. Hopefully, I will complete the allotted work correctly this time. Thank you for your help, @PPsyrius sir. |
@Prateekshit73 Nah, it's fine - it's just that I've vastly underestimated Sri Lankan holiday complexity myself too. I heard they're Theravada like the Indochinese trios (🇹🇭🇱🇦🇰🇭) so I thought their implementation would be quite similar myself, until a quick test with real 2022 data ended in failure - and it just went down the rabbit hole from there... 🥲 This is probably on par with the unimplemented Myanmar ones that I kept in the backburner. Anyway, if you're still up for this, there's a list of African/Caribbean/Pacific here that's likely more straightforward for new contributors as they're mostly Gregorian-based i.e. Saint Lucia and Fiji. |
Sri Lanka Sonarcloud fixes
The output of
This corresponds to the following code snippet: if maha_sivarathri_date:
# Maha Sivarathri Day.
self._add_holiday(tr("මහ සිවරාත්රි දිනය"), maha_sivarathri_date)
# Deepavali was considered a workday in 2003.
if self._year >= 2004: I attempted to implement a test for this with the following code: def test_maha_sivarathri(self):
self.assertHolidayName(
"මහ සිවරාත්රි දිනය",
"2003-03-01",
...
) However, I am still getting a coverage of 99%. |
@arkid15r @KJhellico quick sidenote: SonarCloud does support code coverage display too, so we might want to migrate to that tool later for a simpler review process in the future. |
For full coverage it's required to execute a branch where |
As I understand, it's because on latest commits the tests fail and coverage report not being uploaded. |
Quality Gate passedIssues Measures |
Hi Sir @KJhellico, Thank you for your insights! Given that As a referenced in the code itself, |
Proposed change
Added Sri Lanka holidays
Closes #1272
Type of change
holidays
functionality in general)Checklist
make check
, all checks and tests are green