Skip to content

Conversation

kritibirda26
Copy link
Contributor

Proposed change

Add holidays for Suriname (en_US, nl).

Resolves #1274.

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 Apr 12, 2025

Summary by CodeRabbit

  • New Features

    • Added support for Suriname holidays, including public, Hindu, and Islamic holidays.
    • Suriname is now included in the list of supported countries with codes SR and SUR.
  • Localization

    • Introduced Dutch and English translations for Suriname holiday names.
  • Documentation

    • Updated documentation to reflect support for Suriname and increased the supported country count to 166.
  • Tests

    • Added comprehensive tests to ensure correct holiday calculations and translations for Suriname.

Summary by CodeRabbit

  • New Features

    • Added comprehensive holiday support for Suriname, including local holiday rules and observances.
  • Documentation

    • Updated the supported country list to include Suriname, increasing the total from 165 to 166 countries.
  • Tests

    • Introduced extensive tests to verify holiday calculations and localization for Suriname.

Walkthrough

The pull request integrates Suriname into the holidays library, increasing the supported country count from 165 to 166. It updates the README to include Suriname and its details. A new module for Suriname is created with holiday definitions, including public, Hindu, and Islamic holidays. The initialization and registry files are modified to recognize Suriname, and new localization files for English and Dutch are added. Additionally, a comprehensive test suite is introduced to validate the functionality and translations for Suriname.

Changes

Files Change Summary
README.md Updated supported country code count (from 165 to 166) and added a new table entry for Suriname with ISO code "SR" and locales en_US, nl.
holidays/countries/init.py, holidays/registry.py Integrated Suriname by adding an import in __init__.py and updating the COUNTRIES dictionary with ("Suriname", "SR", "SUR").
holidays/countries/suriname.py New file defining the Suriname holiday rules and classes: Suriname, SurinameHinduHolidays, SurinameIslamicHolidays, SR, and SUR.
holidays/locale/en_US/LC_MESSAGES/SR.po, holidays/locale/nl/LC_MESSAGES/SR.po Added new localization files for Suriname holidays for English and Dutch.
tests/countries/test_suriname.py Introduced a comprehensive test suite to validate Suriname holiday functionality and localization.

Assessment against linked issues

Objective Addressed Explanation
Add Suriname holidays (#1274)

Suggested labels

script

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 900cfc1 and 6b429a4.

📒 Files selected for processing (1)
  • tests/countries/test_suriname.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
tests/countries/test_suriname.py (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
🔇 Additional comments (22)
tests/countries/test_suriname.py (22)

1-17: Well-structured imports and license header.

The license header and imports follow the project's standard format. Good job including all necessary imports for testing Suriname holidays.


19-25: Appropriate test class setup.

The class definition and setup properly initialize the test date range from 1972 to 2050, which covers the full range of holiday observations. The creation of no_estimated_holidays instance for Islamic holidays is a good practice.


26-31: Correct country code validation and boundary testing.

The alias test verifies that Suriname can be properly accessed through its ISO codes. The "no holidays" test appropriately checks that no holidays are returned before the start year (1971).


32-34: Fixed date holiday testing looks good.

The test follows the established pattern for testing fixed date holidays with a proper date range generator.


35-41: Comprehensive testing of conditional holiday.

The test correctly validates that "Dag van Bevrijding en Vernieuwing" is only observed during specific periods (1981-1993 and 2012-2021), and not observed in other years. The assertion structure follows project conventions.


42-55: Well-structured movable holiday test.

The test for Holi-Phagwa follows the project pattern of first listing specific known dates and then performing a range assertion. This covers both the specific test cases and ensures the holiday exists for all years in the range.


56-67: Good Friday test is properly structured.

The test follows the same pattern as other movable holidays, with specific dates followed by a range check.


68-79: Easter Monday test is properly structured.

The test correctly validates Easter Monday dates with specific test cases and a range assertion.


80-84: Queen's Birthday boundary testing is correct.

The test properly verifies that the Queen's Birthday holiday was only observed from 1972 to 1976 and not in subsequent years.


85-88: Labor Day test is structurally sound.

The test correctly verifies that Labor Day is observed on May 1st throughout the entire test period.


90-99: Name change handling is correctly implemented.

The test properly handles the name change from "Dag der Vrijheden" to "Keti Koti Dey" between 2008 and 2025, with appropriate assertions for both presence and absence of each name during the relevant periods.


100-104: Indigenous People Day boundary testing is accurate.

The test correctly verifies this holiday's introduction in 2007 and its continued observance through 2050.


105-109: Day of the Maroons boundary testing is properly implemented.

The test verifies this holiday's introduction in 2012 and its continued observance through 2050.


110-123: Comprehensive Diwali test.

The test thoroughly validates both specific Diwali dates and the holiday's introduction in 2012, with appropriate verification that it wasn't observed before that year.


124-131: Republic/Independence Day name change is properly tested.

The test correctly handles the name change from "Dag van de Republiek" to "Onafhankelijkheidsdag" in 2008, with proper verification of both name presence and absence during relevant periods.


132-137: Christmas holidays tests are correctly implemented.

The tests for both Christmas Day and Second Day of Christmas use the appropriate date range generators.


138-151: Eid al-Fitr test uses proper Islamic holiday handling.

The test correctly uses the no_estimated_holidays instance to verify dates without estimation, and includes specific test dates along with a proper range assertion.


152-166: Eid al-Adha test is comprehensive.

The test properly verifies specific dates, its introduction in 2012, and uses the no_estimated_holidays instance appropriately for Islamic holiday testing.


167-178: Chinese New Year test is correctly structured.

The test verifies both specific known dates and the holiday's introduction in 2022.


179-197: Year-specific test is thorough.

The test for 2024 validates all expected holidays for that year, providing a good integration test in addition to the individual holiday tests.


199-216: Default localization test is comprehensive.

The test verifies that all 2025 holidays have the correct names in the default locale.


218-236: English localization test is well-structured.

The test verifies that all holidays have the correct English translations, which is important for internationalization support.

✨ 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.

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

🔭 Outside diff range comments (1)
holidays/locale/nl/LC_MESSAGES/SR.po (1)

15-115: ⚠️ Potential issue

Missing Dutch translations in the localization file

The Dutch localization file has been created with the proper structure and message IDs, but all translation strings are empty. This means Dutch users will see untranslated holiday names.

Consider adding the actual Dutch translations for all the message entries before merging this PR, as Dutch is set as the default language for Suriname in the implementation.

-msgstr ""
+msgstr "Nieuwjaarsdag"

Apply similar changes for all other entries in this file.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1448815 and a69a14c.

📒 Files selected for processing (7)
  • README.md (2 hunks)
  • holidays/countries/__init__.py (1 hunks)
  • holidays/countries/suriname.py (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/SR.po (1 hunks)
  • holidays/locale/nl/LC_MESSAGES/SR.po (1 hunks)
  • holidays/registry.py (1 hunks)
  • tests/countries/test_suriname.py (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
holidays/countries/__init__.py (1)
holidays/countries/suriname.py (3)
  • Suriname (27-166)
  • SR (256-257)
  • SUR (260-261)
holidays/countries/suriname.py (7)
holidays/calendars/hindu.py (1)
  • _CustomHinduHolidays (1305-1306)
holidays/calendars/islamic.py (1)
  • _CustomIslamicHolidays (3881-3882)
holidays/groups/chinese.py (2)
  • ChineseCalendarHolidays (21-264)
  • _add_chinese_new_years_day (133-143)
holidays/groups/hindu.py (3)
  • HinduCalendarHolidays (21-319)
  • _add_holi (178-187)
  • _add_diwali (87-97)
holidays/groups/international.py (3)
  • InternationalHolidays (18-220)
  • _add_new_years_day (126-134)
  • _add_labor_day (99-108)
holidays/groups/islamic.py (3)
  • IslamicHolidays (20-416)
  • _add_eid_al_fitr_day (152-163)
  • _add_eid_al_adha_day (109-120)
holidays/observed_holiday_base.py (1)
  • ObservedHolidayBase (101-239)
🔇 Additional comments (32)
holidays/registry.py (1)

164-164: Clean addition of Suriname to the countries registry

The entry for Suriname follows the established pattern in the COUNTRIES dictionary with the country name and proper ISO codes. Good job on maintaining consistency.

holidays/countries/__init__.py (1)

156-156: Properly integrated Suriname import

The import statement for Suriname and its ISO code aliases (SR, SUR) follows the consistent pattern used for other countries in the file. This ensures Suriname will be properly available through the module's API.

README.md (2)

102-102: Updated country count reflects Suriname addition.

The country count has been correctly updated from 165 to 166 to reflect the addition of Suriname.


1132-1137: Suriname entry follows consistent table format.

The new entry for Suriname has been properly formatted with country name, ISO code, supported languages (en_US, nl), and appropriate boldface for the default language (nl).

tests/countries/test_suriname.py (21)

18-24: Test class setup follows project conventions.

The TestSuriname class properly inherits from CommonCountryTests and TestCase, with appropriate setup for years 1972-2050, matching the start_year defined in the implementation.


25-27: Country aliases correctly tested.

Test properly verifies that SR and SUR are valid aliases for Suriname.


28-30: Empty year validation is correct.

Test ensures that no holidays exist for years before the start_year (1972).


31-41: New Year's Day and observed day tests look complete.

Test validates both the holiday name and the observed day logic (when New Year's Day falls on a weekend).


42-48: Day of Liberation and Renewal time periods are properly tested.

Test correctly verifies that this holiday only exists during specific periods (1981-1992 and 2012-2020), reflecting changes in Suriname's holiday policies.


49-65: Holi test covers specific dates and observed days.

Test properly validates Holi dates from 2019 to 2025 and observed days when Holi falls on weekends.


66-89: Easter-related holiday tests are comprehensive.

Both Good Friday and Easter Monday tests correctly verify holiday dates across multiple years.


90-94: Queen's Birthday historical test is accurate.

Test verifies that Queen's Birthday was only observed from 1972 to 1975.


95-105: Labor Day test includes observed days check.

Test properly validates both the holiday and its observed days when falling on weekends.


106-118: Day of Freedoms name change is properly tested.

Test correctly validates the name change from "Dag der Vrijheden" to "Keti Koti Dey" in 2008.


119-132: Indigenous People Day test includes start year and observed days.

Test verifies that this holiday only exists from 2007 onward and includes observed day logic.


133-145: Day of the Maroons test includes start year and observed days.

Test verifies that this holiday only exists from 2012 onward and includes observed day logic.


146-165: Diwali test includes start year, specific dates, and observed days.

Test verifies that Diwali is only observed from 2012 onward, checks specific dates, and validates observed day logic.


166-179: Republic Day name change is properly tested.

Test correctly validates the name change from "Dag van de Republiek" to "Onafhankelijkheidsdag" in 2008 and verifies it only exists from 1976 onward.


180-201: Christmas tests include both days and observed days.

Tests for Christmas Day and Boxing Day properly validate holiday dates and observed day logic.


203-219: Eid al-Fitr test includes specific dates and observed days.

Test properly validates Eid al-Fitr dates from 2019 to 2025 and observed day logic.


220-237: Eid al-Adha test includes start year, specific dates, and observed days.

Test verifies that Eid al-Adha is only observed from 2012 onward, checks specific dates, and validates observed day logic.


238-249: Chinese New Year test includes start year and specific dates.

Test verifies that Chinese New Year is only observed from 2022 onward and checks specific dates.


250-268: 2024 specific test validates all holidays for the current year.

Comprehensive test for 2024 includes all expected holidays with their correct names.


270-291: Dutch localization test is comprehensive.

Test verifies all holiday names in Dutch (the default language) for 2025, including observed days.


292-312: English localization test is comprehensive.

Test verifies all holiday names in English for 2025, including observed days.

holidays/countries/suriname.py (7)

27-59: Class definition and metadata follow project standards.

The Suriname class inherits from appropriate base classes and defines required metadata like country code, default language, and supported languages. Documentation includes official references to Suriname's holiday legislation.


61-77: Constructor initializes all parent classes correctly.

The constructor properly initializes all parent classes with appropriate parameters, including custom Hindu and Islamic holiday classes. The observed rule is set to SAT_SUN_TO_NEXT_WORKDAY as per Suriname's regulations.


78-141: Populate method implements holidays according to documented rules.

Public holidays are correctly implemented with appropriate time periods and observed day logic. The implementation is consistent with the tests and includes historical changes in holiday names and observances.


142-167: Religious holidays are properly implemented.

Hindu, Islamic, and Chinese holidays are correctly implemented with appropriate time periods and observed day logic. The implementation handles the special cases of movable religious holidays.


169-210: Hindu holiday dates are predefined for accuracy.

The SurinameHinduHolidays class includes predefined dates for Holi and Diwali from 2014/2015 to 2030, ensuring accuracy for these movable holidays.


212-254: Islamic holiday dates are predefined for accuracy.

The SurinameIslamicHolidays class includes predefined dates for Eid al-Fitr and Eid al-Adha from 2014 to 2030, ensuring accuracy for these movable holidays.


256-261: Country code aliases follow project conventions.

The SR and SUR classes are defined as aliases for Suriname, following the project's pattern for country code aliases.

Copy link

codecov bot commented Apr 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (df044df) to head (6b429a4).
⚠️ Report is 301 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2465   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          210       211    +1     
  Lines        13351     13408   +57     
  Branches      1911      1919    +8     
=========================================
+ Hits         13351     13408   +57     

☔ 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

@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 great research! Take a look at a few comments and suggestions, please.

Co-authored-by: ~Jhellico <KJhellico@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 711d326 and 26c18ef.

📒 Files selected for processing (1)
  • holidays/countries/suriname.py (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
holidays/countries/suriname.py (8)
holidays/calendars/hindu.py (1)
  • _CustomHinduHolidays (1305-1306)
holidays/calendars/islamic.py (1)
  • _CustomIslamicHolidays (3881-3882)
holidays/groups/chinese.py (2)
  • ChineseCalendarHolidays (21-264)
  • _add_chinese_new_years_day (133-143)
holidays/groups/christian.py (5)
  • ChristianHolidays (22-463)
  • _add_good_friday (308-317)
  • _add_easter_monday (259-268)
  • _add_christmas_day (208-216)
  • _add_christmas_day_two (218-226)
holidays/groups/hindu.py (3)
  • HinduCalendarHolidays (21-319)
  • _add_holi (178-187)
  • _add_diwali (87-97)
holidays/groups/international.py (3)
  • InternationalHolidays (18-220)
  • _add_new_years_day (126-134)
  • _add_labor_day (99-108)
holidays/groups/islamic.py (3)
  • IslamicHolidays (20-416)
  • _add_eid_al_fitr_day (152-163)
  • _add_eid_al_adha_day (109-120)
holidays/observed_holiday_base.py (1)
  • ObservedHolidayBase (101-239)
🪛 Ruff (0.8.2)
holidays/countries/suriname.py

16-16: holidays.calendars.gregorian.FEB imported but unused

Remove unused import: holidays.calendars.gregorian.FEB

(F401)


128-128: Local variable name is assigned to but never used

Remove assignment to unused variable name

(F841)

Co-authored-by: ~Jhellico <KJhellico@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: 5

♻️ Duplicate comments (1)
holidays/locale/nl/LC_MESSAGES/SR.po (1)

13-13: This comment matches the suggested fix.

The header comment now uses the correct format as previously suggested.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 26c18ef and 5f69b67.

📒 Files selected for processing (2)
  • holidays/locale/nl/LC_MESSAGES/SR.po (1 hunks)
  • tests/countries/test_suriname.py (1 hunks)
🔇 Additional comments (7)
holidays/locale/nl/LC_MESSAGES/SR.po (1)

17-21: Check the creation date and author information.

The file shows a creation date of April 12, 2025, which may be in the future depending on when this PR is merged. Consider updating to the actual date of creation.

tests/countries/test_suriname.py (6)

21-23: Solid test setup with comprehensive year coverage.

The test suite is set up to test holidays from 1972 to 2050, providing excellent coverage of historical and future holidays.


107-117: Well-structured test for renamed holiday.

The test properly accounts for the holiday name change from "Dag der Vrijheden" to "Keti Koti Dey" in 2008.


167-178: Multiple holiday name tests with observed periods.

The test correctly handles the change from "Dag van de Republiek" to "Onafhankelijkheidsdag" in 2008, and properly tests the day after observation.


250-268: Comprehensive 2024 holiday test.

The test for 2024 holidays provides a good validation of the entire holiday set for the current year.


270-289: Thorough default localization test.

The default localization test validates all holidays for 2025 including the "day after" cases where holidays observed on weekends cause an additional holiday on the following weekday.


291-311: Complete English localization test.

The English localization test ensures that all holiday names are correctly translated, matching the translations defined in the locale files.

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

♻️ Duplicate comments (7)
holidays/locale/nl/LC_MESSAGES/SR.po (3)

73-74: 🧹 Nitpick (assertive)

Consistency in holiday naming.

The "Keti Koti Dey" message uses a different naming convention than most other holidays (with "Dey" instead of "dag"). Consider using consistent naming patterns across all holidays.


101-102: 🧹 Nitpick (assertive)

Inconsistent spacing in holiday names.

"Divali dag" uses a different spacing pattern than other holidays like "Holi-dag" (line 97) or "Id-ul-Fitr dag" (line 105). Consider standardizing the format.

-msgid "Divali dag"
+msgid "Divali-dag"

49-50: ⚠️ Potential issue

Typo in Dutch holiday name.

There's a typo in "Dag van Bevrijding en Venieuwing" - the correct spelling should be "Dag van Bevrijding en Vernieuwing" (with 'r' in "Vernieuwing").

-msgid "Dag van Bevrijding en Venieuwing"
+msgid "Dag van Bevrijding en Vernieuwing"
holidays/locale/en_US/LC_MESSAGES/SR.po (1)

73-74: Review Translation Specificity for "Keti Koti Dey"

Both "Dag der Vrijheden" and "Keti Koti Dey" are translated as "Day of Freedoms". If these are distinct holidays or if "Keti Koti Dey" is a local name that should be preserved, consider using a more specific translation to maintain its cultural significance.

tests/countries/test_suriname.py (1)

47-47: 🧹 Nitpick (assertive)

Extra whitespace in assertion.

There's an extra space after the comma in the assertNoHolidayName call.

-        self.assertNoHolidayName(name, range(1993, 2012), range(2021, 2050))
+        self.assertNoHolidayName(name, range(1993, 2012), range(2021, 2050))
holidays/countries/suriname.py (2)

13-24: 🧹 Nitpick (assertive)

Unused import detected.

The module imports from holidays.calendars.gregorian but FEB is never used in the code.

-from holidays.calendars.gregorian import MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV
+from holidays.calendars.gregorian import MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV

128-137: 🧹 Nitpick (assertive)

Fix implied Independence/Republic Day logic.

The name is correctly assigned but there's a more concise way to implement this without creating an intermediate variable.

-        if self._year >= 1976:
-            name = (
-                # Independence Day.
-                tr("Onafhankelijkheidsdag")
-                if self._year >= 2008
-                # Republic Day.
-                else tr("Dag van de Republiek")
-            )
-            dt = self._add_holiday_nov_25(name)
-            if self._year > 2024:
-                self._add_observed(dt)
+        if self._year >= 1976:
+            dt = self._add_holiday_nov_25(
+                # Independence Day.
+                tr("Onafhankelijkheidsdag")
+                if self._year >= 2008
+                # Republic Day.
+                else tr("Dag van de Republiek")
+            )
+            if self._year > 2024:
+                self._add_observed(dt)
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5f69b67 and 1419d41.

📒 Files selected for processing (4)
  • holidays/countries/suriname.py (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/SR.po (1 hunks)
  • holidays/locale/nl/LC_MESSAGES/SR.po (1 hunks)
  • tests/countries/test_suriname.py (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
holidays/countries/suriname.py (2)
holidays/groups/chinese.py (2)
  • ChineseCalendarHolidays (21-264)
  • _add_chinese_new_years_day (133-143)
holidays/observed_holiday_base.py (1)
  • ObservedHolidayBase (101-239)
🔇 Additional comments (6)
holidays/locale/nl/LC_MESSAGES/SR.po (1)

13-13: File description has been improved.

The description line "Suriname holidays." clearly identifies the purpose of this file.

tests/countries/test_suriname.py (4)

106-121: LGTM: Comprehensive test for Day of Freedoms name change.

The test correctly verifies that the holiday name changes between "Dag der Vrijheden" and "Keti Koti Dey" based on the year ranges.


171-182: LGTM: Republic Day to Independence Day name transition test.

The test correctly verifies the transition from "Dag van de Republiek" to "Onafhankelijkheidsdag" in 2008.


274-293: Comprehensive default localization test.

The test covers all holidays in their default language (Dutch) for 2025 including observed days.


295-315: Thorough English localization test.

Good coverage of English translations for 2025 holidays, ensuring all translations are properly applied.

holidays/countries/suriname.py (1)

35-48: Excellent documentation with archived references.

The class documentation includes archived links to official documents that define the holidays, which is excellent for maintainability and verification.

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

♻️ Duplicate comments (6)
holidays/locale/nl/LC_MESSAGES/SR.po (4)

31-32: All Dutch translations are empty.

All msgstr fields remain empty in this file, so the Dutch localization will not be functional until translations are provided.


49-50: Correct the spelling in “Venieuwing”.

The word “Venieuwing” is missing the letter “r”:

- msgid "Dag van Bevrijding en Venieuwing"
+ msgid "Dag van Bevrijding en Vernieuwing"

73-74: Ensure consistent naming for “Keti Koti Dey”.

“Keti Koti Dey” mixes an English word “Dey” with other Dutch terms. Consider adopting a more unified naming approach.


101-102: Standardize the holiday name for “Divali dag”.

To match the hyphenation in other holidays (e.g., “Holi-dag”), consider adding a hyphen:

-msgid "Divali dag"
+msgid "Divali-dag"
holidays/locale/en_US/LC_MESSAGES/SR.po (2)

73-74: Re-check the translation for “Keti Koti Dey”.

“Keti Koti Dey” appears to reference “Day of Freedoms,” which is also used elsewhere. If these are intended to be distinct holidays or local names, confirm the translation is accurate.


85-86: Amend the translation for “Onafhankelijkheidsdag”.

“Onafhankelijkheidsdag” is “Independence Day” in English. Consider:

-msgstr "Republic Day"
+msgstr "Independence Day"
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1419d41 and e12ed88.

📒 Files selected for processing (4)
  • holidays/countries/suriname.py (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/SR.po (1 hunks)
  • holidays/locale/nl/LC_MESSAGES/SR.po (1 hunks)
  • tests/countries/test_suriname.py (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
tests/countries/test_suriname.py (2)
tests/common.py (8)
  • TestCase (28-338)
  • CommonCountryTests (356-374)
  • assertAliases (121-130)
  • assertNoHolidays (292-294)
  • assertHolidayName (195-199)
  • assertNoNonObservedHoliday (248-250)
  • assertHolidays (228-230)
  • assertLocalizedHolidays (327-338)
holidays/countries/suriname.py (2)
  • Suriname (27-173)
  • SR (253-254)
holidays/countries/suriname.py (8)
holidays/calendars/hindu.py (1)
  • _CustomHinduHolidays (1305-1306)
holidays/calendars/islamic.py (1)
  • _CustomIslamicHolidays (3881-3882)
holidays/groups/chinese.py (2)
  • ChineseCalendarHolidays (21-264)
  • _add_chinese_new_years_day (133-143)
holidays/groups/christian.py (5)
  • ChristianHolidays (22-463)
  • _add_good_friday (308-317)
  • _add_easter_monday (259-268)
  • _add_christmas_day (208-216)
  • _add_christmas_day_two (218-226)
holidays/groups/hindu.py (3)
  • HinduCalendarHolidays (21-319)
  • _add_holi (178-187)
  • _add_diwali (87-97)
holidays/groups/international.py (3)
  • InternationalHolidays (18-220)
  • _add_new_years_day (126-134)
  • _add_labor_day (99-108)
holidays/groups/islamic.py (3)
  • IslamicHolidays (20-416)
  • _add_eid_al_fitr_day (152-163)
  • _add_eid_al_adha_day (109-120)
holidays/observed_holiday_base.py (1)
  • ObservedHolidayBase (101-239)
🔇 Additional comments (1)
holidays/countries/suriname.py (1)

81-82: Verify consistency of observed holiday conditions.

The code sometimes uses > 2024 and elsewhere uses >= 2024 for applying observed holidays. Please confirm which cutoff is correct and standardize as needed.

Also applies to: 90-91, 95-96, 141-142, 146-147, 151-152

kritibirda26 and others added 3 commits April 14, 2025 19:16
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Signed-off-by: Kriti Birda <164247895+kritibirda26@users.noreply.github.com>
Co-authored-by: ~Jhellico <KJhellico@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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b778f17 and 900cfc1.

📒 Files selected for processing (2)
  • holidays/countries/suriname.py (1 hunks)
  • tests/countries/test_suriname.py (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
tests/countries/test_suriname.py (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
holidays/countries/suriname.py (3)
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: holidays/countries/nepal.py:266-284
Timestamp: 2025-04-13T20:41:56.572Z
Learning: The Islamic holiday dates in the holidays library should only include officially verified dates, not predicted ones, to maintain accuracy. This is especially important for holidays that depend on lunar observations like Eid al-Fitr and Eid al-Adha.
Learnt from: PPsyrius
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:73-77
Timestamp: 2025-04-03T12:36:41.201Z
Learning: In the Holidays library, comments explaining year restrictions for holidays should be placed above the year check conditional statement, not inside it. Example format:
```python
# reason why goes here
if start_year <= self._year <= end_year:
    # Holiday name
    self._add_holiday_function(tr("Holiday Name"))

Learnt from: KJhellico
PR: #2465
File: holidays/countries/suriname.py:219-251
Timestamp: 2025-04-13T19:10:31.461Z
Learning: The _CustomIslamicHolidays classes in this project contain only exact verified holiday dates from reliable sources, rather than calculated or estimated future dates. This is by design to ensure accuracy, particularly for religious holidays that may follow lunar calendars or depend on local observations.


</details>

</details><details>
<summary>🧬 Code Graph Analysis (1)</summary>

<details>
<summary>holidays/countries/suriname.py (5)</summary><blockquote>

<details>
<summary>holidays/holiday_base.py (1)</summary>

* `HolidayBase` (57-1275)

</details>
<details>
<summary>holidays/groups/chinese.py (1)</summary>

* `ChineseCalendarHolidays` (21-264)

</details>
<details>
<summary>holidays/groups/christian.py (1)</summary>

* `ChristianHolidays` (22-463)

</details>
<details>
<summary>holidays/groups/international.py (1)</summary>

* `InternationalHolidays` (18-220)

</details>
<details>
<summary>holidays/groups/islamic.py (1)</summary>

* `IslamicHolidays` (20-416)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (7)</summary><blockquote>

<details>
<summary>tests/countries/test_suriname.py (4)</summary>

`19-19`: **Good coverage with `CommonCountryTests`.**
This test suite properly inherits from `CommonCountryTests`, ensuring standard testing for Suriname's unique logic.

---

`31-39`: **Excellent use of year ranges.**
Your approach of partitioning holiday rules across ranges (e.g., 1981–1992 and 2012–2020) aligns with known legislative changes. This ensures precise coverage.

---

`41-54`: **Comprehensive Holi checks.**
Testing Holi each year within the dictionary range is consistent with prior feedback to test single holidays across multiple years.

---

`178-197`: **Clear reference test for year 2024.**
Listing each holiday with expected names is straightforward and reduces confusion about final observed days.

</details>
<details>
<summary>holidays/countries/suriname.py (3)</summary>

`80-83`: **Concise logic for Day of Liberation and Renewal.**
Conditionally adding the holiday between 1981–1992 and 2012–2020 appears aligned with official references. Nice usage of `_add_holiday_feb_25`.

---

`110-119`: **Straightforward handling of Republic/Independence Day.**
Using November 25 for both names based on the year supports historical accuracy without extra complexity.

---

`140-142`: **Chinese New Year addition.**
The condition `>= 2022` is clear and consistent with incorporating new support at that cutoff, aligning with documented references.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@coderabbitai coderabbitai bot mentioned this pull request Apr 15, 2025
9 tasks
@KJhellico KJhellico moved this to Done in Task Tracker Apr 15, 2025
@arkid15r arkid15r mentioned this pull request Apr 18, 2025
9 tasks
@KJhellico KJhellico mentioned this pull request Apr 21, 2025
@coderabbitai coderabbitai bot mentioned this pull request Apr 23, 2025
9 tasks
@coderabbitai coderabbitai bot mentioned this pull request May 3, 2025
9 tasks
This was referenced May 24, 2025
@kritibirda26 kritibirda26 deleted the suriname branch June 8, 2025 08:20
@coderabbitai coderabbitai bot mentioned this pull request Jun 8, 2025
9 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jun 19, 2025
9 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jul 9, 2025
9 tasks
@arkid15r arkid15r removed this from Task Tracker Aug 13, 2025
@coderabbitai coderabbitai bot mentioned this pull request Aug 26, 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 Suriname holidays
3 participants