- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 560
 
Add Grenada holidays #2524
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 Grenada holidays #2524
Conversation
          
Summary by CodeRabbit
 Summary by CodeRabbit
 WalkthroughThis change introduces support for Grenada's public holidays into the holidays library. It adds a new country module for Grenada, updates the country registry, includes localization files for English (Grenada and US), and amends documentation to reflect the new country. Comprehensive unit tests verify the accuracy and localization of Grenada's holiday calendar. The implementation covers both fixed and movable holidays, special festival days, and observed holiday rules. Changes
 Assessment against linked issues
 Suggested reviewers
 Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure  📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
 🔇 Additional comments (6)
 ✨ Finishing Touches
 🧪 Generate Unit Tests
 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit: 
 SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
 Other keywords and placeholders
 Documentation and Community
  | 
    
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.
Actionable comments posted: 6
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
README.md(2 hunks)holidays/countries/__init__.py(1 hunks)holidays/countries/grenada.py(1 hunks)holidays/locale/en_GD/LC_MESSAGES/GD.po(1 hunks)holidays/locale/en_US/LC_MESSAGES/GD.po(1 hunks)holidays/registry.py(1 hunks)tests/countries/test_grenada.py(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
holidays/locale/en_US/LC_MESSAGES/GD.po (1)
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.
tests/countries/test_grenada.py (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
🧬 Code Graph Analysis (1)
holidays/countries/__init__.py (1)
holidays/countries/grenada.py (3)
Grenada(20-113)GD(116-117)GRD(120-121)
🔇 Additional comments (6)
holidays/registry.py (1)
86-86: Register Grenada in country registry
The entry for"grenada": ("Grenada", "GD", "GRD")is correctly alphabetized and formatted, matching the style of other entries.holidays/countries/__init__.py (1)
77-77: Import Grenada country module
The importfrom .grenada import Grenada, GD, GRDis properly placed in alphabetical order between Greenland and Guam.README.md (1)
108-108: Update supported countries count
The count was updated to 172, which aligns with the addition of Grenada.holidays/locale/en_GD/LC_MESSAGES/GD.po (1)
31-104:⚠️ Potential issuePopulate default locale translations
Allmsgstrentries are empty, resulting in blank holiday names for theen_GDlocale. Sinceen_GDis the default language, set eachmsgstrequal to itsmsgidso holidays display correctly.Example:
-msgid "New Year's Day" -msgstr "" +msgid "New Year's Day" +msgstr "New Year's Day"Repeat for each entry.
⛔ Skipped due to learnings
Learnt from: KJhellico PR: vacanza/holidays#2394 File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88 Timestamp: 2025-03-31T19:37:57.691Z Learning: In the holidays library, when a locale file matches the country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language files should have filled msgstr fields with translations.Learnt from: KJhellico PR: vacanza/holidays#2259 File: holidays/locale/en_IN/LC_MESSAGES/IN.po:30-299 Timestamp: 2025-03-05T17:51:00.633Z Learning: In the Holidays project, .po files for a country's default locale use empty msgstr fields as a standard convention.Learnt from: KJhellico PR: vacanza/holidays#2394 File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88 Timestamp: 2025-03-31T19:37:57.691Z Learning: In the holidays library localization pattern, when a locale file matches a country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language locale files should have translations in the msgstr fields.Learnt from: PPsyrius PR: vacanza/holidays#2438 File: holidays/locale/ar_IQ/LC_MESSAGES/IQ.po:35-81 Timestamp: 2025-04-17T17:08:48.082Z Learning: In holiday PO files, when the file represents the default language of an entity (e.g., ar_IQ for Iraq), no translations in `msgstr` are required as the `msgid` values are already in the target language.Learnt from: KJhellico PR: vacanza/holidays#2465 File: holidays/locale/nl/LC_MESSAGES/SR.po:31-32 Timestamp: 2025-04-13T19:11:32.337Z Learning: In the holidays library, when a language is set as the default language for a country (like Dutch/nl for Suriname), the `msgid` strings in the PO file are already in that language, and the corresponding `msgstr` fields are intentionally left empty. This is by design, as the system will fall back to using the `msgid` value when no translation is provided.Learnt from: PPsyrius PR: vacanza/holidays#2388 File: holidays/locale/fr/LC_MESSAGES/CI.po:28-101 Timestamp: 2025-03-30T13:33:31.598Z Learning: In the holidays library, for localization files of the default language (like French for Ivory Coast in fr/LC_MESSAGES/CI.po), the best practice is to leave the message strings (msgstr) empty to avoid possible typos, since the message IDs (msgid) are already in the target language.Learnt from: KJhellico PR: vacanza/holidays#2388 File: holidays/locale/en_CI/LC_MESSAGES/CI.po:88-88 Timestamp: 2025-03-30T18:25:07.087Z Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.holidays/locale/en_US/LC_MESSAGES/GD.po (1)
31-104: Localization entries are correct
Themsgstrvalues mirror themsgids appropriately for en_US (e.g., "Labor Day" vs "Labour Day"). Headers, placeholders, and formatting align with other locale files.tests/countries/test_grenada.py (1)
323-335: Update festival name after correcting “Carriacou”.Once the typo is fixed in the implementation, the assertions here will fail. Adjust the expected strings accordingly.
- ("2012-04-27", "Carricou Maroon and String Band Music Festival"), + ("2012-04-27", "Carriacou Maroon and String Band Music Festival"),…and so on for every affected date.
Signed-off-by: Nalin Gupta <[email protected]>
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.
Actionable comments posted: 1
♻️ Duplicate comments (5)
holidays/countries/grenada.py (5)
81-83: Synchronise comment spelling with holiday name.The code correctly adds "Labour Day", but the preceding comment says "Labor". Use the same spelling to avoid second-guessing which variant is intended.
- # Labor Day. + # Labour Day. self._add_observed(self._add_labor_day(tr("Labour Day")))
137-140: Fix the "Carriacou" typo in static holidays.The island is "Carriacou", not "Carricou". This small slip propagates to translation keys and tests, so correcting it early prevents a cascade of mismatches.
- # Carricou Maroon and String Band Music Festival. - (APR, 27, tr("Carricou Maroon and String Band Music Festival")), - (APR, 28, tr("Carricou Maroon and String Band Music Festival")), - (APR, 29, tr("Carricou Maroon and String Band Music Festival")), + # Carriacou Maroon and String Band Music Festival. + (APR, 27, tr("Carriacou Maroon and String Band Music Festival")), + (APR, 28, tr("Carriacou Maroon and String Band Music Festival")), + (APR, 29, tr("Carriacou Maroon and String Band Music Festival")),
154-156: Fix the "Carriacou" typo (continued).The same typo appears in the 2013 dates.
- # Carricou Maroon and String Band Music Festival. - (APR, 26, tr("Carricou Maroon and String Band Music Festival")), - (APR, 27, tr("Carricou Maroon and String Band Music Festival")), - (APR, 28, tr("Carricou Maroon and String Band Music Festival")), + # Carriacou Maroon and String Band Music Festival. + (APR, 26, tr("Carriacou Maroon and String Band Music Festival")), + (APR, 27, tr("Carriacou Maroon and String Band Music Festival")), + (APR, 28, tr("Carriacou Maroon and String Band Music Festival")),
170-172: Fix the "Carriacou" typo (continued).The same typo appears in the 2014 dates.
- # Carricou Maroon and String Band Music Festival. - (APR, 25, tr("Carricou Maroon and String Band Music Festival")), - (APR, 26, tr("Carricou Maroon and String Band Music Festival")), - (APR, 27, tr("Carricou Maroon and String Band Music Festival")), + # Carriacou Maroon and String Band Music Festival. + (APR, 25, tr("Carriacou Maroon and String Band Music Festival")), + (APR, 26, tr("Carriacou Maroon and String Band Music Festival")), + (APR, 27, tr("Carriacou Maroon and String Band Music Festival")),
186-188: Fix the "Carriacou" typo (continued).The same typo appears in the 2015 dates.
- # Carricou Maroon and String Band Music Festival. - (APR, 24, tr("Carricou Maroon and String Band Music Festival")), - (APR, 25, tr("Carricou Maroon and String Band Music Festival")), - (APR, 26, tr("Carricou Maroon and String Band Music Festival")), + # Carriacou Maroon and String Band Music Festival. + (APR, 24, tr("Carriacou Maroon and String Band Music Festival")), + (APR, 25, tr("Carriacou Maroon and String Band Music Festival")), + (APR, 26, tr("Carriacou Maroon and String Band Music Festival")),
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
holidays/countries/grenada.py(1 hunks)
🔇 Additional comments (5)
holidays/countries/grenada.py (5)
90-95: LGTM! Properly implemented Emancipation Day rule change.The change from a floating holiday (first Monday of August) to a fixed date (August 1) from 2025 onwards is correctly implemented with appropriate conditional logic.
102-105: LGTM! Well-implemented conditional holiday.The National Heroes' Day implementation correctly uses a conditional check to only add this holiday from 2023 onwards, with proper citation of sources in the class documentation.
200-202: LGTM! Well-structured special holiday entry.The implementation of CARICOM's 50th Anniversary as a one-day holiday in 2023 follows the library's established patterns for special one-off holidays.
1-50: LGTM! Well-documented with comprehensive references.The implementation includes extensive source citations and references, which will be valuable for future maintenance and validation of the holiday definitions.
20-66: LGTM! Class structure follows library conventions.The Grenada class correctly inherits from appropriate base classes and initializes them properly. The observed rule default is appropriately set to move Sunday holidays to Monday.
Signed-off-by: Nalin Gupta <[email protected]>
Signed-off-by: Nalin Gupta <[email protected]>
Signed-off-by: Nalin Gupta <[email protected]>
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.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
tests/countries/test_grenada.py(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
tests/countries/test_grenada.py (2)
tests/common.py (9)
TestCase(28-338)CommonCountryTests(356-374)assertAliases(121-130)assertNoHolidays(292-294)assertHoliday(150-152)assertHolidayName(195-199)assertNoHolidayName(273-275)assertHolidays(228-230)assertLocalizedHolidays(327-338)holidays/countries/grenada.py (3)
Grenada(20-106)GD(109-110)GRD(113-114)
🔇 Additional comments (8)
tests/countries/test_grenada.py (8)
21-23: Good implementation of setup with appropriate year range.The test setup correctly uses the year range starting from 1975 (Grenada's independence was in 1974) and extends to 2050, providing comprehensive coverage for all holidays.
28-29: Correctly tests absence of holidays before independence.This test properly verifies that no holidays are defined for 1974, which aligns with Grenada's independence timeline.
133-150: Properly addressed the previous review comment on test name.The test method was renamed from
test_corpus_christi_daytotest_corpus_christias suggested in a previous review, which properly aligns with the holiday name.
151-174: Good handling of Emancipation Day rule change.The test correctly tests both the pre-2025 rule (first Monday of August) and post-2025 rule (fixed on August 1 with observation). The previous issue with missing test prefix has been properly addressed.
175-192: Improved test method names for Carnival holidays.The method names for Carnival Monday and Tuesday have been cleaned up by removing the redundant "_day" suffix as suggested in the previous review.
Also applies to: 193-210
211-221: Proper verification of National Heroes' Day introduction.The test correctly verifies that this holiday starts in 2023 and doesn't exist before that, matching its recent introduction.
258-260: Good reference documentation.Including the archived government website URL provides excellent validation of the holiday list for 2012.
278-296: Comprehensive localization tests.The localization tests thoroughly verify both the default locale (en_GD) and US English locale (en_US) with appropriate spelling differences (e.g., "Labour" vs "Labor").
Also applies to: 297-315
Signed-off-by: Nalin Gupta <[email protected]>
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.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
README.md(2 hunks)
🔇 Additional comments (1)
README.md (1)
584-589: New country addition: Grenada
Placement between Greenland and Guam is correct, and the row’s markup (cells and bolding of the default locale) aligns with the surrounding entries.
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.
Also you need to merge latest dev changes.
Co-authored-by: ~Jhellico <[email protected]> Signed-off-by: Nalin Gupta <[email protected]>
Signed-off-by: Nalin Gupta <[email protected]>
Signed-off-by: Nalin Gupta <[email protected]>
Signed-off-by: Nalin Gupta <[email protected]>
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.
Actionable comments posted: 2
♻️ Duplicate comments (3)
tests/countries/test_grenada.py (1)
31-40: 🧹 Nitpick (assertive)Add documentation for special holiday dates.
The test_special_holidays method lists several dates without explaining what each represents. Adding a brief comment for each date would improve maintenance for future developers.
def test_special_holidays(self): self.assertHoliday( - "2011-12-27", - "2013-02-22", - "2016-12-27", - "2018-03-14", - "2022-06-24", - "2022-12-27", - "2023-07-04", + "2011-12-27", # Boxing Day (observed) + "2013-02-22", # Bank Holiday + "2016-12-27", # Boxing Day (observed) + "2018-03-14", # Bank Holiday + "2022-06-24", # Bank Holiday + "2022-12-27", # Boxing Day (observed) + "2023-07-04", # CARICOM's 50th Anniversary )holidays/countries/grenada.py (2)
15-15: 🧹 Nitpick (assertive)Add missing month constants to imports.
The imports are missing APR, AUG, and OCT which are likely used elsewhere in the code (based on the month names in the test file).
-from holidays.calendars.gregorian import FEB, MAR, JUN, JUL, DEC +from holidays.calendars.gregorian import APR, AUG, FEB, JUN, JUL, MAR, OCT, DEC
119-126: 🧹 Nitpick (assertive)Standardize reference link format.
Reference links should follow a consistent format. The current format differs from the main docstring (using years in brackets vs descriptive text).
- * [2011](https://web.archive.org/web/20250504100149/https://laws.gov.gd/index.php/s-r-o/37-sr-o-35-of-2011-bank-holiday/viewdocument/37) - * [2013](https://web.archive.org/web/20250504100219/https://laws.gov.gd/index.php/s-r-o/93-sro-6-of-2013-bank-holiday/viewdocument/93) - * [2016](https://web.archive.org/web/20250504100408/https://laws.gov.gd/index.php/s-r-o/289-sr-o-61-of-2016-bank-holiday/viewdocument/289) - * [2018](https://web.archive.org/web/20250504100436/https://laws.gov.gd/index.php/s-r-o/348-sr-o-10-of-2018-bank-holiday-proclamation/viewdocument/348) - * [24 June 2022](https://web.archive.org/web/20250504100516/https://laws.gov.gd/index.php/s-r-o/576-sr-o-33-of-2022-bank-holiday-proclamation-2022/viewdocument/576) - * [27 December 2022](https://web.archive.org/web/20250504100538/https://laws.gov.gd/index.php/s-r-o/586-sr-o-43-of-2022-bank-holiday-proclamation-2022/viewdocument/586) + * [Bank Holiday Proclamation 2011](https://web.archive.org/web/20250504100149/https://laws.gov.gd/index.php/s-r-o/37-sr-o-35-of-2011-bank-holiday/viewdocument/37) + * [Bank Holiday Proclamation 2013](https://web.archive.org/web/20250504100219/https://laws.gov.gd/index.php/s-r-o/93-sro-6-of-2013-bank-holiday/viewdocument/93) + * [Bank Holiday Proclamation 2016](https://web.archive.org/web/20250504100408/https://laws.gov.gd/index.php/s-r-o/289-sr-o-61-of-2016-bank-holiday/viewdocument/289) + * [Bank Holiday Proclamation 2018](https://web.archive.org/web/20250504100436/https://laws.gov.gd/index.php/s-r-o/348-sr-o-10-of-2018-bank-holiday-proclamation/viewdocument/348) + * [Bank Holiday Proclamation June 2022](https://web.archive.org/web/20250504100516/https://laws.gov.gd/index.php/s-r-o/576-sr-o-33-of-2022-bank-holiday-proclamation-2022/viewdocument/576) + * [Bank Holiday Proclamation December 2022](https://web.archive.org/web/20250504100538/https://laws.gov.gd/index.php/s-r-o/586-sr-o-43-of-2022-bank-holiday-proclamation-2022/viewdocument/586)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (2)
holidays/countries/grenada.py(1 hunks)tests/countries/test_grenada.py(1 hunks)
🔇 Additional comments (3)
holidays/countries/grenada.py (3)
81-87: Well-handled implementation for Emancipation Day rule change.The code correctly implements the Emancipation Day rule change starting from 2025, when it becomes fixed on August 1 instead of the first Monday in August. This matches the test cases and reference documentation.
94-97: Good conditional implementation for National Heroes' Day.The code correctly implements National Heroes' Day starting from 2023, which aligns with the test cases and documentation references.
101-103: Correctly implemented Christmas Day observation.The code now properly applies the observation rule to Christmas Day, ensuring it's observed on a weekday when it falls on a weekend - a common pattern in holiday implementations.
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.
And rest is LGTM.
Co-authored-by: ~Jhellico <[email protected]> Signed-off-by: Nalin Gupta <[email protected]>
          
 | 
    
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.
LGTM 🇬🇩
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.
LGTM
Thanks for adding Grenada holidays support @nalin-28 👍
Signed-off-by: Nalin Gupta <[email protected]> Co-authored-by: ~Jhellico <[email protected]>
Signed-off-by: Nalin Gupta <[email protected]> Co-authored-by: ~Jhellico <[email protected]>



Proposed change
Add Public Holidays for Grenada
Supported Languages:
en_US,en_GDFixes #1192
Type of change
holidaysfunctionality in general)Checklist
make check, all checks and tests are green