python-holidays icon indicating copy to clipboard operation
python-holidays copied to clipboard

Add Bhutan holidays

Open Prateekshit73 opened this issue 6 months ago • 6 comments

Proposed change

Add Bhutan holidays Resolves #1156.

Type of change

  • [x] 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

  • [x] I've followed the contributing guidelines
  • [x] I've successfully run make check, all checks and tests are green

Prateekshit73 avatar Jun 15 '25 17:06 Prateekshit73

Summary by CodeRabbit

  • New Features

    • Added Bhutan as a supported country with comprehensive national and regional holiday coverage from 2007–2050, including major religious, royal, and cultural observances.
    • Bhutan holidays now include both fixed and movable dates, supporting all districts and key local festivals.
    • Bhutanese holidays are now available for lookup and calendar integration.
  • Documentation

    • Updated README to reflect Bhutan as a newly supported country.
  • Tests

    • Introduced extensive tests to verify Bhutanese holiday calculations and localization.
  • Chores

    • Added new contributor "Aneesh Angane" to the contributors list.

Walkthrough

This change introduces comprehensive support for Bhutanese public holidays. It adds a Bhutan holiday provider, implements Tibetan lunisolar calendar logic, updates documentation and registry files, and includes new tests and data snapshots to verify correct holiday calculations for Bhutan from 1970 onward.

Changes

Cohort / File(s) Change Summary
Bhutan holiday provider and Tibetan calendar logic
holidays/countries/bhutan.py, holidays/groups/tibetan.py, holidays/calendars/tibetan.py
Added Bhutan holiday definitions and Tibetan lunisolar calendar classes with holiday date mappings and calculation methods.
Imports for Bhutan and Tibetan calendar
holidays/countries/__init__.py, holidays/groups/__init__.py, holidays/calendars/__init__.py
Imported Bhutan country classes and Tibetan calendar classes to relevant modules.
Country registry update
holidays/registry.py
Registered Bhutan with country codes "BT" and "BTN".
Documentation update
README.md
Updated supported countries count and added Bhutan to the available countries list.
Tests for Bhutan and Tibetan calendar holidays
tests/countries/test_bhutan.py, tests/test_holiday_groups.py
Added tests validating Bhutan holidays and Tibetan calendar holiday addition logic.
Holiday data snapshot
snapshots/countries/BT_COMMON.json, snapshots/countries/BT_15.json, and multiple BT_*.json files
Added static JSON snapshots of Bhutan holidays from 2007 to 2050 for validation and reference.
Contributor acknowledgment
CONTRIBUTORS
Added new contributor "Aneesh Angane" to the contributors list.

Estimated code review effort

  • Simple import and registry updates, README, CONTRIBUTORS: 🎯 1 (Trivial) | ⏱️ ~10 minutes
  • Bhutan country holiday provider and holiday group additions: 🎯 3 (Moderate) | ⏱️ ~90 minutes
  • Tibetan lunisolar calendar implementation (new calendar logic): 🎯 4 (Complex) | ⏱️ ~240 minutes
  • Tests for Bhutan and Tibetan calendar holidays: 🎯 2 (Simple) | ⏱️ ~45 minutes
  • Snapshot data file review: 🎯 1 (Trivial) | ⏱️ ~5 minutes

Overall estimated review effort: 🎯 3 (Moderate) | ⏱️ ~90 minutes

Assessment against linked issues

Objective Addressed Explanation
Add Bhutan holidays (#1156)
Include major Bhutan public holidays and cultural observances (#1156)
Use reliable sources such as Wikipedia and timeanddate.com for holiday data (#1156)

Assessment against linked issues: Out-of-scope changes

No out-of-scope code changes detected. All changes align with the objectives related to adding Bhutan holidays.

Suggested reviewers

  • arkid15r
  • PPsyrius

[!NOTE]

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • [ ] 📝 Generate Docstrings
🧪 Generate unit tests
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a 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.
  • 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.

coderabbitai[bot] avatar Jun 15 '25 17:06 coderabbitai[bot]

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 100.00%. Comparing base (76bdfa6) to head (c3ee69b). :warning: Report is 87 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##               dev     #2635    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          273       276     +3     
  Lines        16309     16454   +145     
  Branches      2203      2203            
==========================================
+ Hits         16309     16454   +145     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Jun 15 '25 17:06 codecov[bot]

  1. List of Holidays 2024
  2. List of Holidays (2025)
  3. PHPA-II HOLIDAY LIST 2025

Holiday lists are useful, but what do linguistic researches provide us with?

KJhellico avatar Jun 16 '25 14:06 KJhellico

Thank you for your feedback regarding the sources I provided. I appreciate your emphasis on the importance of linguistic research in our work.

I have encountered some challenges in sourcing verified Dzongkha text. I found it difficult to extract proper Dzongkha text directly from these documents. For instance, when attempting to copy text from the official holiday list PDF, the Dzongkha characters did not transfer correctly, resulting in garbled output.

To ensure the integrity of our work, I am committed to using reliable and authoritative sources. If you have any specific suggestions for sources or methods to obtain verified Dzongkha text, I would greatly appreciate your guidance.

Thank you for your understanding.

Prateekshit73 avatar Jun 17 '25 17:06 Prateekshit73

My comments on initial PR are still relevant.

KJhellico avatar Jun 29 '25 09:06 KJhellico

Should I remove localization support for dz_BT for now, as I was not able to find any official Dzongkha text?

Prateekshit73 avatar Jun 29 '25 14:06 Prateekshit73

I think so, like with Nepal. I suggest focusing on the holidays themselves.

KJhellico avatar Jun 29 '25 14:06 KJhellico

Just add missing tests for holidays that are missing, and seems it's done.

KJhellico avatar Aug 05 '25 13:08 KJhellico

We can later make traditional generator based on data from here.

KJhellico avatar Aug 06 '25 19:08 KJhellico