-
-
Notifications
You must be signed in to change notification settings - Fork 539
Add Equatorial Guinea holidays #2521
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
Conversation
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughThis update introduces support for Equatorial Guinea holidays. It adds a new module defining holiday rules for Equatorial Guinea, updates country registries, and includes localization files for English and Spanish. The documentation is revised to reflect the new country, and comprehensive tests are added to validate the implementation and localization. The CONTRIBUTORS file is updated with a new contributor. 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. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🔇 Additional comments (3)
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.
Pull Request Overview
This PR adds support for Equatorial Guinea holidays by introducing a new country implementation, expanding the country registry, updating tests to assert the correct holiday dates, and revising the README to reflect the additional market.
- Implements holiday calculations and observed rules for Equatorial Guinea in a new module.
- Provides comprehensive tests in tests/countries/test_equatorial_guinea.py.
- Updates the registry and README to include Equatorial Guinea.
Reviewed Changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/countries/test_equatorial_guinea.py | Adds tests covering each holiday specific to Equatorial Guinea. |
holidays/registry.py | Adds Equatorial Guinea mapping for country aliases and codes. |
holidays/countries/equatorial_guinea.py | Implements the holiday definitions and rules for Equatorial Guinea. |
holidays/countries/init.py | Updates module import to include Equatorial Guinea support. |
README.md | Updates the available country count and lists Equatorial Guinea. |
Files not reviewed (3)
- CONTRIBUTORS: Language not supported
- holidays/locale/en_US/LC_MESSAGES/GQ.po: Language not supported
- holidays/locale/es/LC_MESSAGES/GQ.po: Language not supported
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
📒 Files selected for processing (8)
CONTRIBUTORS
(1 hunks)README.md
(2 hunks)holidays/countries/__init__.py
(1 hunks)holidays/countries/equatorial_guinea.py
(1 hunks)holidays/locale/en_US/LC_MESSAGES/GQ.po
(1 hunks)holidays/locale/es/LC_MESSAGES/GQ.po
(1 hunks)holidays/registry.py
(1 hunks)tests/countries/test_equatorial_guinea.py
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
holidays/countries/__init_ 8000 _.py (1)
holidays/countries/equatorial_guinea.py (3)
EquatorialGuinea
(20-99)GQ
(102-103)GNQ
(106-107)
🔇 Additional comments (17)
CONTRIBUTORS (1)
4-4
: Welcome the new contributor
Thank you for adding Abheelash Mishra to the CONTRIBUTORS list.README.md (2)
108-108
: Update total supported country count
The supported countries count has been updated to 172 to reflect Equatorial Guinea’s inclusion.
493-498
: Add Equatorial Guinea to supported countries table
The new<tr>
for Equatorial Guinea (GQ) withen_US, es
is correctly inserted alphabetically.holidays/countries/__init__.py (1)
64-64
: Import EquatorialGuinea module
The import ofEquatorialGuinea, GQ, GNQ
is properly placed between ElSalvador and Estonia, maintaining alphabetical order.holidays/registry.py (1)
73-73
: Register Equatorial Guinea in COUNTRIES
The entry"equatorial_guinea": ("EquatorialGuinea", "GQ", "GNQ")
is correctly added in the registry in alphabetical order.holidays/locale/es/LC_MESSAGES/GQ.po (1)
1-84
: Add Spanish localization file for Equatorial Guinea
All holidaymsgid
entries are defined, and blankmsgstr
values will fallback to the Spanish defaults as intended.holidays/locale/en_US/LC_MESSAGES/GQ.po (3)
1-28
: Good job on the header structure and metadata setupThe file includes appropriate license information, authorship details, and metadata headers following the project's standard format.
29-31
: Correct observed format string implementationThe format string for observed holidays is properly implemented, maintaining consistency with other language files in the project.
33-84
: Well-structured translations with helpful commentsThe translations are accurate and include helpful contextual comments that explain each holiday, making maintenance easier for future contributors.
tests/countries/test_equatorial_guinea.py (3)
19-26
: Well-implemented test class structureThe test class is properly set up with inheritance from common test utilities and includes proper test methods for country aliases.
27-130
: Comprehensive test coverage for all holidaysAll holidays are thoroughly tested, including fixed date holidays, movable religious holidays, and special one-time holidays. The tests properly verify both the regular dates and observed date adjustments when holidays fall on weekends.
131-166
: Good localization testingBoth default (Spanish) and English US localizations are properly tested, ensuring all holiday names are correctly translated in both languages.
holidays/countries/equatorial_guinea.py (5)
20-40
: Well-structured class with proper documentationThe EquatorialGuinea class includes:
- Comprehensive documentation with references
- Proper country metadata
- Appropriate language settings
- Clear observed holiday label
The references provided are valuable for validating the implementation.
42-49
: Proper initialization and observed rule configurationThe class correctly initializes all parent classes and sets up the appropriate observed holiday rules for Equatorial Guinea (moving Saturday holidays to Friday and Sunday holidays to Monday).
50-100
: Comprehensive holiday implementationAll public holidays for Equatorial Guinea are properly implemented:
- Fixed-date holidays are correctly added with appropriate names
- Religious holidays are correctly implemented using the ChristianHolidays methods
- Observed date adjustments are applied to appropriate holidays
- Conditional holidays based on year are properly handled
This implementation covers all the required holidays for this country.
102-108
: Appropriate country code aliasesThe country code aliases (GQ and GNQ) are correctly implemented, matching ISO standards.
110-114
: Proper handling of special one-time holidaysThe special one-time holiday for the 2024 AFCON victory is correctly implemented in a separate static holidays class.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Abheelash Mishra <108271085+Abheelash-Mishra@users.noreply.github.com>
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
📒 Files selected for processing (1)
holidays/locale/en_US/LC_MESSAGES/GQ.po
(1 hunks)
🔇 Additional comments (3)
holidays/locale/en_US/LC_MESSAGES/GQ.po (3)
17-27
: Header metadata looks correct.
TheLanguage: en_US
line correctly identifies this as the English translations file, andX-Source-Language: es
accurately marks Spanish as the source. All other header fields (version, dates, encoding) are in order.
29-31
: Observed–holiday format is accurate.
The msgid “%s (observado)” and its translation “%s (observed)” correctly mirror the observed‐holiday convention used elsewhere in the library.
37-84
: Other holiday translations are correct.
The rest of the msgid/msgstr pairs (International Women's Day, Good Friday, Labor Day, etc.) accurately reflect standard English names. Nice work covering all the Equatorial Guinea–specific holidays.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2521 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 219 220 +1
Lines 14033 14074 +41
Branches 1975 1975
=========================================
+ Hits 14033 14074 +41 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
📒 Files selected for processing (4)
holidays/countries/equatorial_guinea.py
(1 hunks)holidays/locale/en_US/LC_MESSAGES/GQ.po
(1 hunks)holidays/locale/es/LC_MESSAGES/GQ.po
(1 hunks)tests/countries/test_equatorial_guinea.py
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
tests/countries/test_equatorial_guinea.py (2)
tests/common.py (7)
TestCase
(28-338)CommonCountryTests
(356-374)assertAliases
(121-130)assertHolidayName
(195-199)assertNoNonObservedHoliday
(248-250)assertHoliday
(150-152)assertLocalizedHolidays
(327-338)holidays/countries/equatorial_guinea.py (3)
EquatorialGuinea
(20-99)GQ
(102-103)GNQ
(106-107)
holidays/countries/equatorial_guinea.py (4)
holidays/groups/christian.py (4)
_add_good_friday
(308-317)_add_corpus_christi_day
(247-257)_add_immaculate_conception_day
(339-345)_add_christmas_day
(208-216)holidays/groups/international.py (3)
_add_new_years_day
(126-134)_add_womens_day
(187-197)_add_labor_day
(99-108)holidays/groups/custom.py (1)
StaticHolidays
(18-47)holidays/observed_holiday_base.py (1)
ObservedHolidayBase
(101-243)
🔇 Additional comments (12)
holidays/locale/es/LC_MESSAGES/GQ.po (1)
1-84
: LGTM! Spanish localization file is correctly structured.The file follows proper PO file format and provides Spanish holiday names for Equatorial Guinea. All the necessary holidays are included with appropriate comments.
holidays/locale/en_US/LC_MESSAGES/GQ.po (3)
22-22
: Language tag correctly set to en_US.The language tag is properly set to match the file location and purpose.
33-35
: New Year's translation is correctly formatted.The translation uses the full "New Year's Day" format which is more consistent with other holiday names.
1-84
: English translations are accurate and complete.All holiday translations from Spanish to English are implemented correctly with proper formatting.
tests/countries/test_equatorial_guinea.py (3)
19-26
: Test class setup is appropriate.The test class correctly inherits from CommonCountryTests and TestCase, and properly sets up the EquatorialGuinea class.
131-147
: Localization tests are thorough.The default locale (Spanish) tests comprehensively cover all holidays including observed holiday variations.
149-166
: English localization tests are complete.All holiday names are properly tested in English, including observed holiday variations.
holidays/countries/equatorial_guinea.py (5)
20-40
: Class structure and country metadata are well-defined.The EquatorialGuinea class correctly inherits from appropriate base classes and defines necessary country metadata. The documentation includes comprehensive references, which is excellent for future maintainers.
42-48
: Initialization includes proper observed rule configuration.The class correctly initializes all parent classes and sets up the observed rule to handle both Saturday and Sunday holidays appropriately.
50-99
: Holiday definitions are well-organized and properly implemented.All holidays are appropriately defined with correct methods. The conditional holidays based on years (Armed Forces Day, President's Day, and Fundamental Law Day) are properly implemented with the correct start years.
102-107
: Country code aliases are correctly defined.GQ and GNQ aliases are properly created following the project's convention.
110-114
: Special holiday for AFCON victory is properly implemented.The one-time holiday celebrating the AFCON victory against Ivory Coast is correctly defined for 2024 only.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Abheelash Mishra <108271085+Abheelash-Mishra@users.noreply.github.com>
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
📒 Files selected for processing (1)
tests/countries/test_equatorial_guinea.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
tests/countries/test_equatorial_guinea.py (1)
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
🔇 Additional comments (6)
tests/countries/test_equatorial_guinea.py (6)
128-132
: Great job incorporating the suggested improvements for the AFCON victory test.The test now properly verifies both the holiday name and ensures that it only exists in 2024, making it more comprehensive and robust.
19-26
: The test class setup looks good.The class properly extends CommonCountryTests and TestCase, and the setUpClass method is correctly implemented.
27-34
: Thorough testing for New Year's Day with observed day handling.Good job testing both the regular holiday and the observed day when it falls on a weekend.
133-149
: Comprehensive default localization testing.The localization tests comprehensively verify all holiday names in Spanish (default locale).
151-168
: Good English localization testing.The English localization tests properly verify all translated holiday names.
1-169
: Overall comprehensive test coverage for Equatorial Guinea holidays.The test suite covers all the holidays implemented for Equatorial Guinea, including fixed dates, movable dates, observed holidays, and special one-time events like the AFCON victory. Both default (Spanish) and English localizations are thoroughly tested.
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.
@Abheelash-Mishra, it's very good start! 👍 Please look at a few suggestions, mostly technical (I have not yet researched the sources deeply).
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.
Looking good so far, some additional comments here on top of @KJhellico ones
Hey, I just want to keep you all informed. I am working on these changes, and I apologize for any delays from my end cuz I have some stuff come up related to my education. |
@Abheelash-Mishra thank for the heads up! Do you think it'd be feasible to complete the work before our next version release May 19? |
Hi @arkid15r I will of course certainly do my best to have it ready by May 19. |
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: 3
♻️ Duplicate comments (1)
holidays/countries/equatorial_guinea.py (1)
15-18
:⚠️ Potential issueIncorrect observed-rule constant & missing imports
Equatorial Guinea’s decree moves Saturday holidays back to Friday and Sunday holidays forward to Monday (per earlier reviewer notes).
SAT_SUN_TO_NEXT_MON
only handles the Sunday→Monday half of that requirement.
Bring inSAT_TO_PREV_FRI
andSUN_TO_NEXT_MON
, then compose them.-from holidays.observed_holiday_base import ObservedHolidayBase, SAT_SUN_TO_NEXT_MON +from holidays.observed_holiday_base import ( + ObservedHolidayBase, + SAT_TO_PREV_FRI, + SUN_TO_NEXT_MON, +)
📜 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 (5)
README.md
(2 hunks)holidays/countries/equatorial_guinea.py
(1 hunks)holidays/locale/en_US/LC_MESSAGES/GQ.po
(1 hunks)holidays/locale/es/LC_MESSAGES/GQ.po
(1 hunks)tests/countries/test_equatorial_guinea.py
(1 hunks)
🔇 Additional comments (22)
README.md (2)
108-108
: Documentation update looks good.The number of supported countries has been correctly updated from 172 to 173 to reflect the addition of Equatorial Guinea.
500-505
: Entry format is correct and well-structured.The Equatorial Guinea entry follows the established pattern for country entries, correctly listing:
- Country name and code (GQ)
- Subdivisions with their codes and names
- Supported languages (en_US and es, with es being the default)
This is consistent with other country entries and the project's documentation standards.
holidays/locale/es/LC_MESSAGES/GQ.po (4)
13-14
: Holiday localization header is appropriate.The comment identifying this file as containing Equatorial Guinea holidays is correct and follows the standard format.
15-28
: PO file metadata is properly structured.The file contains all required metadata fields including project version, creation date, language team, content type, etc. The language tag is correctly set to "es".
29-32
: Observation format string is properly defined.This template string will be used to mark holidays that are observed on days other than their actual date (typically when a holiday falls on a weekend).
34-155
: Holiday translations are comprehensive.The file includes a complete set of national and regional holidays for Equatorial Guinea, including standard holidays like New Year's Day, Good Friday, and Christmas Day, as well as country-specific holidays like Armed Forces Day, Fundamental Law Day, and local patron saint festivals. In the Spanish version, the msgstr fields are empty as expected since the msgid is already in Spanish (the default language).
holidays/locale/en_US/LC_MESSAGES/GQ.po (4)
13-14
: Localization header correctly specifies en_US.The comment line appropriately identifies this as the English US localization file for Equatorial Guinea holidays.
15-28
: PO file metadata is correctly configured.The metadata fields are properly set, including the language tag which is correctly set to "en_US". The X-Source-Language field appropriately indicates "es" as the source language.
29-32
: Observed format string is correctly translated.The format string for marking observed holidays is properly translated from Spanish to English.
34-155
: Holiday translations are accurate and complete.All holiday names are properly translated from Spanish to English, maintaining their cultural significance while being understandable to English speakers. The translations are consistent with holiday naming conventions used throughout the project.
tests/countries/test_equatorial_guinea.py (12)
15-16
: Appropriate imports for testing.The test file correctly imports the Equatorial Guinea holiday class and its aliases, as well as the common testing utilities.
19-27
: Test class setup is properly configured.The test class extends CommonCountryTests and TestCase, setting up with an appropriate year range (1969-2050) which covers the country's independence and extends well into the future. The country alias test correctly verifies both GQ and GNQ aliases.
28-30
: Pre-independence test is important.The test correctly verifies that no holidays are defined before 1968 (Equatorial Guinea gained independence in 1968, so holidays would start in 1969).
31-38
: New Year's Day test is thorough.The test verifies both the holiday name and its observance on alternative days when January 1st falls on a weekend. It correctly checks all years from 1969 to 2050.
39-58
: Good Friday test covers both specific dates and range verification.The test verifies specific historical and future dates for Good Friday, and also checks that it's observed in every year from 1969 to 2050, which is important for a moveable holiday.
59-66
: Labor Day test includes observed dates.Correctly tests Labor Day (May 1) and its observance on alternative days when it falls on a weekend.
67-85
: Corpus Christi test is comprehensive.The test verifies specific dates for this moveable holiday across multiple years, and also checks that it's observed in every year in the test range.
86-94
: Armed Forces Day test includes start year check.The test correctly verifies that this holiday (August 3) is observed from 1979 onwards, but not before, and checks observed dates when it falls on a weekend.
95-133
: Remaining national holiday tests are thorough.The tests for President's Day, Fundamental Law Day, Independence Day, Immaculate Conception, and Christmas Day all properly verify the holiday names, dates, and observed alternatives.
135-174
: Subdivision holiday tests are well-structured.The test creates a mapping of subdivision codes to their specific holiday dates and verifies them all. This ensures that province-specific holidays are correctly implemented.
175-179
: AFCON victory test is complete.The test verifies both the name and date of this one-time holiday (January 23, 2024) and confirms it doesn't exist in other years, as requested in previous review comments.
180-255
: Localization tests are comprehensive.The tests verify both the default Spanish names and the English translations for all holidays in 2025, ensuring that localization works correctly for both languages.
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 (3)
holidays/countries/equatorial_guinea.py (3)
17-17
: 🛠️ Refactor suggestionImport the correct observed rule constants.
The current code imports
SAT_SUN_TO_NEXT_MON
, but based on previous discussions, the implementation should useSAT_TO_PREV_FRI + SUN_TO_NEXT_MON
for Equatorial Guinea holidays.-from holidays.observed_holiday_base import ObservedHolidayBase, SAT_SUN_TO_NEXT_MON +from holidays.observed_holiday_base import ObservedHolidayBase, SAT_TO_PREV_FRI, SUN_TO_NEXT_MON
192-192
: 🧹 Nitpick (assertive)Fix Spanish orthography.
The holiday name has incorrect accent and word gender.
- self._add_holiday_aug_22(tr("Inmaculada Corazón de Maria")) + self._add_holiday_aug_22(tr("Inmaculado Corazón de María"))
84-84
: 🛠️ Refactor suggestionUpdate the observed rule to match the country's holiday policy.
The current rule only moves weekend holidays to Monday, but based on previous feedback, the correct rule should move Saturday holidays to Friday and Sunday holidays to Monday.
- kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON) + kwargs.setdefault("observed_rule", SAT_TO_PREV_FRI + SUN_TO_NEXT_MON)
📜 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 (5)
README.md
(2 hunks)holidays/countries/equatorial_guinea.py
(1 hunks)holidays/locale/en_US/LC_MESSAGES/GQ.po
(1 hunks)holidays/locale/es/LC_MESSAGES/GQ.po
(1 hunks)tests/countries/test_equatorial_guinea.py
(1 hunks)
🔇 Additional comments (17)
README.md (2)
108-108
: Correctly updated supported country count.The update to 176 countries is accurate after adding Equatorial Guinea.
500-505
: Properly structured Equatorial Guinea entry with all necessary information.The entry follows the established format with country name, code, subdivisions, and supported languages. Good job including both province (AN - Annobón) and city subdivisions.
holidays/locale/es/LC_MESSAGES/GQ.po (2)
1-32
: Localization header properly structured.The Spanish locale file contains all required metadata fields and follows the standard PO file format. The language tag and content type are correctly set.
34-165
: Complete set of holiday translations for Spanish locale.You've included all necessary holiday translations in the Spanish locale file, which is the default language for Equatorial Guinea. The message structure follows the standard format with comments describing each holiday.
holidays/locale/en_US/LC_MESSAGES/GQ.po (2)
1-28
: Well-structured localization header with correct language tag.The English locale file contains all required metadata fields with the correct language tag (en_US).
29-165
: Comprehensive English translations with consistent naming.All holiday names are properly translated to English and follow consistent naming patterns used in other country localization files. Holiday names like "New Year's Day" rather than just "New Year's" maintain consistency with the rest of the library.
tests/countries/test_equatorial_guinea.py (6)
19-27
: Test setup follows standard patterns.The test class properly extends CommonCountryTests and sets up the test years from 2007 to 2050, matching the intended support range. Good inclusion of the country alias test.
28-30
: Validation of unsupported years.Good addition of a test to verify no holidays exist before the supported year range (2007).
31-38
: Comprehensive New Year's Day test with observed rule verification.The test checks both the regular holiday and its observed date when falling on a weekend, including verification that the non-observed holiday doesn't exist on the observed date.
163-167
: Well-structured AFCON victory holiday test.Test properly verifies both the holiday name and its year-specific nature (2024 only), ensuring it doesn't appear in other years.
168-206
: Comprehensive default localization tests.The test thoroughly covers all holidays in the default language (Spanish), including compound holidays when multiple celebrations occur on the same day.
207-243
: Comprehensive English localization tests.The test covers the same holidays as the Spanish test, but with English translations, ensuring all holidays are properly localized in both supported languages.
holidays/countries/equatorial_guinea.py (5)
108-109
: LGTM! Corpus Christi day handling is correct.The implementation correctly doesn't apply the observed rule to Corpus Christi. This aligns with the information from official sources.
91-92
: LGTM! Women's Day implementation is correct.The implementation correctly doesn't apply the observed rule to Women's Day, which aligns with Decree 9/2007 and calendar sources.
25-38
: Comprehensive reference documentation.The extensive list of references, including the official decree and historical calendar information, provides excellent context for the implementation and will be valuable for future maintenance.
239-243
: Well-implemented special holiday for AFCON victory.The implementation of the special one-time holiday for the AFCON victory is correct and includes an appropriate translated name.
48-76
: Comprehensive subdivision support.The implementation includes a complete list of subdivisions with their respective holidays, which provides excellent coverage for the country's regional observances.
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/locale/es/LC_MESSAGES/GQ.po (1)
17-17
: Update Project-Id-Version to match the current release.The Project-Id-Version should be updated to match the current release version as suggested in a previous review.
-"Project-Id-Version: Holidays 0.74\n" +"Project-Id-Version: Holidays 0.44\n"holidays/countries/equatorial_guinea.py (4)
17-17
: 🛠️ Refactor suggestionUpdate observed holiday rule import.
The import should be updated to include more specific observed rules as suggested in previous comments.
-from holidays.observed_holiday_base import ObservedHolidayBase, SAT_SUN_TO_NEXT_MON +from holidays.observed_holiday_base import ObservedHolidayBase, SAT_TO_PREV_FRI, SUN_TO_NEXT_MON
83-83
: 🛠️ Refactor suggestionUpdate observed rule to match common patterns.
The observed rule should be updated to use the more specific combined rule for consistent handling of weekend holidays.
- kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON) + kwargs.setdefault("observed_rule", SAT_TO_PREV_FRI + SUN_TO_NEXT_MON)
194-194
: 🧹 Nitpick (assertive)Fix Spanish orthography.
The Spanish holiday name needs accent correction and proper gender agreement.
- self._add_holiday_aug_22(tr("Inmaculada Corazón de Maria")) + self._add_holiday_aug_22(tr("Inmaculado Corazón de María"))
110-111
: 🛠️ Refactor suggestionAdd observed rule for Corpus Christi.
Corpus Christi should be wrapped with
_add_observed
for consistent handling of weekend dates.- self._add_corpus_christi_day(tr("Corpus Christi")) + self._add_observed(self._add_corpus_christi_day(tr("Corpus Christi")))
📜 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 (4)
holidays/countries/equatorial_guinea.py
(1 hunks)holidays/locale/en_US/LC_MESSAGES/GQ.po
(1 hunks)holidays/locale/es/LC_MESSAGES/GQ.po
(1 hunks)tests/countries/test_equatorial_guinea.py
(1 hunks)
🔇 Additional comments (14)
holidays/locale/es/LC_MESSAGES/GQ.po (2)
31-32
: Empty msgstr fields are expected for Spanish locale.Since Spanish is the source language for Equatorial Guinea holidays, the empty msgstr fields are correct. This pattern continues throughout the file and doesn't need to be modified.
1-169
: The translations are well-structured and comprehensive.The Spanish locale file correctly includes all national, religious, and subdivision-specific holidays for Equatorial Guinea. The empty msgstr fields are appropriate since this is the source language file.
holidays/locale/en_US/LC_MESSAGES/GQ.po (3)
22-22
: Language tag correctly updated to en_US.The language tag has been properly set to "en_US" as required for this localization file.
36-36
: Correct translation of "Año Nuevo".The translation has been updated to "New Year's Day" as suggested in a previous review, which is more accurate and consistent with other holiday names.
1-169
: Translations are complete and accurate.The English locale file correctly provides translations for all Equatorial Guinea holidays, following established patterns for holiday naming in English.
holidays/countries/equatorial_guinea.py (3)
46-46
: Start year correctly set to 2007.Setting the start year to 2007 based on Decree 9/2007 is appropriate since this is when the holiday regulations were formalized.
90-91
: Women's Day implementation is correct.Not applying the observed rule to International Women's Day is correct since this holiday wasn't mentioned in Decree 9/2007 and there's no evidence it gets moved when falling on weekends.
1-252
: Overall implementation is well-structured and comprehensive.The implementation of Equatorial Guinea holidays follows the library's patterns correctly, with proper organization of national and subdivision-specific holidays. The references are thorough and the code is well-organized.
tests/countries/test_equatorial_guinea.py (6)
28-29
: Test for no holidays before start year.The test correctly verifies that no holidays exist before the defined start year of 2007.
108-121
: Corpus Christi test is comprehensive.The test properly verifies both specific dates for Corpus Christi and checks that it exists across all years in the appropriate range.
228-231
: AFCON victory holiday test is thorough.The test has been improved to verify both the holiday name and its year-specific nature, confirming it only exists in 2024.
196-227
: Comprehensive testing of subdivision holidays.The test systematically verifies all subdivision-specific holidays using a clean mapping approach.
233-271
: Localization tests are thorough and well-structured.The tests verify both default (Spanish) and English localizations for all holidays, ensuring translations are applied correctly.
Also applies to: 273-310
1-311
: Overall test suite is comprehensive and robust.The test suite thoroughly covers all aspects of the Equatorial Guinea holiday implementation, including national holidays, observed rules, subdivision-specific holidays, and localization.
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 (2)
holidays/countries/equatorial_guinea.py (2)
194-194
: 🛠️ Refactor suggestionSpanish orthography issue in holiday name.
The phrase "Inmaculada Corazón de Maria" is missing an accent mark on "María" and should possibly be "Inmaculado" (masculine) instead of "Inmaculada" (feminine) since it refers to "Corazón" (masculine).
Apply this correction:
- self._add_holiday_aug_22(tr("Inmaculada Corazón de Maria")) + self._add_holiday_aug_22(tr("Inmaculado Corazón de María"))
110-111
:⚠️ Potential issueCorpus Christi missing observed day wrapper.
The Corpus Christi holiday is not wrapped with
_add_observed
, contradicting a pattern used for other holidays which was noted in previous reviews and marked as addressed.Apply the following fix to ensure consistent handling of weekend observations:
- # Corpus Christi. - self._add_corpus_christi_day(tr("Corpus Christi")) + # Corpus Christi. + self._add_observed(self._add_corpus_christi_day(tr("Corpus Christi")))
📜 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 (4)
holidays/countries/equatorial_guinea.py
(1 hunks)holidays/locale/en_US/LC_MESSAGES/GQ.po
(1 hunks)holidays/locale/es/LC_MESSAGES/GQ.po
(1 hunks)tests/countries/test_equatorial_guinea.py
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
tests/countries/test_equatorial_guinea.py (2)
tests/common.py (10)
TestCase
(28-338)CommonCountryTests
(356-374)assertAliases
(121-130)assertNoHolidays
(292-294)assertHolidayName
(195-199)assertNoNonObservedHoliday
(248-250)assertNoHolidayName
(273-275)assertHoliday
(150-152)assertNoHoliday
(244-246)assertLocalizedHolidays
(327-338)holidays/countries/equatorial_guinea.py (3)
EquatorialGuinea
(20-230)GQ
(233-234)GNQ
(237-238)
🔇 Additional comments (16)
holidays/locale/es/LC_MESSAGES/GQ.po (3)
17-17
: LGTM! Version matches the requested value.The project version has been set to "Holidays 0.74" as suggested in previous reviews.
31-32
: Empty msgstr field for observed holiday format string.The translation template for observed holidays has an empty msgstr field. Since Spanish is the source language, this is expected behavior in gettext .po files.
35-164
: Comprehensive holiday coverage with empty msgstr fields.The file includes all necessary holiday translations for Equatorial Guinea, with empty msgstr fields which is expected for source language files in gettext.
holidays/locale/en_US/LC_MESSAGES/GQ.po (3)
22-22
: LGTM! Language tag is now correctly set.The language tag has been properly set to "en_US" as requested in previous reviews.
36-36
: Translation updated as requested.The translation for "Año Nuevo" has been correctly updated to "New Year's Day" as suggested in previous reviews.
31-164
: Overall good English translations.The English translations are clear and appropriate for the holiday names, with proper capitalization and English equivalents.
holidays/countries/equatorial_guinea.py (2)
83-83
: Observed rule setting inconsistent with recommended pattern.The current code uses
SAT_SUN_TO_NEXT_MON
but previous review comments suggested usingSAT_TO_PREV_FRI + SUN_TO_NEXT_MON
for the observed rule.Confirm which rule pattern should be used by checking the country's official holiday rules:
-kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON) +kwargs.setdefault("observed_rule", SAT_TO_PREV_FRI + SUN_TO_NEXT_MON)
238-251
: Static holiday implementation looks good.The AFCON Victory holiday implementation is correctly defined as a special one-time holiday for 2024 with proper sources cited.
tests/countries/test_equatorial_guinea.py (8)
21-23
: Test class setup looks good.The test class setup appropriately initializes with years ranging from 2007-2050, matching the start year defined in the holiday class.
28-29
: No holidays verification test is solid.The test ensures that no holidays exist before the start year (2007), validating the implementation's historical correctness.
50-60
: Maundy Thursday test added as suggested.The test for Maundy Thursday is now included, testing specific dates across multiple years.
61-74
: Good Friday test enhanced as suggested.The test now verifies both specific dates and the entire year range, ensuring comprehensive coverage.
122-126
: Armed Forces Day test includes historical verification.The test correctly verifies that Armed Forces Day doesn't exist before 1979, addressing previous comments about historical accuracy.
228-231
: AFCON victory test enhanced as suggested.The test now properly verifies both the holiday name and its year-specific nature, confirming it only exists in 2024.
196-227
: Comprehensive subdivision holiday tests.The tests for subdivision-specific holidays use a clean mapping approach to verify all local holidays across different regions.
233-266
: Thorough localization tests for both languages.The localization tests comprehensively verify holiday names in both Spanish (default) and English (US), ensuring proper translation.
Also applies to: 268-305
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: 4
♻️ Duplicate comments (3)
holidays/countries/equatorial_guinea.py (1)
86-87
:⚠️ Potential issueMissing observed rule for Corpus Christi.
Corpus Christi is defined in Decree 9/2007, but unlike other decree-defined holidays, it doesn't use the
_add_observed()
wrapper to implement the weekend observation rule.Apply this change to ensure consistent handling of holidays defined in the decree:
- # Corpus Christi. - self._add_corpus_christi_day(tr("Corpus Christi")) + # Corpus Christi. + self._add_observed(self._add_corpus_christi_day(tr("Corpus Christi")))tests/countries/test_equatorial_guinea.py (2)
31-34
: Enhance AFCON victory holiday test with name verification and year-specific checks.The test only verifies the date is a holiday but doesn't check the holiday name or confirm it's specific to 2024.
def test_special_holidays(self): + name = "Victoria de la AFCON contra Costa de Marfil" self.assertHoliday( "2024-01-23", ) + self.assertHolidayName(name, "2024-01-23") + # Verify it doesn't exist in other years + self.assertNoHoliday("2023-01-23", "2025-01-23")
21-23
: 🛠️ Refactor suggestionEnsure year range matches official holiday implementation dates.
Consider expanding the year range to start from 1969 instead of 2007 to align with official holiday implementation dates, as suggested in previous reviews.
- years = range(2007, 2050) + years = range(1969, 2050)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
README.md
(2 hunks)holidays/countries/equatorial_guinea.py
(1 hunks)holidays/locale/en_US/LC_MESSAGES/GQ.po
(1 hunks)holidays/locale/es/LC_MESSAGES/GQ.po
(1 hunks)tests/countries/test_equatorial_guinea.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
tests/countries/test_equatorial_guinea.py (3)
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.
Learnt from: PPsyrius
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
holidays/countries/equatorial_guinea.py (1)
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:63-70
Timestamp: 2025-03-23T10:11:50.465Z
Learning: In the holidays library, the `SAT_SUN_TO_NEXT_MON_TUE` rule is specifically used for consecutive holidays (like Christmas Day and Boxing Day) to ensure they're observed on separate weekdays (Monday and Tuesday) when they fall on weekends, while `SAT_SUN_TO_NEXT_MON` is used as the default rule for other holidays.
🔇 Additional comments (11)
README.md (1)
500-505
: Addition of Equatorial Guinea correctly follows the documentation standard.The addition of Equatorial Guinea to the list of supported countries is well-structured and contains all required information: country name, ISO code (GQ), subdivision (Annobón province), and supported languages (English and Spanish with Spanish as default).
holidays/locale/en_US/LC_MESSAGES/GQ.po (1)
1-92
: Well-structured English localization file with comprehensive translations.The English localization file correctly provides translations for all Equatorial Guinea holidays. Metadata is complete and accurately reflects the file's purpose.
holidays/locale/es/LC_MESSAGES/GQ.po (1)
1-92
: Spanish localization file correctly structured as source language.The Spanish localization file has empty message strings (
msgstr
) which is appropriate since Spanish is the source language (as indicated by "X-Source-Language: es"). The structure aligns with gettext conventions where the source language inherits values frommsgid
.holidays/countries/equatorial_guinea.py (7)
25-37
: Comprehensive and well-documented references.The references section includes official documentation (Decree 9/2007) and multiple reliable sources, providing strong validation for the holiday implementations.
40-53
: Country metadata correctly defined.The country code, languages, and subdivisions are properly defined and align with ISO standards and the information in the README update.
55-60
: Initialization follows best practices from previous feedback.The constructor correctly initializes all parent classes and sets the appropriate observed rule based on Decree 9/2007's Article 4, which requires holidays falling on non-working days to be observed on the next working day.
78-79
: Consider wrapping Africa Day with observed rule.If African Liberation Day is included in Decree 9/2007 or follows the same observation rules, it should be wrapped with
_add_observed()
for consistency.Please verify if African Liberation Day is mentioned in Decree 9/2007 or if it follows the same weekend observation rules as other holidays. If it does, apply:
- # African Liberation Day. - self._add_africa_day(tr("Día de la liberación Africana")) + # African Liberation Day. + self._add_observed(self._add_africa_day(tr("Día de la liberación Africana")))
108-111
: Subdivision holiday implementation looks correct.The implementation for Annobón's Patron Saint Festival follows the pattern established for subdivision-specific holidays in other country modules.
113-118
: Appropriate alias classes provided.The alias classes GQ and GNQ correctly inherit from EquatorialGuinea, providing convenient access to Equatorial Guinea holidays using the ISO codes.
121-131
: Special holiday implementation follows established patterns.The EquatorialGuineaStaticHolidays class correctly implements the special holiday for the 2024 AFCON victory, with proper reference to a reliable source.
tests/countries/test_equatorial_guinea.py (1)
218-237
: Excellent localization test coverage.The localization tests thoroughly verify both Spanish and English translations for all holidays, including observed dates and subdivision-specific holidays.
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.
I think these are my last suggestions. :)
|
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. 👍
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.
Nicely done, thank you for a great contribution @Abheelash-Mishra !
Proposed change
I have added support for Equatorial Guinea holidays. I hope my work is acceptable for your project.
Closes #1178
Type of change
holidays
functionality in general)Checklist
make check
, all checks and tests are green