+
Skip to content

Conversation

kritibirda26
Copy link
Contributor

@kritibirda26 kritibirda26 commented Mar 29, 2025

Proposed change

Add public holidays for Ivory Coast (en_CI, en_US, fr).

Resolves #1166.

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/pin/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new holidays functionality in general)

Checklist

Copy link
Contributor

coderabbitai bot commented Mar 29, 2025

Summary by CodeRabbit

  • New Features

    • Added comprehensive holiday support for Ivory Coast, covering national, international, and religious observances.
    • Enhanced holiday calculations with improved handling of key Islamic dates.
  • Documentation

    • Updated supported country count to 162, now including Ivory Coast.
    • Introduced localized holiday names and translations in English and French for Ivory Coast holidays.

Walkthrough

This pull request introduces comprehensive support for Ivory Coast within the holiday management library. It updates the documentation to reflect the addition of Ivory Coast as a supported country, adds a new class to manage Ivory Coast holidays, and includes necessary imports and registry updates. Additionally, it introduces localization files for multiple languages and implements unit tests to ensure the accuracy of the holiday data and functionality for Ivory Coast.

Changes

Files Summary of Changes
README.md Updated supported country codes count from 161 to 162 and added a new Ivory Coast entry with code CI (with empty subdivisions, languages, and categories).
holidays/countries/init.py Added import statement for IvoryCoast class and its country codes CI, CIV.
holidays/countries/ivory_coast.py Introduced IvoryCoast class, including holiday management methods and aliases CI and CIV.
holidays/registry.py Added entry for "ivory_coast" in the COUNTRIES dictionary, mapping to ("IvoryCoast", "CI", "CIV").
tests/countries/test_ivory_coast.py Created new test file with unit tests for IvoryCoast, including tests for class aliases and holiday dates for 2024.
holidays/groups/islamic.py Added method _add_laylat_al_qadr_day to the IslamicHolidays class for Laylat al-Qadr Day.
holidays/locale/en_US/LC_MESSAGES/CI.po Introduced localization file for Ivory Coast holidays in English with translations for various holidays.
holidays/locale/fr/LC_MESSAGES/CI.po Created localization file for Ivory Coast holidays in French, currently with empty translations.
holidays/locale/en_CI/LC_MESSAGES/CI.po Introduced localization file for Ivory Coast holidays in English (en_CI) with translations for various holidays.
AUTHORS.md Added a new author, Kriti Birda, to the list of contributors.

Assessment against linked issues

Objective Addressed Explanation
Add Ivory Coast holidays (#1166)
Update documentation for new country support (#1166)
Ensure holiday functionality for Ivory Coast (#1166)

Possibly related PRs

  • Add Fiji holidays #2354: The changes in the main PR regarding the addition of Ivory Coast are related to the changes in the retrieved PR, which also involves adding a new country (Fiji) and its associated holiday functionality, as both PRs modify the same file (holidays/countries/__init__.py) to include new imports for country classes.

Suggested labels

snapshot

Suggested reviewers

  • KJhellico
  • PPsyrius

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 57da218 and 38bb146.

📒 Files selected for processing (2)
  • holidays/countries/ivory_coast.py (1 hunks)
  • holidays/groups/islamic.py (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
holidays/groups/islamic.py (2)
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:98-107
Timestamp: 2025-03-30T13:54:34.376Z
Learning: In the Islamic calendar, days begin at sunset rather than midnight. For holidays like "Lendemain de la Nuit du Destin" (Day after Night of Destiny) in Ivory Coast, the name refers to the daylight hours following the night of Laylat al-Qadr (27th of Ramadan). The implementation uses `_add_laylat_al_qadr_day` which correctly calculates this as the 27th day of Ramadan in the Gregorian calendar.
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: tests/countries/test_ivory_coast.py:26-43
Timestamp: 2025-03-30T08:19:34.517Z
Learning: In Ivory Coast, Laylat al-Qadr (Night of Destiny) is observed on the actual day (27th of Ramadan) rather than the day after, with March 27, 2025 being the official holiday date for that year.
holidays/countries/ivory_coast.py (5)
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:127-128
Timestamp: 2025-03-30T18:22:11.939Z
Learning: The IvoryCoast class in holidays/countries/ivory_coast.py already includes documentation in its class docstring explaining the "day after" naming convention for Islamic holidays, noting that in the Islamic calendar, days begin at sunset and the "day after" refers to daylight hours following the night of celebration.
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:84-85
Timestamp: 2025-03-30T08:08:31.656Z
Learning: Islamic holiday logic should be implemented in the holidays/groups/islamic.py file, with country-specific files only calling these methods with the appropriate translated names.
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:98-107
Timestamp: 2025-03-30T13:54:34.376Z
Learning: In the Islamic calendar, days begin at sunset rather than midnight. For holidays like "Lendemain de la Nuit du Destin" (Day after Night of Destiny) in Ivory Coast, the name refers to the daylight hours following the night of Laylat al-Qadr (27th of Ramadan). The implementation uses `_add_laylat_al_qadr_day` which correctly calculates this as the 27th day of Ramadan in the Gregorian calendar.
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: tests/countries/test_ivory_coast.py:26-43
Timestamp: 2025-03-30T08:19:34.517Z
Learning: In Ivory Coast, Laylat al-Qadr (Night of Destiny) is observed on the actual day (27th of Ramadan) rather than the day after, with March 27, 2025 being the official holiday date for that year.
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:8-8
Timestamp: 2025-03-29T14:59:41.973Z
Learning: The header with author information is standard across all files in the vacanza/holidays project. The correct email for dr-prodigy is dr.prodigy.github@gmail.com, not dr.prodigy@github.com.
🧬 Code Definitions (2)
holidays/groups/islamic.py (1)
holidays/calendars/islamic.py (1)
  • ramadan_beginning_dates (3708-3709)
holidays/countries/ivory_coast.py (1)
holidays/groups/islamic.py (5)
  • IslamicHolidays (20-416)
  • _add_mawlid_day (319-329)
  • _add_laylat_al_qadr_day (298-307)
  • _add_eid_al_fitr_day (152-163)
  • _add_eid_al_adha_day (109-120)
🔇 Additional comments (26)
holidays/groups/islamic.py (1)

298-307: Method adds proper support for Laylat al-Qadr (Night of Power).

The implementation correctly calculates the 27th day of Ramadan by using a 26-day offset from the beginning of Ramadan. This aligns with Islamic calendar conventions where the Night of Power falls on the 27th night of the 9th month.

holidays/countries/ivory_coast.py (25)

1-12: License header follows project standards.

The license header correctly includes the necessary attribution and copyright information.


13-22: Imports are properly organized.

Good organization of imports with appropriate grouping. The necessary modules for holiday calculations, including Islamic holidays, are correctly imported.


24-27: Class definition inherits from appropriate base classes.

The IvoryCoast class properly inherits from all required base classes including ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, and StaticHolidays.


28-50: Comprehensive docstring with detailed references.

The docstring provides extensive information about Ivory Coast holidays, including:

  • Links to relevant decrees and references
  • Clear explanation of Islamic calendar conventions
  • Information about holiday observation rules

The note about Islamic calendar days beginning at sunset properly clarifies the naming convention for "day after" holidays.


52-62: Country metadata and localization properly defined.

Configuration includes:

  • Country code
  • Default language (French)
  • Appropriate translation strings
  • Starting year based on available decree information
  • Support for multiple languages including English and French

63-77: Constructor initializes all parent classes correctly.

The constructor:

  • Accepts an islamic_show_estimated parameter with appropriate documentation
  • Initializes all parent classes with correct parameters
  • Sets the default observed rule to handle Sunday holidays
  • Contains a helpful comment about Islamic holiday verification against local references

79-82: New Year's Day implemented correctly.

The New Year's Day holiday is added with the proper French name.


83-85: Easter Monday implemented correctly.

The Easter Monday holiday is added with the proper French name.


86-88: Labor Day implemented with observed rule.

Labor Day is correctly implemented with the observed rule to move the holiday to Monday if it falls on Sunday.


89-91: Ascension Day implemented correctly.

The Ascension Day holiday is added with the proper French name.


92-94: Whit Monday implemented correctly.

The Whit Monday holiday is added with the proper French name.


95-97: Independence Day implemented with observed rule.

Independence Day (August 7) is correctly implemented with the observed rule to move the holiday to Monday if it falls on Sunday.


98-100: Assumption Day implemented correctly.

The Assumption Day holiday is added with the proper French name.


101-103: National Peace Day implemented correctly.

The National Peace Day holiday is added with the proper French name.


104-106: All Saints' Day implemented correctly.

The All Saints' Day holiday is added with the proper French name.


107-112: Historical holiday conditionally implemented.

The anniversary of the death of President Felix Houphouet-Boigny is correctly implemented only for years before or equal to 2000.


113-117: Christmas Day implemented with observed rule per decree.

Christmas Day is correctly implemented with the observed rule applied only from 2011 onward, as specified in Decree no. 2011-371.


118-120: Day after Prophet's Birthday implemented correctly.

The implementation correctly uses _add_mawlid_day for this holiday, following the Islamic calendar convention where the "day after" refers to the daylight hours following the night of celebration (as explained in the class docstring).


121-123: Day after Night of Power implemented correctly.

The implementation correctly uses _add_laylat_al_qadr_day for this holiday, following the Islamic calendar convention where the "day after" refers to the daylight hours following the night of celebration (as explained in the class docstring).


124-128: Eid al-Fitr implemented with observed rule per decree.

Eid al-Fitr is correctly implemented with the observed rule applied only from 2012 onward, as specified in Decree no. 2011-371.


129-133: Eid al-Adha implemented with observed rule per decree.

Eid al-Adha is correctly implemented with the observed rule applied only from 2012 onward, as specified in Decree no. 2011-371.


135-137: CI alias defined correctly.

The alias CI is properly defined as a subclass of IvoryCoast.


139-141: CIV alias defined correctly.

The alias CIV is properly defined as a subclass of IvoryCoast.


143-149: Static holidays class with proper documentation.

The IvoryCoastStaticHolidays class is well-documented with references to one-time holidays, including the 2010 Presidential Election and 2024 AFCON victory.


151-156: Special public holidays defined correctly.

The special public holidays dictionary properly includes two one-time holidays:

  1. A public holiday for Presidential election preparation in 2010
  2. A holiday celebrating the 2024 African Cup of Nations victory

Both have proper names and dates.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the test label Mar 29, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a486bf and a4b871d.

📒 Files selected for processing (5)
  • README.md (2 hunks)
  • holidays/countries/__init__.py (1 hunks)
  • holidays/countries/ivory_coast.py (1 hunks)
  • holidays/registry.py (1 hunks)
  • tests/countries/test_ivory_coast.py (1 hunks)
🧰 Additional context used
🧬 Code Definitions (2)
holidays/countries/__init__.py (1)
holidays/countries/ivory_coast.py (3)
  • IvoryCoast (28-95)
  • CI (99-100)
  • CIV (103-104)
tests/countries/test_ivory_coast.py (1)
holidays/countries/ivory_coast.py (3)
  • IvoryCoast (28-95)
  • CI (99-100)
  • CIV (103-104)
🔇 Additional comments (10)
holidays/countries/__init__.py (1)

89-89: Import for Ivory Coast added correctly.

The import statement for the Ivory Coast class and its aliases (CI, CIV) follows the established pattern in the file. This makes the new country implementation accessible through the countries module.

holidays/registry.py (1)

98-98: Registry entry added properly.

The entry for Ivory Coast is correctly added to the COUNTRIES dictionary with appropriate class name and ISO codes (CI, CIV). This follows the same format as other country entries.

README.md (2)

102-102: Country count updated correctly.

The documentation has been updated to reflect the new total of 161 supported country codes, which is accurate after adding Ivory Coast.


662-667: Ivory Coast entry added to the documentation table.

The entry for Ivory Coast has been properly added to the countries table with the correct ISO code (CI). The empty cells for subdivisions, supported languages, and categories are appropriate as these features are not implemented yet.

holidays/countries/ivory_coast.py (3)

28-58: Class definition looks good.

The IvoryCoast class is properly structured with:

  • Appropriate inheritance from required base classes
  • Good documentation with references
  • Correct country code and holiday labels
  • A well-defined constructor with parameter documentation

The implementation follows the project's conventions.


59-71: Secular holidays implementation is correct.

The implementation of secular holidays for Ivory Coast is appropriate:

  • New Year's Day with proper observation rule
  • Labor Day with proper observation rule
  • Independence Day on August 7
  • National Peace Day starting from 1996

The method correctly uses the translation function for all holiday names.


98-104: Country code aliases defined correctly.

The alias classes CI and CIV are correctly implemented, following the project's pattern for providing ISO code aliases for country classes.

tests/countries/test_ivory_coast.py (3)

32-33: Alias testing looks good.

Correctly verifies that CI and CIV are proper aliases for the IvoryCoast class.


28-30: Test setup is appropriate.

The test setup follows the project's standard pattern of inheriting from CommonCountryTests and properly initializes with the IvoryCoast class.


21-24: Imports are correctly structured.

All necessary imports for testing Ivory Coast holidays are present and well organized.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Kriti Birda <164247895+kritibirda26@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a4b871d and 9e4ced9.

📒 Files selected for processing (2)
  • holidays/countries/ivory_coast.py (1 hunks)
  • tests/countries/test_ivory_coast.py (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
tests/countries/test_ivory_coast.py (1)
holidays/countries/ivory_coast.py (3)
  • IvoryCoast (19-86)
  • CI (90-91)
  • CIV (94-95)
🔇 Additional comments (4)
holidays/countries/ivory_coast.py (3)

63-75: Implementation of Christian holidays looks good.

The implementation of Christian holidays is complete and includes all relevant holidays for Ivory Coast: Easter Monday, Ascension Day, Pentecost Monday, Assumption Day, All Saints' Day, and Christmas Day.


77-84: Implementation of Islamic holidays is correct.

The Islamic holiday implementation includes the three main Islamic holidays observed in Ivory Coast: Eid al-Fitr, Eid al-Adha, and the Prophet's Birthday.


89-95: Alias implementation looks good.

The country code aliases (CI and CIV) follow the standard pattern used in the library.

tests/countries/test_ivory_coast.py (1)

23-24: Alias testing looks good.

The test correctly verifies the country aliases (CI and CIV) for Ivory Coast.

Copy link
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kritibirda26, it's a very good start! Please look at these suggestions.

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Signed-off-by: Kriti Birda <164247895+kritibirda26@users.noreply.github.com>
@KJhellico KJhellico mentioned this pull request Mar 29, 2025
add more tests, localize holidays, and laylat al-qadr.
@github-actions github-actions bot added the l10n label Mar 30, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ddf9204 and 68f2416.

📒 Files selected for processing (6)
  • README.md (2 hunks)
  • holidays/countries/ivory_coast.py (1 hunks)
  • holidays/groups/islamic.py (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/CI.po (1 hunks)
  • holidays/locale/fr/LC_MESSAGES/CI.po (1 hunks)
  • tests/countries/test_ivory_coast.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
holidays/countries/ivory_coast.py (1)
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:8-8
Timestamp: 2025-03-29T14:59:41.973Z
Learning: The header with author information is standard across all files in the vacanza/holidays project. The correct email for dr-prodigy is dr.prodigy.github@gmail.com, not dr.prodigy@github.com.
🧬 Code Definitions (2)
holidays/countries/ivory_coast.py (1)
holidays/groups/islamic.py (5)
  • IslamicHolidays (20-416)
  • _add_eid_al_fitr_day (152-163)
  • _add_eid_al_adha_day (109-120)
  • _add_mawlid_day (319-329)
  • _add_laylat_al_qadr_day (298-307)
tests/countries/test_ivory_coast.py (1)
holidays/countries/ivory_coast.py (3)
  • IvoryCoast (18-85)
  • CI (89-90)
  • CIV (93-94)
🔇 Additional comments (14)
README.md (2)

102-102: Accurate country count update.

The count has been correctly updated from 160 to 161 to reflect the addition of Ivory Coast.


661-667: Clear and consistent country entry addition.

The Ivory Coast entry follows the established table format, correctly specifying "CI" as the ISO code and indicating supported languages (en_US, fr) with French set as the default language.

holidays/locale/en_US/LC_MESSAGES/CI.po (2)

1-27: Well-formed localization file header.

The file header contains all necessary metadata including proper project information, date formatting, and language specification.


28-84: Complete holiday translations with appropriate categorization.

All holiday translations from French to English are accurate and properly categorized as Secular, Christian, or Islamic holidays. The translations include important holidays like Independence Day, Easter Monday, and Eid al-Fitr.

holidays/locale/fr/LC_MESSAGES/CI.po (2)

1-27: Well-structured French localization file header.

The file header correctly specifies French (fr) as the language and follows the standard PO file format.


28-83: Empty message strings are appropriate for source language.

The empty msgstr fields are intentional and correct since French is the source language for Ivory Coast holidays. The msgid values already contain the proper French holiday names.

holidays/groups/islamic.py (1)

298-308: Well-implemented Islamic holiday method.

The _add_laylat_al_qadr_day method correctly implements the Night of Power holiday (27th day of Ramadan) using the established pattern of other Islamic holiday methods. The documentation includes a clear description and relevant Wikipedia link.

holidays/countries/ivory_coast.py (6)

28-35: LGTM: Well-defined country properties.

The country code, labels, start year, and language support are correctly configured. The 1960 start year properly reflects Ivory Coast's independence date.


37-48: LGTM: Constructor implementation is correct.

The constructor properly initializes all parent classes and correctly sets up the observed rule for holidays falling on Sundays.


52-61: LGTM: Secular holidays are implemented correctly.

The implementation of New Year's Day, Labor Day, Independence Day, and National Peace Day (with proper conditional logic for its 1996 introduction) is accurate.


63-75: LGTM: Christian holidays implementation is correct.

All Christian holidays are properly implemented with appropriate French translations.


77-83: LGTM: Islamic holidays implementation is mostly correct.

The implementation of Eid al-Fitr, Eid al-Adha, and the Prophet's Birthday is correct with appropriate French translations.


88-94: LGTM: Country code aliases are correctly defined.

The aliases CI and CIV are properly implemented as subclasses of IvoryCoast.

tests/countries/test_ivory_coast.py (1)

23-25: LGTM: Country alias tests are correct.

The test correctly verifies that the IvoryCoast class has CI and CIV as aliases.

@PPsyrius PPsyrius changed the title Add public holidays for Ivory Coast (#1166) Add Ivory Coast holidays Mar 30, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🔭 Outside diff range comments (1)
tests/countries/test_ivory_coast.py (1)

134-136: ⚠️ Potential issue

Update test for Laylat al-Qadr.

The test for Laylat al-Qadr needs to be updated if the implementation is changed to "Day After Laylat al-Qadr".

Update the test to verify the correct holiday name and add multiple years:

def test_laylat_al_qadr(self):
-    self.assertHolidayName("Nuit du Destin (Lailatou-Kadr) (estimé)", "2025-03-27")
+    self.assertHolidayName(
+        "Lendemain de la Nuit du Destin (Lailatou-Kadr) (estimé)",
+        "2022-04-28",
+        "2023-04-18", 
+        "2024-04-06",
+        "2025-03-28"
+    )
♻️ Duplicate comments (1)
tests/countries/test_ivory_coast.py (1)

26-43: ⚠️ Potential issue

Update holiday dates test for 2025.

The test for 2025 needs to be updated if the "Day After Laylat al-Qadr" implementation is changed.

Update the date in the test to match the day after Laylat al-Qadr:

def test_2025(self):
    self.assertHolidayDates(
        IvoryCoast(years=2025),
        "2025-01-01",
-       "2025-03-27",
+       "2025-03-28",
        "2025-03-30",
        "2025-04-21",
        "2025-05-01",
        "2025-05-29",
        "2025-06-06",
        "2025-06-09",
        "2025-08-07",
        "2025-08-15",
        "2025-09-04",
        "2025-11-01",
        "2025-11-15",
        "2025-12-25",
    )
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 68f2416 and a8b6506.

📒 Files selected for processing (4)
  • holidays/countries/ivory_coast.py (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/CI.po (1 hunks)
  • holidays/locale/fr/LC_MESSAGES/CI.po (1 hunks)
  • tests/countries/test_ivory_coast.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
holidays/countries/ivory_coast.py (1)
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:8-8
Timestamp: 2025-03-29T14:59:41.973Z
Learning: The header with author information is standard across all files in the vacanza/holidays project. The correct email for dr-prodigy is dr.prodigy.github@gmail.com, not dr.prodigy@github.com.
🧬 Code Definitions (2)
holidays/countries/ivory_coast.py (1)
holidays/groups/islamic.py (5)
  • IslamicHolidays (20-416)
  • _add_eid_al_fitr_day (152-163)
  • _add_eid_al_adha_day (109-120)
  • _add_mawlid_day (319-329)
  • _add_laylat_al_qadr_day (298-307)
tests/countries/test_ivory_coast.py (1)
holidays/countries/ivory_coast.py (3)
  • IvoryCoast (18-85)
  • CI (89-90)
  • CIV (93-94)
🔇 Additional comments (19)
holidays/locale/en_US/LC_MESSAGES/CI.po (6)

1-27: Excellent project metadata and header setup.

The header includes comprehensive project information, author details, and licensing information. The locale is correctly set for English (en_US) translation of Ivory Coast holidays with French as the source language.


28-39: Appropriate translations for secular holidays.

Translations for New Year's Day, Labor Day, and Independence Day are accurate and maintain proper formatting. The superscript notation in "1ˢᵗ January" preserves the style of the original French "1ᵉʳ janvier".


40-44: Well-documented National Peace Day.

Excellent historical context provided in the comments for the National Peace Day holiday, including its introduction year and a reference link. The translation is accurate.


45-64: Appropriate translations for Christian holidays.

All Christian holiday translations (Easter Monday, Pentecost Monday, Assumption Day, All Saints' Day, and Christmas Day) are correct and consistent with standard English terminology for these religious observances.


81-96: LGTM: Proper translation of formatted labels.

The translations for estimated, observed, and combined labels are accurate and maintain the placeholder formatting needed for dynamic holiday names.


65-80:

✅ Verification successful

Verify the translation for Laylat al-Qadr holiday.

The current translation for "Nuit du Destin (Lailatou-Kadr)" is "Night of Destiny", which correctly translates the concept. Based on previous review discussions, note that in the Ivory Coast, both the night itself and the day after are observed.


🌐 Web query:

Is both "Night of Destiny" (Laylat al-Qadr) and the "Day after Night of Destiny" observed as holidays in Ivory Coast?

💡 Result:

In Ivory Coast, the Day after Lailat al-Qadr (also called Day after Laila tou-Kadr) is recognized as a public holiday, while Laylat al-Qadr (Night of Destiny) itself is not a formal public holiday but holds significant religious observance.

Key Details:

  • Laylat al-Qadr (Night of Destiny):
    This Islamic holy night, marking the revelation of the Quran, is observed during the last ten days of Ramadan. While it is a major religious event[1][10], it is not listed as an official public holiday in Ivory Coast's government schedules[2][6][12].

  • Day after Lailat al-Qadr:
    This day is a formal public holiday in Ivory Coast, with schools, businesses, and government offices closed[2][6][12][18]. In 2025, it falls on March 27, 2025[1][12]. The holiday follows the Islamic calendar and commemorates the conclusion of the Night of Power.

Observance Practices:

  • On Laylat al-Qadr, Muslims engage in prayers, Quran recitation, and charitable acts, though these activities are part of religious observance rather than a mandated day off[4][10].
  • The public holiday the following day allows for extended reflection and community gatherings[7][16].

Summary:

While the Night of Destiny is a pivotal religious occasion, only the Day after Lailat al-Qadr is officially designated as a public holiday in Ivory Coast[2][18].

Citations:


Translation Verification for Laylat al-Qadr

The current translation for

msgid "Nuit du Destin (Lailatou-Kadr)"
msgstr "Night of Destiny"

is correct with respect to translating the religious concept of Laylat al-Qadr. However, based on the latest information:

  • Laylat al-Qadr (Night of Destiny): While this is a pivotal religious observance correctly rendered, it is not designated as an official public holiday in the Ivory Coast.
  • Observation in Ivory Coast: The official public holiday is observed on the day after Laylat al-Qadr. It's important to ensure that the translation is applied consistently—if the intention is to denote a public holiday, consider whether a different labeling or additional context is needed.

No modifications are required to the translation itself if it is meant to represent the religious observance. Just double-check that its usage in the application appropriately reflects whether it refers to the religious event or the public holiday.

holidays/locale/fr/LC_MESSAGES/CI.po (2)

1-27: Correct metadata setup for French localization.

The header information and metadata are properly set up for the French localization file, with French correctly designated as both the source and target language.


28-95: Empty message strings are appropriate for the native language.

All message strings (msgstr) are intentionally left empty, which is the correct approach since French is the native language of Ivory Coast. This means the original French holiday names (msgid) will be used without translation when the locale is set to French.

holidays/countries/ivory_coast.py (7)

1-12: Standard header and license information maintained.

The header follows the project's standard format with correct author information and licensing details.


14-16: Appropriate imports for holiday implementation.

The imports correctly include all necessary base classes for implementing Ivory Coast holidays, including Christian, Islamic, and International holiday groups.


18-36: Well-documented class definition with comprehensive references.

The IvoryCoast class has:

  • Clear docstring with multiple official references
  • Proper country code "CI"
  • Translated labels for estimated and observed holidays
  • Correct start year (1960, when Ivory Coast gained independence)
  • Appropriate language support (French as default with English translation)

37-48: Correct initialization with appropriate configurations.

The initialization properly:

  • Initializes all parent classes
  • Provides option for showing estimated labels for Islamic holidays
  • Sets the default observed rule to move Sunday holidays to Monday

50-62: Comprehensive implementation of secular holidays.

The secular holidays are implemented correctly:

  • New Year's Day (January 1)
  • Labor Day (May 1) with observed rule
  • Independence Day (August 7) with observed rule
  • National Peace Day (November 15) with correct conditional check for years from 1996 onward

63-76: Complete Christian holidays implementation.

All major Christian holidays observed in Ivory Coast are properly implemented with correct French names:

  • Easter Monday
  • Ascension Thursday
  • Whit Monday (Pentecost Monday)
  • Assumption Day
  • All Saints' Day
  • Christmas Day

88-95: Appropriate country code aliases.

The class aliases CI and CIV are correctly implemented, following the ISO 3166-1 standard for country codes (2-letter and 3-letter codes for Ivory Coast).

tests/countries/test_ivory_coast.py (4)

1-25: Well-structured test class setup.

The test class correctly:

  • Inherits from CommonCountryTests and TestCase
  • Sets up the IvoryCoast class for testing with years from 1960 to 2050
  • Tests the country aliases CI and CIV

45-61: Thorough tests for secular holidays.

The tests for New Year's Day, Labor Day, Independence Day, and National Peace Day are comprehensive:

  • Tests across multiple years
  • Verifies observed dates for holidays falling on Sunday
  • Correctly tests that National Peace Day only occurs from 1996 onward

62-102: Comprehensive tests for Christian holidays.

The tests for Easter Monday, Ascension Day, Whit Monday, Assumption Day, All Saints' Day, and Christmas Day are well-implemented:

  • Moving holidays are tested with specific dates across multiple years
  • Fixed-date holidays are tested across the full range of years

103-133: Thorough tests for Islamic holidays.

The tests for Eid al-Fitr, Eid al-Adha, and Mawlid are well-implemented with:

  • Verification of correct holiday names including the "(estimé)" label
  • Multiple years to account for the shifting Islamic calendar

Copy link
Collaborator

@PPsyrius PPsyrius left a 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 contributors and new countries being implemented. some suggestions here 👍

Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Signed-off-by: Kriti Birda <164247895+kritibirda26@users.noreply.github.com>
@PPsyrius
Copy link
Collaborator

PPsyrius commented Mar 30, 2025

StaticHolidays may also be required for special one-time holidays, such as https://apanews.net/public-holiday-as-cote-divoire-wins-afcon-trophy/ - for comprehensive examples see Indonesia's implementation

from holidays.groups import StaticHolidays

In def __init__:

        StaticHolidays.__init__(self, IvoryCoastStaticHolidays)

At the end of the file:

class IvoryCoastStaticHolidays:
    """Ivory Coast Special Holidays.

       * [2024 AFCON](https://apanews.net/public-holiday-as-cote-divoire-wins-afcon-trophy/)
    """

    special_public_holidays = {
        # 2024 African Cup of Nations Victory.
        2024: (FEB, 12, tr("Victoire à la Coupe d’Afrique des Nations 2024")),
    }

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a8b6506 and 5794287.

📒 Files selected for processing (8)
  • README.md (2 hunks)
  • holidays/countries/__init__.py (1 hunks)
  • holidays/countries/ivory_coast.py (1 hunks)
  • holidays/locale/en_CI/LC_MESSAGES/CI.po (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/CI.po (1 hunks)
  • holidays/locale/fr/LC_MESSAGES/CI.po (1 hunks)
  • holidays/registry.py (1 hunks)
  • tests/countries/test_ivory_coast.py (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
holidays/countries/ivory_coast.py (3)
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:84-85
Timestamp: 2025-03-30T08:08:31.656Z
Learning: Islamic holiday logic should be implemented in the holidays/groups/islamic.py file, with country-specific files only calling these methods with the appropriate translated names.
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: tests/countries/test_ivory_coast.py:26-43
Timestamp: 2025-03-30T08:19:34.517Z
Learning: In Ivory Coast, Laylat al-Qadr (Night of Destiny) is observed on the actual day (27th of Ramadan) rather than the day after, with March 27, 2025 being the official holiday date for that year.
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:8-8
Timestamp: 2025-03-29T14:59:41.973Z
Learning: The header with author information is standard across all files in the vacanza/holidays project. The correct email for dr-prodigy is dr.prodigy.github@gmail.com, not dr.prodigy@github.com.
tests/countries/test_ivory_coast.py (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: tests/countries/test_ivory_coast.py:26-43
Timestamp: 2025-03-30T08:19:34.517Z
Learning: In Ivory Coast, Laylat al-Qadr (Night of Destiny) is observed on the actual day (27th of Ramadan) rather than the day after, with March 27, 2025 being the official holiday date for that year.
🧬 Code Definitions (3)
holidays/countries/__init__.py (1)
holidays/countries/ivory_coast.py (3)
  • IvoryCoast (24-107)
  • CI (111-112)
  • CIV (115-116)
holidays/countries/ivory_coast.py (1)
holidays/groups/islamic.py (5)
  • IslamicHolidays (20-416)
  • _add_eid_al_fitr_day (152-163)
  • _add_eid_al_adha_day (109-120)
  • _add_mawlid_day (319-329)
  • _add_laylat_al_qadr_day (298-307)
tests/countries/test_ivory_coast.py (1)
holidays/countries/ivory_coast.py (3)
  • IvoryCoast (24-107)
  • CI (111-112)
  • CIV (115-116)
🔇 Additional comments (22)
holidays/countries/__init__.py (1)

90-90: Clean integration of Ivory Coast module.

The import follows the established pattern for adding a new country. Properly includes both the main class and country code aliases.

README.md (2)

102-102: Correctly updated country count.

The supported country count has been incremented from 161 to 162, accurately reflecting the addition of Ivory Coast.


669-674: Ivory Coast entry properly formatted.

The table entry follows the same pattern as other countries, with correctly formatted supported languages (default language in bold) and appropriate country code.

holidays/registry.py (1)

99-99: Registry entry follows established pattern.

The Ivory Coast entry maintains alphabetical ordering and follows the same format as other countries, with the main class name and ISO codes properly defined.

holidays/locale/en_CI/LC_MESSAGES/CI.po (1)

1-102: Well-structured localization file with comprehensive translations.

The file includes all necessary holiday translations with appropriate comments for context. I especially appreciate the inclusion of the 2024 AFCON victory holiday translation, implementing the suggestion from PPsyrius.

Note that some Islamic holiday translations use specific local naming conventions (e.g., "Aid-EI-Fitr" instead of "Eid al-Fitr"), which appropriately reflects local terminology.

holidays/locale/en_US/LC_MESSAGES/CI.po (2)

1-27: Excellent job on the localization file setup.

You've correctly set up the necessary header, metadata, and localization details. I also see you've added your name and email to the "Last-Translator" field as suggested in a previous review.


28-101: Great comprehensive holiday translations.

All holiday translations are accurate and complete. Good work including both secular, Christian, and Islamic holidays with their appropriate English translations.

holidays/locale/fr/LC_MESSAGES/CI.po (1)

1-27: Correctly structured localization file for French.

The header and metadata are properly configured for French localization.

holidays/countries/ivory_coast.py (7)

1-20: Well-structured file header and import section.

The file includes the standard header and necessary imports for holiday implementations.


24-46: Complete class definition with proper documentation.

The IvoryCoast class is well-documented with references and includes all required attributes. The supported languages list correctly includes "en_CI", "en_US", and "fr" as required.


50-64: Proper initialization with appropriate holiday types.

The constructor initializes all necessary holiday base classes and sets the correct observed rule for the country.


66-82: Correct implementation of secular holidays.

Secular holidays are properly implemented with the observed rule applied where appropriate. The conditional check for National Peace Day (introduced in 1996) is a good attention to detail.


83-96: Christian holidays implementation is complete.

All Christian holidays are properly implemented with their French names.


110-117: Class aliases are correct.

The CI and CIV aliases are properly defined.


119-128: Excellent implementation of special holiday.

The special holiday for the 2024 African Cup of Nations victory is correctly implemented using the StaticHolidays mechanism as suggested in the PR comments.

tests/countries/test_ivory_coast.py (7)

1-16: Well-structured test file header and imports.

The file includes the standard header and necessary imports for testing.


18-25: Test class setup is correct.

The test class properly inherits from CommonCountryTests and TestCase, and the setUpClass method is correctly implemented. The test for country aliases verifies both CI and CIV aliases.


26-46: Comprehensive test for 2025 holidays.

The test verifies all expected holidays for 2025, including their correct names and dates. This provides good coverage for verifying the implementation.


48-105: Good coverage of secular and Christian holidays.

The tests for New Year's Day, Labor Day, Independence Day, National Peace Day, and all Christian holidays are thorough and include appropriate date checks.


106-134: Comprehensive tests for Islamic holidays.

The tests for Eid al-Fitr, Eid al-Adha, and Mawlid cover multiple years and verify the estimated label is properly applied.


136-144: Laylat al-Qadr test is correct but naming may cause confusion.

The test correctly checks that "Lendemain de la Nuit du Destin (estimé)" is observed on specific dates (e.g., 2025-03-27), which aligns with how Ivory Coast observes this holiday on the 27th of Ramadan.

Note that despite the name suggesting it's the "day after", the holiday is actually observed on the Night of Destiny itself. This is consistent with the implementation but might confuse future contributors.


146-148: Static holiday test is correctly implemented.

The test verifies the 2024 African Cup of Nations victory holiday is present in 2024 but absent in 2025.

Copy link

codecov bot commented Mar 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4d89284) to head (38bb146).
⚠️ Report is 336 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2388   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          205       206    +1     
  Lines        13054     13109   +55     
  Branches      1869      1875    +6     
=========================================
+ Hits         13054     13109   +55     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're almost there 👍

Copy link

@arkid15r arkid15r enabled auto-merge March 31, 2025 19:09
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Thanks for awesome contribution @kritibirda26

@arkid15r arkid15r added this pull request to the merge queue Apr 1, 2025
Merged via the queue into vacanza:dev with commit 78bf7e9 Apr 1, 2025
33 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Apr 1, 2025
9 tasks
@KJhellico KJhellico mentioned this pull request Apr 1, 2025
This was referenced Apr 1, 2025
This was referenced Apr 7, 2025
@KJhellico KJhellico mentioned this pull request Apr 8, 2025
9 tasks
@kritibirda26 kritibirda26 deleted the ivory-coast branch June 8, 2025 08:20
@coderabbitai coderabbitai bot mentioned this pull request Jul 9, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Ivory Coast holidays

4 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载