+
Skip to content

Add Nepal holidays #2386

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

Merged
merged 70 commits into from
May 18, 2025
Merged

Add Nepal holidays #2386

merged 70 commits into from
May 18, 2025

Conversation

ankushhKapoor
Copy link
Contributor

Proposed change

Added Nepal holidays.

Resolves #1234

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 28, 2025

Summary by CodeRabbit

  • New Features

    • Added support for Nepalese holidays, including both public and workday categories.
    • Introduced a comprehensive set of Nepal-specific holidays, including major Hindu, Islamic, and national observances.
    • Expanded the holiday calendar with new Hindu and regional holidays such as Gyalpo Losar, Sonam Losar, Tamu Losar, and Maha Ashtami.
  • Bug Fixes

    • Corrected the date for the "Maha Navami" holiday in India for 2018.
  • Documentation

    • Updated the list of supported countries to include Nepal.
  • Tests

    • Added extensive tests to ensure accurate coverage of Nepalese holidays.

Summary by CodeRabbit

  • Documentation

    • Updated supported country listings, now including Nepal.
  • New Features

    • Expanded holiday data with comprehensive support for Nepal and its WORKDAY category.
    • Enhanced holiday calculations by incorporating additional Hindu festival observances.
  • Tests

    • Introduced dedicated test scenarios to validate holiday accuracy and date computations for Nepal.

Walkthrough

The changes introduce Nepal as a new supported country within the holiday management system. This includes updating the README to reflect its addition, creating a new module for Nepal's holiday functionality, updating the countries registry, and adding corresponding tests. The modifications ensure comprehensive holiday support for Nepal while maintaining integration with existing structures.

Changes

Files Summary
README.md Updated supported country count and inserted a new row for Nepal with its details.
holidays/countries/init.py, holidays/countries/nepal.py, holidays/registry.py Added Nepal support: new module defining the Nepal class with NP and NPL aliases, updated import and registry.
tests/countries/test_nepal.py Introduced new tests verifying the country aliases and functionality for Nepal.
holidays/groups/hindu.py Added new methods to HinduCalendarHolidays for specific Hindu and regional holidays related to Nepal.
holidays/calendars/hindu.py Added new holiday constants, date mappings, and accessor methods for Gyalpo Losar, Sonam Losar, and Maha Ashtami.

Assessment against linked issues

Objective Addressed Explanation
Add Nepal holidays (#1234)

Suggested reviewers

  • PPsyrius
  • KJhellico

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit 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.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent 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

📥 Commits

Reviewing files that changed from the base of the PR and between 79715e3 and d43a6b8.

📒 Files selected for processing (3)
  • README.md (2 hunks)
  • holidays/countries/__init__.py (1 hunks)
  • holidays/registry.py (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
holidays/countries/__init__.py (1)
holidays/countries/nepal.py (3)
  • Nepal (26-292)
  • NP (401-402)
  • NPL (405-406)
🔇 Additional comments (3)
holidays/registry.py (1)

133-133: Clean addition of Nepal to the registry

The Nepal entry is correctly positioned in alphabetical order and follows the established pattern for country entries in the registry. This includes the proper country name and ISO codes.

holidays/countries/__init__.py (1)

125-125: Nepal module import follows project conventions

The import statement for Nepal is properly positioned in alphabetical order between Namibia and Netherlands, and correctly imports the main country class and its ISO code aliases.

README.md (1)

108-108: Accurate update to supported country count

The total number of supported countries has been correctly incremented from 173 to 174 to reflect the addition of Nepal.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch dev
  • Post Copyable Unit Tests in Comment

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.

❤️ Share
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need 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)

  • @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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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 28, 2025
@ankushhKapoor ankushhKapoor marked this pull request as draft March 28, 2025 19:59
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 8a486bf and 5bc7367.

📒 Files selected for processing (5)
  • README.md (2 hunks)
  • holidays/countries/__init__.py (1 hunks)
  • holidays/countries/nepal.py (1 hunks)
  • holidays/registry.py (1 hunks)
  • tests/countries/test_nepal.py (1 hunks)
🧰 Additional context used
🧬 Code Definitions (2)
tests/countries/test_nepal.py (1)
holidays/countries/nepal.py (3)
  • Nepal (16-25)
  • NP (28-29)
  • NPL (32-33)
holidays/countries/__init__.py (1)
holidays/countries/nepal.py (3)
  • Nepal (16-25)
  • NP (28-29)
  • NPL (32-33)
🔇 Additional comments (8)
holidays/registry.py (1)

126-126: LGTM! Correctly added Nepal to the COUNTRIES registry.

The Nepal entry follows the proper format with name and ISO codes (alpha-2 "NP" and alpha-3 "NPL"), and is correctly positioned alphabetically in the dictionary.

holidays/countries/__init__.py (1)

118-118: LGTM! Nepal import statement correctly added.

The import statement for Nepal and its code aliases follows the established pattern and is properly positioned alphabetically among other country imports.

tests/countries/test_nepal.py (1)

19-26: LGTM! Test class correctly implements the required tests.

The test class follows the project's testing pattern by:

  1. Inheriting from CommonCountryTests and TestCase
  2. Setting up the class with the Nepal holiday class
  3. Verifying that the country aliases (NP, NPL) correctly map to the Nepal class

This provides the necessary test coverage for the basic functionality.

README.md (2)

102-102: LGTM! Correctly updated country count.

The number of supported country codes has been properly updated from 160 to 161 to reflect the addition of Nepal.


865-870: LGTM! Nepal entry correctly added to country table.

The Nepal entry follows the established table format with the country name, ISO code (NP), supported language (en_US as default), and is correctly positioned alphabetically in the table.

holidays/countries/nepal.py (3)

13-14: Import structure looks good.

The import of HolidayBase is appropriate for creating a country-specific holiday class.


28-30: Alias class implementation is correct.

The NP class properly inherits from Nepal, following the project's convention of providing an alias using the ISO 3166-1 alpha-2 code.


32-34: Alias class implementation is correct.

The NPL class properly inherits from Nepal, following the project's convention of providing an alias using the ISO 3166-1 alpha-3 code.

@ankushhKapoor ankushhKapoor marked this pull request as ready for review March 29, 2025 17:44
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 5bc7367 and 548251e.

📒 Files selected for processing (3)
  • holidays/countries/nepal.py (1 hunks)
  • holidays/groups/hindu.py (7 hunks)
  • tests/countries/test_nepal.py (1 hunks)
🧰 Additional context used
🧬 Code Definitions (3)
tests/countries/test_nepal.py (1)
holidays/countries/nepal.py (3)
  • Nepal (18-149)
  • NP (152-153)
  • NPL (156-157)
holidays/countries/nepal.py (1)
holidays/groups/hindu.py (7)
  • HinduCalendarHolidays (21-396)
  • _add_bhai_dooj (62-72)
  • _add_buddha_purnima (74-85)
  • _add_chhath_puja (87-97)
  • _add_gau_krida (141-149)
  • _add_govardhan_puja (151-161)
  • _add_tihar_holiday (364-372)
holidays/groups/hindu.py (1)
holidays/calendars/hindu.py (3)
  • govardhan_puja_date (1256-1257)
  • maha_navami_date (1274-1275)
  • dussehra_date (1250-1251)
🔇 Additional comments (15)
tests/countries/test_nepal.py (5)

1-12: Looks solid for file headers and imports.
All new lines here appear properly structured, referencing correct modules.


19-23: Validate super initialization call in setUpClass.
Ensure that super().setUpClass(Nepal) indeed invokes any required parent initialization logic for this testing framework.

Please confirm this invocation is behaving as expected in your test runner by checking test logs or coverage results.


24-26: Straightforward test for country aliases.
The alias checks look correct and well-structured.


27-58: Comprehensive holiday coverage for 2025.
All tested holidays match the expected date mappings. This is a clear, precise test.


60-231: Extensive parametric holiday testing.
Covering multiple years for each holiday name is an excellent approach to ensure correctness.

holidays/countries/nepal.py (3)

136-137: Check for potential duplication in Mha Puja logic.
Invoking _add_govardhan_puja("Mha Puja") shares code with Govardhan Puja. Confirm they share the exact same date in your references.

Would you like a script to verify no date discrepancies exist in official references?


151-158: Minimal stubs for NP and NPL
These subclasses correctly inherit from Nepal with no custom logic. They appear fine.


36-80:

✅ Verification successful

Verify that _populate_public_holidays is triggered.
It’s excellent to isolate holiday definitions in a dedicated method. However, confirm that the wider library calls _populate_public_holidays() so these holidays actually appear in final results.


🏁 Script executed:

#!/bin/bash
# Searching for `_populate_public_holidays` usage in the codebase.
rg -A 5 '_populate_public_holidays'

Length of output: 66509


Action: Confirm that Nepal’s _populate_public_holidays is correctly integrated.

I've reviewed the codebase and found that the method defined in holidays/countries/nepal.py follows the same pattern as in other country modules. In multiple files, similar _populate_public_holidays implementations are either directly or indirectly invoked—often through parent class methods (e.g., via super()._populate_public_holidays()) or through the library’s routine population process. This confirms that Nepal’s holidays (including Prithvi Jayanti, Martyr’s Day, National Democracy Day, Republic Day, Constitution Day, Labor Day, and Nepali New Year) are set up to appear in the final results.

Feel free to double-check with your local test suite if any country-specific outlets need further scrutiny.

holidays/groups/hindu.py (7)

31-42: Parameter days_delta for _add_hindu_calendar_holiday is a good addition.
This nicely enables holiday adjustments after Diwali or Dussehra. No immediate concerns.


62-72: Bhai Tika addition is properly referencing Govardhan Puja date.
Implementation looks aligned with the festival’s chronology.


141-149: Gau Krida logic is consistent.
The one-day offset (days_delta=-1) aligns with the festival’s timing relative to Govardhan Puja.


155-155: Slight docstring update for Govardhan Puja.
The clarification “celebrated after Diwali” is appropriate.


305-315: Papankusha Ekadashi addition.
Implementation aligns with the standard calendar offset from Dussehra.


316-325: Papankusha Duwadashi logic.
Adding one more day on top of Ekadashi is correct. This looks good.


364-372: Tihar Holiday for Nepal.
Fifth day offset from Diwali (two days after Govardhan Puja) is consistent. Nicely done.

ankushhKapoor and others added 2 commits March 29, 2025 23:20
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Ankush_Kapoor <work.ankushkapoor1626@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Ankush_Kapoor <work.ankushkapoor1626@gmail.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 548251e and 318a29c.

📒 Files selected for processing (1)
  • holidays/groups/hindu.py (7 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
holidays/groups/hindu.py (1)
holidays/calendars/hindu.py (3)
  • govardhan_puja_date (1256-1257)
  • maha_navami_date (1274-1275)
  • dussehra_date (1250-1251)
🔇 Additional comments (6)
holidays/groups/hindu.py (6)

31-42: Well-designed parameter enhancement.

The addition of the days_delta parameter provides flexibility for defining holidays related to a specific date but observed on different days. This is a valuable enhancement for supporting the Nepal holidays.


62-72: Implementation looks good.

The Bhai Dooj holiday implementation correctly uses the Govardhan Puja date with an appropriate offset. The docstring is clear and informative.


141-149: Implementation is correct.

The Gau Krida holiday implementation effectively uses the Govardhan Puja date with a -1 day offset.


155-155: Minor docstring improvement.

The change from "celebrated the day after Diwali" to "celebrated after Diwali" makes the description more general and appropriate.


223-233: Correct docstring and implementation.

The Maha Saptami implementation correctly identifies it as the seventh day of Navratri and uses the appropriate date offset.


234-244: Correct docstring and implementation.

The Maha Ashtami implementation correctly identifies it as the eighth day of Navratri and uses the appropriate date offset.

ankushhKapoor and others added 3 commits March 29, 2025 23:24
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Ankush_Kapoor <work.ankushkapoor1626@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Ankush_Kapoor <work.ankushkapoor1626@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Ankush_Kapoor <work.ankushkapoor1626@gmail.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: 2

♻️ Duplicate comments (1)
holidays/groups/hindu.py (1)

303-312: 🧹 Nitpick (assertive)

Add reference link to Papankusha Ekadashi docstring.

Similar to the suggestion in past review comments, add a reference link for completeness.

        """
        Add Papankusha Ekadashi.

        Papankusha Ekadashi is a Hindu festival which occurs on eleventh day on month of
        Ashwin (September-October).
+       https://en.wikipedia.org/wiki/Ekadashi
        """
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 318a29c and 5e4bc77.

📒 Files selected for processing (1)
  • holidays/groups/hindu.py (7 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
holidays/groups/hindu.py (1)
holidays/calendars/hindu.py (3)
  • govardhan_puja_date (1256-1257)
  • maha_navami_date (1274-1275)
  • dussehra_date (1250-1251)
🪛 Ruff (0.8.2)
holidays/groups/hindu.py

367-367: Trailing whitespace

Remove trailing whitespace

(W291)


368-368: Line too long (101 > 99)

(E501)


368-368: Trailing whitespace

Remove trailing whitespace

(W291)

🔇 Additional comments (6)
holidays/groups/hindu.py (6)

30-42: Addition of days_delta parameter provides greater flexibility.

The inclusion of a days_delta parameter in the _add_hindu_calendar_holiday method is a solid enhancement. This allows for defining holidays that are offset from reference dates, making the implementation more versatile.


62-72: Good implementation of Bhai Dooj.

The implementation correctly derives Bhai Dooj by adding one day to Govardhan Puja. The docstring provides clear cultural context for the holiday.


155-155: Clearer wording in Govardhan Puja docstring.

The change from "celebrated the day after Diwali" to "celebrated after Diwali" is more accurate as it doesn't restrict to a specific day count.


223-233: Maha Saptami implementation is correct.

The implementation properly calculates Maha Saptami as two days before Maha Navami with an accurate docstring.


234-244: Maha Ashtami implementation is correct.

The implementation properly calculates Maha Ashtami as one day before Maha Navami with an accurate docstring.


314-323: Papankusha Duwadashi implementation looks good.

The implementation correctly derives the date and includes a reference link as suggested in past comments.

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 (1)
holidays/groups/hindu.py (1)

141-149: 🧹 Nitpick (assertive)

Consider adding a reference link for Gau Krida.

The method is implemented correctly, but the docstring would benefit from a reference link similar to other holiday methods in this class.

        """
        Add Gau Krida.

        Gau Krida, is celebrated the day after Diwali to honor cows.
+       https://en.wikipedia.org/wiki/Gau_Puja
        """
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5e4bc77 and cc3fc3e.

📒 Files selected for processing (1)
  • holidays/groups/hindu.py (7 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
holidays/groups/hindu.py (1)
holidays/calendars/hindu.py (3)
  • govardhan_puja_date (1256-1257)
  • maha_navami_date (1274-1275)
  • dussehra_date (1250-1251)
🔇 Additional comments (9)
holidays/groups/hindu.py (9)

31-31: Update to method signature adds flexibility.

The addition of the days_delta parameter with a default value of 0 is a good enhancement that allows for more precise holiday date calculations by offsetting dates when needed.


41-41: Good implementation of the days_delta parameter.

The parameter is correctly passed to the underlying _add_eastern_calendar_holiday method call, maintaining API consistency.


62-72: Well-documented addition of Bhai Dooj holiday.

The implementation correctly uses the Govardhan Puja date with a +1 day offset. The docstring provides good context about the festival and its relationship to Diwali.


155-155: Good clarification in docstring.

Changing "celebrated the day after Diwali" to "celebrated after Diwali" is more accurate and aligns better with the actual observance of the festival.


223-234: Maha Saptami implementation looks good.

The implementation correctly calculates the date by offsetting from Maha Navami by -2 days. The docstring provides appropriate context.


235-246: Maha Ashtami implementation looks good.

The implementation correctly calculates the date by offsetting from Maha Navami by -1 day. The docstring provides appropriate context.


305-316: Good implementation of Papankusha Ekadashi.

The method correctly uses the Dussehra date with a +1 day offset. Good job including the Wikipedia reference.


317-327: Good implementation of Papankusha Duwadashi.

The method correctly uses the Dussehra date with a +2 day offset. Good job including the Wikipedia reference.


366-379: Good implementation of Tihar Holiday.

The method correctly calculates the date by offsetting from Govardhan Puja by +2 days. This effectively adds support for Nepal holidays as mentioned in the PR objectives.

Copy link

codecov bot commented Mar 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (f737168) to head (d43a6b8).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##               dev     #2386    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          217       218     +1     
  Lines        13783     13910   +127     
  Branches      1948      1954     +6     
==========================================
+ Hits         13783     13910   +127     

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

@ankushhKapoor, you have chosen not the easiest country! 👍

Just a few technical suggestions for now, I want to go a little deeper into the calendar and holidays of Nepal. What sources did you rely on?

@ankushhKapoor
Copy link
Contributor Author

@ankushhKapoor, you have chosen not the easiest country! 👍

Thank you! 😊

Just a few technical suggestions for now, I want to go a little deeper into the calendar and holidays of Nepal. What sources did you rely on?

I referred to Wikipedia , Time and Date and HamroPatro calendar as sources since Nepal doesn’t have an official website listing all holidays.
Let me know if you have any specific suggestions or reliable sources to cross-check!

@PPsyrius
Copy link
Collaborator

PPsyrius commented Mar 30, 2025

I found this one from 2024 with both original Nepalese language document and English translation: https://narayanilawfirm.org.np/list-of-public-holidays-in-nepal-2079/

@ankushhKapoor
Copy link
Contributor Author

I found this one from 2024 with both original Nepalese language document and English translation: https://narayanilawfirm.org.np/list-of-public-holidays-in-nepal-2079/

This is nice. I will check and update holidays in the project if needed.

@PPsyrius PPsyrius changed the title Add Nepal holidays (#1234) Add Nepal holidays Mar 30, 2025
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Signed-off-by: Ankush_Kapoor <work.ankushkapoor1626@gmail.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

♻️ Duplicate comments (2)
holidays/countries/nepal.py (2)

274-280: 🧹 Nitpick (assertive)

Typo: “Gobardhan” → “Govardhan” (v ≠ b)
The helper is _add_govardhan_puja; aligning the holiday label avoids duplicate spellings in downstream reports.

-        # Gobardhan Pooja.
-        self._add_govardhan_puja("Gobardhan Pooja")
+        # Govardhan Puja.
+        self._add_govardhan_puja("Govardhan Puja")

160-168: 🧹 Nitpick (assertive)

Boolean expression hard to read – split for clarity
if (2019 <= self._year <= 2020) == is_workday: forces a mental double-take.
A small local variable keeps intent obvious:

-        if (2019 <= self._year <= 2020) == is_workday:
+        in_cut_years = 2019 <= self._year <= 2020
+        if (is_workday and in_cut_years) or (not is_workday and not in_cut_years):
📜 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

📥 Commits

Reviewing files that changed from the base of the PR and between bac23be and d31cbd9.

📒 Files selected for processing (1)
  • holidays/countries/nepal.py (1 hunks)

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

♻️ Duplicate comments (2)
holidays/countries/nepal.py (2)

270-274: 🧹 Nitpick (assertive)

Harmonise spelling: “Govardhan Puja”

The library’s helper is named _add_govardhan_puja; every public source linked in the header uses “Govardhan”.
Keeping a single spelling avoids duplicate holiday labels that differ only by a typo.

-        # Gobardhan Pooja.
-        self._add_govardhan_puja("Gobardhan Pooja")
+        # Govardhan Puja.
+        self._add_govardhan_puja("Govardhan Puja")

(If “Gobardhan” is intentional, maybe leave a short comment explaining the regional form.)


154-167: 🛠️ Refactor suggestion

Refactor the “double-negative” condition for clarity

The comparison (2019 <= self._year <= 2020) == is_workday forces a mental double-take every time somebody reads it.
A tiny helper variable makes the intent obvious, costs nothing in performance, and follows the style already used elsewhere in the code-base.

-        if (2019 <= self._year <= 2020) == is_workday:
+        in_cut_years = 2019 <= self._year <= 2020
+        if (is_workday and in_cut_years) or (not is_workday and not in_cut_years):

Same logic, easier maintenance.

📜 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

📥 Commits

Reviewing files that changed from the base of the PR and between d31cbd9 and 5ce433a.

📒 Files selected for processing (1)
  • holidays/countries/nepal.py (1 hunks)
🔇 Additional comments (1)
holidays/countries/nepal.py (1)

234-241: Check chronological ordering within Hindu block

Maha Shivaratri (Feb 29 ⁠/ ⁠Mar 8) generally precedes Gyalpo Lhosar (Feb ⁠— dates vary).
If strict Gregorian chronology is the rule (per earlier reviewer guidance), consider swapping these two calls.

@KJhellico
Copy link
Collaborator

I agree with the current names. 👍

PPsyrius
PPsyrius previously approved these changes May 17, 2025
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.

LGTM 🇳🇵

KJhellico
KJhellico previously approved these changes May 17, 2025
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.

LGTM! (l10n can be made as separate PR)

@ankushhKapoor
Copy link
Contributor Author

LGTM! (l10n can be made as separate PR)

Thanks! Sure, I’ll make l10n a separate PR.

@arkid15r arkid15r dismissed stale reviews from KJhellico and PPsyrius via 79715e3 May 18, 2025 19:15
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
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 5ce433a and 79715e3.

📒 Files selected for processing (1)
  • holidays/countries/nepal.py (1 hunks)
🔇 Additional comments (3)
holidays/countries/nepal.py (3)

169-171: Three spellings for Janai Purnima – pick one
Janai Poornima (here), Janai Punima (constant name), and the common English Janai Purnima all appear.
Inconsistent labels create near-duplicate entries in the final calendar.

Action: settle on the preferred spelling (project usually follows Wikipedia → “Janai Purnima”) and update all occurrences.


265-269: Verify “Gobardhan Pooja” vs “Govardhan Puja”
Local transliteration may differ, but elsewhere in Hindu modules the V-spelling is used. Double-check which form Nepali government sources prefer; otherwise consumers will see two holidays that differ only by a letter.

Would you like a quick grep across the repo to confirm current usage patterns?


409-441: Special-holiday table drives behaviour – guard against stray tuple nesting
Most years map to a single 3-tuple; 2023 maps to a tuple-of-tuples.
Looks correct, but a unit-test asserting isinstance(value[0], int) for single-holiday years would catch accidental double-nesting (a past bug already fixed for 2011/2024).

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.

@ankushhKapoor thanks for this tremendous and long-awaited contribution!

I have a couple of minor comments regarding the code formatting but this is 💯 mergable as both @KJhellico and @PPsyrius LGTMed it.

Copy link

@arkid15r arkid15r enabled auto-merge May 18, 2025 20:35
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.

275 conversation, 70 commits 🤯

A lot of great work, thank you @ankushhKapoor @KJhellico @PPsyrius 🎉

@arkid15r arkid15r added this pull request to the merge queue May 18, 2025
Merged via the queue into vacanza:dev with commit dc0fd2d May 18, 2025
33 checks passed
@KJhellico KJhellico mentioned this pull request May 19, 2025
Wasif-Shahzad pushed a commit to Wasif-Shahzad/holidays that referenced this pull request May 21, 2025
Signed-off-by: Ankush_Kapoor <work.ankushkapoor1626@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: Arkadii Yakovets <ark@cho.red>
ShalomDee pushed a commit to ShalomDee/holidays that referenced this pull request Jun 2, 2025
Signed-off-by: Ankush_Kapoor <work.ankushkapoor1626@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: Arkadii Yakovets <ark@cho.red>
@coderabbitai coderabbitai bot mentioned this pull request Jun 16, 2025
9 tasks
@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 Nepal holidays
4 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载