-
-
Notifications
You must be signed in to change notification settings - Fork 544
Add Bhutan holidays #2635
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
base: dev
Are you sure you want to change the base?
Add Bhutan holidays #2635
Conversation
…ate holiday names to Tibetan script
Co-authored-by: ~Jhellico <[email protected]> Signed-off-by: Aneesh Angane <[email protected]>
Co-authored-by: ~Jhellico <[email protected]> Signed-off-by: Aneesh Angane <[email protected]>
Co-authored-by: ~Jhellico <[email protected]> Signed-off-by: Aneesh Angane <[email protected]>
Co-authored-by: ~Jhellico <[email protected]> Signed-off-by: Aneesh Angane <[email protected]>
Co-authored-by: ~Jhellico <[email protected]> Signed-off-by: Aneesh Angane <[email protected]>
Co-authored-by: ~Jhellico <[email protected]> Signed-off-by: Aneesh Angane <[email protected]>
Co-authored-by: ~Jhellico <[email protected]> Signed-off-by: Aneesh Angane <[email protected]>
Co-authored-by: ~Jhellico <[email protected]> Signed-off-by: Aneesh Angane <[email protected]>
Should I remove localization support for |
I think so, like with Nepal. I suggest focusing on the holidays themselves. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
holidays/calendars/tibetan.py (1)
805-810
: Consider adding parentheses for tuple clarity.The return statement would be clearer with explicit parentheses around the tuple, improving readability without changing functionality.
- return date(year, *dt) if dt else None, year not in exact_dates + return (date(year, *dt) if dt else None, year not in exact_dates)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
holidays/calendars/tibetan.py
(1 hunks)holidays/countries/bhutan.py
(1 hunks)snapshots/countries/BT_COMMON.json
(1 hunks)tests/countries/test_bhutan.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:0-0
Timestamp: 2025-05-10T04:32:15.760Z
Learning: In the holidays package, detailed historical context and additional information should be added as comments at the method level or above conditional blocks, while comments directly above tr() function calls should only contain the holiday name itself (e.g., "# Independence Day.").
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: KJhellico
PR: vacanza/holidays#2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.163Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: README.md:108-108
Timestamp: 2025-06-14T20:13:29.536Z
Learning: In the vacanza/holidays repository, the team prefers to manually update the country count in README.md when adding new countries, with tests in place to verify the count stays accurate. They are satisfied with this approach and do not want it automated.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.
Learnt from: KJhellico
PR: vacanza/holidays#2593
File: holidays/countries/senegal.py:66-110
Timestamp: 2025-06-06T14:40:31.932Z
Learning: In the holidays library, within the _populate_public_holidays method, holidays should be arranged by calendar type (Islamic holidays first, then Gregorian holidays) without additional type grouping comments. The organization by calendar type is sufficient and follows the project's established conventions.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_polynesia.py:1-12
Timestamp: 2025-06-19T05:54:49.792Z
Learning: The holidays library uses a standard file header format across all country implementation files consisting of a comprehensive comment block with project description, authors, website, and license information. Country files do not use module-level docstrings but instead rely on this header format followed by class-level docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:278-377
Timestamp: 2025-03-05T02:35:03.298Z
Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.
tests/countries/test_bhutan.py (15)
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
Learnt from: PPsyrius
PR: vacanza/holidays#2615
File: tests/countries/test_anguilla.py:1-12
Timestamp: 2025-06-16T15:48:48.680Z
Learning: Test files in the holidays repository follow a standardized structure without module or class docstrings. All country test files use the same pattern: license header, imports, and class definition (`class Test{Country}(CommonCountryTests, TestCase):`) without docstrings. This is an established codebase convention that should be maintained for consistency.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:33:53.254Z
Learning: For Turkmenistan holiday tests, recommend using CommonCountryTests as the base class rather than unittest.TestCase to follow project conventions, be consistent with other country test files, and gain access to common test utilities.
Learnt from: PPsyrius
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are covered by the test_eid_al_fitr_day() method, which tests both regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: tests/countries/test_mongolia.py:128-156
Timestamp: 2025-06-15T11:52:39.572Z
Learning: In the vacanza/holidays project tests, when testing holidays that span multiple consecutive days across many years (like Mongolia's National Festival spanning July 11-13), prefer explicit for loops over complex nested generator expressions with unpacking. The explicit loops are more readable, easier to maintain, and better communicate the testing intent even though the Big O complexity is equivalent.
holidays/calendars/tibetan.py (16)
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants like FEB, TUE, MAR, and SUN internally through parent class implementations even when these constants don't appear directly in the file.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2593
File: holidays/calendars/islamic.py:3993-3994
Timestamp: 2025-06-04T10:09:28.732Z
Learning: In the holidays/calendars/islamic.py file, the Islamic calendar date methods in the _IslamicLunar class (like ali_al_rida_death_dates, ashura_dates, etc.) follow a consistent pattern of being single-line methods that return self._get_holiday(CONSTANT, year) without docstrings. New methods should follow this same pattern for consistency.
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/calendars/mongolian.py:1-1
Timestamp: 2025-06-10T12:43:10.577Z
Learning: The holidays project's calendar files (in holidays/calendars/) follow a consistent pattern of NOT having module-level docstrings. They only use class-level docstrings for their main classes. When reviewing calendar files, maintain this consistency and do not suggest adding module docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2490
File: holidays/countries/ethiopia.py:45-45
Timestamp: 2025-04-23T09:59:19.886Z
Learning: For the Ethiopia holidays class, it's appropriate to add a return type hint only to the `_is_leap_year` method to match the base class implementation in `holidays/holiday_base.py`, while keeping other methods without type hints to maintain consistency with other country implementations.
Learnt from: KJhellico
PR: vacanza/holidays#2465
File: holidays/countries/suriname.py:219-251
Timestamp: 2025-04-13T19:10:31.502Z
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.
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: PPsyrius
PR: vacanza/holidays#2601
File: tests/countries/test_mongolia.py:128-156
Timestamp: 2025-06-15T11:52:39.572Z
Learning: In the vacanza/holidays project tests, when testing holidays that span multiple consecutive days across many years (like Mongolia's National Festival spanning July 11-13), prefer explicit for loops over complex nested generator expressions with unpacking. The explicit loops are more readable, easier to maintain, and better communicate the testing intent even though the Big O complexity is equivalent.
Learnt from: KJhellico
PR: vacanza/holidays#2437
File: holidays/calendars/tibetan.py:805-810
Timestamp: 2025-04-08T14:50:15.325Z
Learning: The standard behavior for calendar date methods in the holidays library is to return `(None, True)` when a requested year is not found in the date dictionary, rather than raising an exception or requiring documentation for out-of-range years.
Learnt from: KJhellico
PR: vacanza/holidays#2437
File: holidays/calendars/tibetan.py:805-810
Timestamp: 2025-04-08T14:50:15.325Z
Learning: The standard behavior for calendar date methods in the holidays library is to return `(None, True)` when a requested year is not found in the date dictionary, rather than raising an exception or requiring documentation for out-of-range years.
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: holidays/countries/mongolia.py:140-146
Timestamp: 2025-06-15T11:50:44.366Z
Learning: The holidays library doesn't currently have helper functions like `_add_holiday_span` for adding consecutive multi-day holidays. Countries like Mongolia, Thailand, and Vietnam implement multi-day holiday spans using inline loops with `_timedelta(dt, delta)` pattern.
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.
snapshots/countries/BT_COMMON.json (10)
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.
Learnt from: KJhellico
PR: vacanza/holidays#2654
File: snapshots/countries/CV_RS.json:471-478
Timestamp: 2025-06-24T17:26:17.728Z
Learning: Snapshot files in the holidays library (like those in snapshots/countries/) are generated automatically and should not be manually edited. Any issues with snapshot content should be addressed in the source code that generates them, not in the snapshot files themselves.
Learnt from: PPsyrius
PR: vacanza/holidays#2349
File: snapshots/countries/TW_COMMON.json:9-12
Timestamp: 2025-03-13T07:50:10.598Z
Learning: JSON files in the `snapshots/` directory (like `snapshots/countries/TW_COMMON.json`) are automatically generated by the `make snapshot` command and not meant to be manually edited.
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:1-12
Timestamp: 2025-04-24T04:59:38.436Z
Learning: The holidays library uses a standard file header across country implementation files that includes copyright information, authors, website, and license details. New country implementation files should follow this same header format.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:1-12
Timestamp: 2025-04-24T04:59:38.436Z
Learning: The holidays library uses a standard file header across country implementation files that includes copyright information, authors, website, and license details. New country implementation files should follow this same header format.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_polynesia.py:1-12
Timestamp: 2025-06-19T05:54:49.792Z
Learning: The holidays library uses a standard file header format across all country implementation files consisting of a comprehensive comment block with project description, authors, website, and license information. Country files do not use module-level docstrings but instead rely on this header format followed by class-level docstrings.
Learnt from: KJhellico
PR: vacanza/holidays#2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.163Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).
holidays/countries/bhutan.py (32)
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2490
File: holidays/countries/ethiopia.py:45-45
Timestamp: 2025-04-23T09:59:19.886Z
Learning: For the Ethiopia holidays class, it's appropriate to add a return type hint only to the `_is_leap_year` method to match the base class implementation in `holidays/holiday_base.py`, while keeping other methods without type hints to maintain consistency with other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: PPsyrius
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:78-90
Timestamp: 2025-06-13T12:18:03.539Z
Learning: The holidays codebase now uses the constructor signature pattern `__init__(self, *args, islamic_show_estimated: bool = True, **kwargs)` across country classes.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: holidays/countries/nepal.py:24-26
Timestamp: 2025-03-30T20:18:46.006Z
Learning: In the holidays library, country classes do not directly implement `_populate()`. Instead, they implement specialized methods like `_populate_public_holidays()`, and the base class `HolidayBase` handles the orchestration by calling these specialized methods.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/countries/bhutan.py:13-16
Timestamp: 2025-06-16T14:08:09.492Z
Learning: In the holidays library, translation is performed in the `_add_holiday` methods, not at the string level. Holiday strings passed to `_add_holiday_*` methods are processed through the translation machinery within those methods, so using `tr()` or `self.tr()` wrappers is unnecessary.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: holidays/countries/andorra.py:13-14
Timestamp: 2025-05-06T15:29:31.893Z
Learning: In this codebase, `tr` imported as `from gettext import gettext as tr` is used as a message marker for extracting translatable strings when generating .po files, not just for runtime translation.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:0-0
Timestamp: 2025-05-10T04:32:15.760Z
Learning: In the holidays package, detailed historical context and additional information should be added as comments at the method level or above conditional blocks, while comments directly above tr() function calls should only contain the holiday name itself (e.g., "# Independence Day.").
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: PPsyrius
PR: vacanza/holidays#2676
File: holidays/countries/tunisia.py:25-25
Timestamp: 2025-06-25T10:12:30.448Z
Learning: The holidays library intentionally duplicates label strings like `estimated_label` across country modules rather than centralizing them. This duplication is the established library-wide approach and should not be suggested for refactoring.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:195-199
Timestamp: 2025-05-09T18:34:33.990Z
Learning: In the holidays library, localization (l10n) is handled through separate .po files for different languages rather than combining multiple translations in a single string. The code should use the default language with tr() function, and translations are provided in language-specific .po files.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.
Learnt from: KJhellico
PR: vacanza/holidays#2483
File: holidays/countries/turks_and_caicos_islands.py:117-118
Timestamp: 2025-05-13T13:23:11.375Z
Learning: The holidays library uses `_add_christmas_day_two` method to add Boxing Day holiday, not `_add_boxing_day`.
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:84-85
Timestamp: 2025-03-30T08:08:30.415Z
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: 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/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants like FEB, TUE, MAR, and SUN internally through parent class implementations even when these constants don't appear directly in the file.
Learnt from: KJhellico
PR: vacanza/holidays#2631
File: holidays/countries/sint_maarten.py:94-95
Timestamp: 2025-06-14T20:43:15.370Z
Learning: The `_add_*` helper methods in the holidays library (such as `_add_christmas_day_two()`, `_add_labor_day()`, etc.) don't have default holiday names, so the name parameter should always be explicitly specified when calling these methods.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2385
File: holidays/countries/pakistan.py:59-60
Timestamp: 2025-03-31T11:50:50.488Z
Learning: In the holidays library, function names and comments follow en_US spelling conventions (e.g., "Labor Day"), while the default strings may use different locale conventions (e.g., "Labour Day" for en_PK) and are translated appropriately using the gettext function.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:114-116
Timestamp: 2025-06-14T20:36:17.239Z
Learning: In the holidays codebase, message comments should always use en_US spelling conventions, while translatable strings can use appropriate local spellings for the target country/region.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (`government`, `mandatory`, and `public`), which are utilized by syntactic sugar methods.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:171-184
Timestamp: 2025-06-19T02:34:14.456Z
Learning: In the holidays library, `_CustomIslamicHolidays` subclasses follow a consistent pattern of NOT having docstrings. They go directly to defining date dictionaries, as evidenced by Malaysia, Singapore, UAE, and dozens of other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: holidays/countries/mongolia.py:140-146
Timestamp: 2025-06-15T11:50:44.366Z
Learning: The holidays library doesn't currently have helper functions like `_add_holiday_span` for adding consecutive multi-day holidays. Countries like Mongolia, Thailand, and Vietnam implement multi-day holiday spans using inline loops with `_timedelta(dt, delta)` pattern.
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: holidays/countries/nepal.py:52-60
Timestamp: 2025-04-13T20:42:13.152Z
Learning: In the holidays library, country classes follow a consistent initialization pattern: first explicitly initializing each parent holiday group class with their specific parameters, then calling `super().__init__(*args, **kwargs)` at the end to properly initialize the base `HolidayBase` class.
🧬 Code Graph Analysis (2)
holidays/calendars/tibetan.py (2)
holidays/calendars/custom.py (1)
_CustomCalendar
(33-34)holidays/holiday_base.py (1)
get
(967-990)
holidays/countries/bhutan.py (2)
holidays/groups/tibetan.py (9)
TibetanCalendarHolidays
(20-104)_add_day_of_offering
(58-64)_add_losar
(50-56)_add_death_of_zhabdrung
(82-88)_add_buddha_parinirvana
(42-48)_add_birth_of_guru_rinpoche
(74-80)_add_buddha_first_sermon
(66-72)_add_blessed_rainy_day
(90-96)_add_dashain
(98-104)holidays/holiday_base.py (1)
HolidayBase
(57-1301)
🪛 Pylint (3.3.7)
tests/countries/test_bhutan.py
[convention] 22-22: Unnecessary parens after '=' keyword
(C0325)
[convention] 1-1: Missing module docstring
(C0114)
[convention] 19-19: Missing class docstring
(C0115)
[warning] 21-21: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestBhutan.setUpClass' method
(W0221)
[convention] 24-24: Missing function or method docstring
(C0116)
[convention] 27-27: Missing function or method docstring
(C0116)
[convention] 30-30: Missing function or method docstring
(C0116)
[convention] 33-33: Missing function or method docstring
(C0116)
[convention] 38-38: Missing function or method docstring
(C0116)
[convention] 43-43: Missing function or method docstring
(C0116)
[convention] 49-49: Missing function or method docstring
(C0116)
[convention] 55-55: Missing function or method docstring
(C0116)
[convention] 61-61: Missing function or method docstring
(C0116)
[convention] 66-66: Missing function or method docstring
(C0116)
[convention] 72-72: Missing function or method docstring
(C0116)
[convention] 77-77: Missing function or method docstring
(C0116)
[convention] 82-82: Missing function or method docstring
(C0116)
[convention] 87-87: Missing function or method docstring
(C0116)
[convention] 90-90: Missing function or method docstring
(C0116)
[convention] 93-93: Missing function or method docstring
(C0116)
[convention] 96-96: Missing function or method docstring
(C0116)
[convention] 99-99: Missing function or method docstring
(C0116)
[convention] 104-104: Missing function or method docstring
(C0116)
[convention] 109-109: Missing function or method docstring
(C0116)
[convention] 114-114: Missing function or method docstring
(C0116)
[convention] 120-120: Missing function or method docstring
(C0116)
[convention] 125-125: Missing function or method docstring
(C0116)
[convention] 128-128: Missing function or method docstring
(C0116)
[refactor] 19-19: Too many public methods (25/20)
(R0904)
holidays/calendars/tibetan.py
[convention] 1-1: Missing module docstring
(C0114)
[convention] 811-811: Missing function or method docstring
(C0116)
[convention] 814-814: Missing function or method docstring
(C0116)
[convention] 817-817: Missing function or method docstring
(C0116)
[convention] 820-820: Missing function or method docstring
(C0116)
[convention] 823-823: Missing function or method docstring
(C0116)
[convention] 826-826: Missing function or method docstring
(C0116)
[convention] 829-829: Missing function or method docstring
(C0116)
[convention] 832-832: Missing function or method docstring
(C0116)
holidays/countries/bhutan.py
[convention] 21-21: Line too long (171/100)
(C0301)
[convention] 1-1: Missing module docstring
(C0114)
[convention] 97-97: Missing class docstring
(C0115)
[convention] 101-101: Missing class docstring
(C0115)
⏰ Context from checks skipped due to timeout of 300000ms (2)
- GitHub Check: Test docs build
- GitHub Check: Build distribution
🔇 Additional comments (5)
holidays/countries/bhutan.py (2)
17-95
: Solid implementation following project conventions.The Bhutan class properly inherits from both
HolidayBase
andTibetanCalendarHolidays
, correctly initializes both parent classes, and uses the appropriate methods to add holidays. The mix of fixed Gregorian holidays and Tibetan lunisolar holidays is well organized.
97-102
: Alias classes follow standard pattern.The
BT
andBTN
alias classes correctly inherit fromBhutan
without additional implementation, which is the expected pattern for country aliases.holidays/calendars/tibetan.py (1)
29-838
: Comprehensive calendar implementation with extensive date coverage.The
_TibetanLunisolar
class provides thorough coverage of Tibetan holidays from 1970-2070. The date dictionaries are well-organized by holiday type, and the individual date methods follow the consistent pattern used throughout the holidays library. The_CustomTibetanHolidays
class properly integrates with the customization framework.tests/countries/test_bhutan.py (1)
19-152
: Comprehensive test coverage following project conventions.The test class properly inherits from
CommonCountryTests
andTestCase
, includes individual methods testing each holiday across multiple years, and provides a comprehensive validation for 2024. The test structure aligns with established project patterns and covers both fixed Gregorian and movable Tibetan lunisolar holidays effectively.snapshots/countries/BT_COMMON.json (1)
1-1653
: Confirm snapshot was produced viamake snapshot
Snapshot files are expected to be fully auto-generated. Any manual edits will be overwritten and may introduce skew with the algorithmic source of truth.
Kindly double-check that:
make snapshot
(or the project’s equivalent helper) was run after the Bhutan provider implementation stabilised.- No hand-touching was done post-generation (grep for stray whitespace, ordering anomalies, etc.).
If everything is auto-generated, you’re good; otherwise, please regenerate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
holidays/countries/bhutan.py
(1 hunks)snapshots/countries/BT_COMMON.json
(1 hunks)tests/countries/test_bhutan.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:0-0
Timestamp: 2025-05-10T04:32:15.760Z
Learning: In the holidays package, detailed historical context and additional information should be added as comments at the method level or above conditional blocks, while comments directly above tr() function calls should only contain the holiday name itself (e.g., "# Independence Day.").
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: KJhellico
PR: vacanza/holidays#2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.163Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: README.md:108-108
Timestamp: 2025-06-14T20:13:29.536Z
Learning: In the vacanza/holidays repository, the team prefers to manually update the country count in README.md when adding new countries, with tests in place to verify the count stays accurate. They are satisfied with this approach and do not want it automated.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.
Learnt from: KJhellico
PR: vacanza/holidays#2593
File: holidays/countries/senegal.py:66-110
Timestamp: 2025-06-06T14:40:31.932Z
Learning: In the holidays library, within the _populate_public_holidays method, holidays should be arranged by calendar type (Islamic holidays first, then Gregorian holidays) without additional type grouping comments. The organization by calendar type is sufficient and follows the project's established conventions.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_polynesia.py:1-12
Timestamp: 2025-06-19T05:54:49.792Z
Learning: The holidays library uses a standard file header format across all country implementation files consisting of a comprehensive comment block with project description, authors, website, and license information. Country files do not use module-level docstrings but instead rely on this header format followed by class-level docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:278-377
Timestamp: 2025-03-05T02:35:03.298Z
Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.
tests/countries/test_bhutan.py (15)
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
Learnt from: PPsyrius
PR: vacanza/holidays#2615
File: tests/countries/test_anguilla.py:1-12
Timestamp: 2025-06-16T15:48:48.680Z
Learning: Test files in the holidays repository follow a standardized structure without module or class docstrings. All country test files use the same pattern: license header, imports, and class definition (`class Test{Country}(CommonCountryTests, TestCase):`) without docstrings. This is an established codebase convention that should be maintained for consistency.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:33:53.254Z
Learning: For Turkmenistan holiday tests, recommend using CommonCountryTests as the base class rather than unittest.TestCase to follow project conventions, be consistent with other country test files, and gain access to common test utilities.
Learnt from: PPsyrius
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are covered by the test_eid_al_fitr_day() method, which tests both regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: tests/countries/test_mongolia.py:128-156
Timestamp: 2025-06-15T11:52:39.572Z
Learning: In the vacanza/holidays project tests, when testing holidays that span multiple consecutive days across many years (like Mongolia's National Festival spanning July 11-13), prefer explicit for loops over complex nested generator expressions with unpacking. The explicit loops are more readable, easier to maintain, and better communicate the testing intent even though the Big O complexity is equivalent.
snapshots/countries/BT_COMMON.json (18)
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.
Learnt from: KJhellico
PR: vacanza/holidays#2654
File: snapshots/countries/CV_RS.json:471-478
Timestamp: 2025-06-24T17:26:17.728Z
Learning: Snapshot files in the holidays library (like those in snapshots/countries/) are generated automatically and should not be manually edited. Any issues with snapshot content should be addressed in the source code that generates them, not in the snapshot files themselves.
Learnt from: PPsyrius
PR: vacanza/holidays#2349
File: snapshots/countries/TW_COMMON.json:9-12
Timestamp: 2025-03-13T07:50:10.598Z
Learning: JSON files in the `snapshots/` directory (like `snapshots/countries/TW_COMMON.json`) are automatically generated by the `make snapshot` command and not meant to be manually edited.
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:1-12
Timestamp: 2025-04-24T04:59:38.436Z
Learning: The holidays library uses a standard file header across country implementation files that includes copyright information, authors, website, and license details. New country implementation files should follow this same header format.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:1-12
Timestamp: 2025-04-24T04:59:38.436Z
Learning: The holidays library uses a standard file header across country implementation files that includes copyright information, authors, website, and license details. New country implementation files should follow this same header format.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_polynesia.py:1-12
Timestamp: 2025-06-19T05:54:49.792Z
Learning: The holidays library uses a standard file header format across all country implementation files consisting of a comprehensive comment block with project description, authors, website, and license information. Country files do not use module-level docstrings but instead rely on this header format followed by class-level docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Learnt from: PPsyrius
PR: vacanza/holidays#2676
File: holidays/countries/tunisia.py:25-25
Timestamp: 2025-06-25T10:12:30.448Z
Learning: The holidays library intentionally duplicates label strings like `estimated_label` across country modules rather than centralizing them. This duplication is the established library-wide approach and should not be suggested for refactoring.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.
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: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: tests/countries/test_mongolia.py:128-156
Timestamp: 2025-06-15T11:52:39.572Z
Learning: In the vacanza/holidays project tests, when testing holidays that span multiple consecutive days across many years (like Mongolia's National Festival spanning July 11-13), prefer explicit for loops over complex nested generator expressions with unpacking. The explicit loops are more readable, easier to maintain, and better communicate the testing intent even though the Big O complexity is equivalent.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
holidays/countries/bhutan.py (32)
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2490
File: holidays/countries/ethiopia.py:45-45
Timestamp: 2025-04-23T09:59:19.886Z
Learning: For the Ethiopia holidays class, it's appropriate to add a return type hint only to the `_is_leap_year` method to match the base class implementation in `holidays/holiday_base.py`, while keeping other methods without type hints to maintain consistency with other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: PPsyrius
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:78-90
Timestamp: 2025-06-13T12:18:03.539Z
Learning: The holidays codebase now uses the constructor signature pattern `__init__(self, *args, islamic_show_estimated: bool = True, **kwargs)` across country classes.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: holidays/countries/nepal.py:24-26
Timestamp: 2025-03-30T20:18:46.006Z
Learning: In the holidays library, country classes do not directly implement `_populate()`. Instead, they implement specialized methods like `_populate_public_holidays()`, and the base class `HolidayBase` handles the orchestration by calling these specialized methods.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/countries/bhutan.py:13-16
Timestamp: 2025-06-16T14:08:09.492Z
Learning: In the holidays library, translation is performed in the `_add_holiday` methods, not at the string level. Holiday strings passed to `_add_holiday_*` methods are processed through the translation machinery within those methods, so using `tr()` or `self.tr()` wrappers is unnecessary.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: holidays/countries/andorra.py:13-14
Timestamp: 2025-05-06T15:29:31.893Z
Learning: In this codebase, `tr` imported as `from gettext import gettext as tr` is used as a message marker for extracting translatable strings when generating .po files, not just for runtime translation.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:0-0
Timestamp: 2025-05-10T04:32:15.760Z
Learning: In the holidays package, detailed historical context and additional information should be added as comments at the method level or above conditional blocks, while comments directly above tr() function calls should only contain the holiday name itself (e.g., "# Independence Day.").
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: PPsyrius
PR: vacanza/holidays#2676
File: holidays/countries/tunisia.py:25-25
Timestamp: 2025-06-25T10:12:30.448Z
Learning: The holidays library intentionally duplicates label strings like `estimated_label` across country modules rather than centralizing them. This duplication is the established library-wide approach and should not be suggested for refactoring.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:195-199
Timestamp: 2025-05-09T18:34:33.990Z
Learning: In the holidays library, localization (l10n) is handled through separate .po files for different languages rather than combining multiple translations in a single string. The code should use the default language with tr() function, and translations are provided in language-specific .po files.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.
Learnt from: KJhellico
PR: vacanza/holidays#2483
File: holidays/countries/turks_and_caicos_islands.py:117-118
Timestamp: 2025-05-13T13:23:11.375Z
Learning: The holidays library uses `_add_christmas_day_two` method to add Boxing Day holiday, not `_add_boxing_day`.
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:84-85
Timestamp: 2025-03-30T08:08:30.415Z
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: 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/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants like FEB, TUE, MAR, and SUN internally through parent class implementations even when these constants don't appear directly in the file.
Learnt from: KJhellico
PR: vacanza/holidays#2631
File: holidays/countries/sint_maarten.py:94-95
Timestamp: 2025-06-14T20:43:15.370Z
Learning: The `_add_*` helper methods in the holidays library (such as `_add_christmas_day_two()`, `_add_labor_day()`, etc.) don't have default holiday names, so the name parameter should always be explicitly specified when calling these methods.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2385
File: holidays/countries/pakistan.py:59-60
Timestamp: 2025-03-31T11:50:50.488Z
Learning: In the holidays library, function names and comments follow en_US spelling conventions (e.g., "Labor Day"), while the default strings may use different locale conventions (e.g., "Labour Day" for en_PK) and are translated appropriately using the gettext function.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:114-116
Timestamp: 2025-06-14T20:36:17.239Z
Learning: In the holidays codebase, message comments should always use en_US spelling conventions, while translatable strings can use appropriate local spellings for the target country/region.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: holidays/countries/mongolia.py:140-146
Timestamp: 2025-06-15T11:50:44.366Z
Learning: The holidays library doesn't currently have helper functions like `_add_holiday_span` for adding consecutive multi-day holidays. Countries like Mongolia, Thailand, and Vietnam implement multi-day holiday spans using inline loops with `_timedelta(dt, delta)` pattern.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (`government`, `mandatory`, and `public`), which are utilized by syntactic sugar methods.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:171-184
Timestamp: 2025-06-19T02:34:14.456Z
Learning: In the holidays library, `_CustomIslamicHolidays` subclasses follow a consistent pattern of NOT having docstrings. They go directly to defining date dictionaries, as evidenced by Malaysia, Singapore, UAE, and dozens of other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (like `special_government_holidays`, `special_mandatory_holidays`, and `special_public_holidays`), which are utilized by syntactic sugar methods to pick up the appropriate holidays based on the selected category.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (like `special_government_holidays`, `special_mandatory_holidays`, and `special_public_holidays`), which are utilized by syntactic sugar methods to pick up the appropriate holidays based on the selected category.
🪛 Pylint (3.3.7)
tests/countries/test_bhutan.py
[convention] 22-22: Unnecessary parens after '=' keyword
(C0325)
[convention] 1-1: Missing module docstring
(C0114)
[convention] 19-19: Missing class docstring
(C0115)
[warning] 21-21: Number of parameters was 4 in 'TestCase.setUpClass' and is now 1 in overriding 'TestBhutan.setUpClass' method
(W0221)
[convention] 24-24: Missing function or method docstring
(C0116)
[convention] 27-27: Missing function or method docstring
(C0116)
[convention] 30-30: Missing function or method docstring
(C0116)
[convention] 33-33: Missing function or method docstring
(C0116)
[convention] 38-38: Missing function or method docstring
(C0116)
[convention] 43-43: Missing function or method docstring
(C0116)
[convention] 49-49: Missing function or method docstring
(C0116)
[convention] 55-55: Missing function or method docstring
(C0116)
[convention] 61-61: Missing function or method docstring
(C0116)
[convention] 66-66: Missing function or method docstring
(C0116)
[convention] 72-72: Missing function or method docstring
(C0116)
[convention] 77-77: Missing function or method docstring
(C0116)
[convention] 82-82: Missing function or method docstring
(C0116)
[convention] 87-87: Missing function or method docstring
(C0116)
[convention] 90-90: Missing function or method docstring
(C0116)
[convention] 93-93: Missing function or method docstring
(C0116)
[convention] 96-96: Missing function or method docstring
(C0116)
[convention] 99-99: Missing function or method docstring
(C0116)
[convention] 104-104: Missing function or method docstring
(C0116)
[convention] 109-109: Missing function or method docstring
(C0116)
[convention] 114-114: Missing function or method docstring
(C0116)
[convention] 120-120: Missing function or method docstring
(C0116)
[convention] 125-125: Missing function or method docstring
(C0116)
[convention] 128-128: Missing function or method docstring
(C0116)
[refactor] 19-19: Too many public methods (25/20)
(R0904)
holidays/countries/bhutan.py
[convention] 21-21: Line too long (171/100)
(C0301)
[convention] 1-1: Missing module docstring
(C0114)
[convention] 99-99: Missing class docstring
(C0115)
[convention] 103-103: Missing class docstring
(C0115)
⏰ Context from checks skipped due to timeout of 300000ms (6)
- GitHub Check: Test Python 3.10 on windows-latest
- GitHub Check: Test Python 3.9 on windows-latest
- GitHub Check: Test Python 3.12 on windows-latest
- GitHub Check: Test Python 3.13 on windows-latest
- GitHub Check: Test Python 3.11 on ubuntu-latest
- GitHub Check: Test Python 3.13 on macos-latest
🔇 Additional comments (5)
holidays/countries/bhutan.py (3)
17-97
: Solid implementation following established patterns.The Bhutan holidays class correctly inherits from both base classes and implements holidays using the appropriate calendar-specific methods. The mix of fixed Gregorian dates and Tibetan lunisolar calendar holidays is well-structured.
99-104
: Alias classes properly implemented.The BT and BTN alias classes follow the standard pattern used throughout the codebase.
21-21
: Minor: Consider breaking the long reference URL.The URL exceeds the 100-character line limit. You could break it across lines for better readability.
- * [ROYAL GOVERNMENT OF BHUTAN](https://web.archive.org/web/20250407140158/https://www.moha.gov.bt/wp-content/uploads/2023/11/National-Holiday-List-for-2024-2-.pdf) + * [ROYAL GOVERNMENT OF BHUTAN](https://web.archive.org/web/20250407140158/ + https://www.moha.gov.bt/wp-content/uploads/2023/11/National-Holiday-List-for-2024-2-.pdf)⛔ Skipped due to learnings
Learnt from: PPsyrius PR: vacanza/holidays#2632 File: holidays/countries/solomon_islands.py:95-98 Timestamp: 2025-06-16T12:28:31.641Z Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: ankushhKapoor PR: vacanza/holidays#2601 File: holidays/calendars/mongolian.py:1-1 Timestamp: 2025-06-10T12:43:10.577Z Learning: The holidays project's calendar files (in holidays/calendars/) follow a consistent pattern of NOT having module-level docstrings. They only use class-level docstrings for their main classes. When reviewing calendar files, maintain this consistency and do not suggest adding module docstrings.
Learnt from: PPsyrius PR: vacanza/holidays#2615 File: tests/countries/test_anguilla.py:1-12 Timestamp: 2025-06-16T15:48:48.680Z Learning: Test files in the holidays repository follow a standardized structure without module or class docstrings. All country test files use the same pattern: license header, imports, and class definition (`class Test{Country}(CommonCountryTests, TestCase):`) without docstrings. This is an established codebase convention that should be maintained for consistency.
Learnt from: PPsyrius PR: vacanza/holidays#2643 File: holidays/countries/mauritius.py:144-169 Timestamp: 2025-06-19T02:34:18.382Z Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius PR: vacanza/holidays#2638 File: holidays/countries/svalbard_and_jan_mayen.py:1-12 Timestamp: 2025-06-16T11:42:28.293Z Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
Learnt from: KJhellico PR: vacanza/holidays#2530 File: tests/countries/test_andorra.py:23-28 Timestamp: 2025-05-06T21:07:11.577Z Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: PPsyrius PR: vacanza/holidays#2490 File: holidays/countries/ethiopia.py:45-45 Timestamp: 2025-04-23T09:59:19.886Z Learning: For the Ethiopia holidays class, it's appropriate to add a return type hint only to the `_is_leap_year` method to match the base class implementation in `holidays/holiday_base.py`, while keeping other methods without type hints to maintain consistency with other country implementations.
Learnt from: PPsyrius PR: vacanza/holidays#2489 File: holidays/countries/sao_tome_and_principe.py:22-26 Timestamp: 2025-04-23T14:55:35.504Z Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Learnt from: PPsyrius PR: vacanza/holidays#2489 File: holidays/countries/sao_tome_and_principe.py:22-26 Timestamp: 2025-04-23T14:55:35.504Z Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Learnt from: PPsyrius PR: vacanza/holidays#2601 File: holidays/countries/mongolia.py:25-30 Timestamp: 2025-06-24T18:25:25.165Z Learning: In the holidays project, reference URLs in docstrings/comments that exceed 100 characters are acceptable if they pass the pre-commit tests, even if Pylint flags them as line length violations.
Learnt from: KJhellico PR: vacanza/holidays#2635 File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32 Timestamp: 2025-06-16T14:05:58.032Z Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: KJhellico PR: vacanza/holidays#2629 File: holidays/countries/namibia.py:70-73 Timestamp: 2025-06-14T11:04:24.104Z Learning: In Namibia's holiday system, holidays declared by presidential proclamation under Section 1(3) of the Public Holidays Act may not automatically be subject to the Sunday-to-Monday observation rule in Section 1(2), which primarily applies to holidays listed in the Schedule. Genocide Remembrance Day (May 28) starting in 2025 is treated as a fixed commemorative date without observed day handling.
Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/countries/macau.py:278-377 Timestamp: 2025-03-05T02:35:03.298Z Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.
Learnt from: PPsyrius PR: vacanza/holidays#2615 File: tests/countries/test_anguilla.py:52-64 Timestamp: 2025-06-15T10:15:39.883Z Learning: In the Anguilla holidays implementation, March 2 only has "James Ronald Webster Day" (from 2010 onwards). There is no "Sovereignty Day" holiday on this date. Queen's/King's Birthday holidays are in June, not March.
Learnt from: PPsyrius PR: vacanza/holidays#2323 File: holidays/countries/macau.py:284-366 Timestamp: 2025-03-04T11:41:56.389Z Learning: For Macau holidays implementation, maintaining separate methods for each holiday category (PUBLIC, MANDATORY, GOVERNMENT) is preferred because these categories are based on different sets of laws and have distinct historical evolution.
Learnt from: PPsyrius PR: vacanza/holidays#2490 File: holidays/locale/en_ET/LC_MESSAGES/ET.po:95-101 Timestamp: 2025-04-23T09:51:03.951Z Learning: Ethiopian holiday translations should follow the exact wording from official government sources (such as Negarit Gazeta Proclamations), even when they contain seemingly redundant wording like "Day" appearing twice.
Learnt from: PPsyrius PR: vacanza/holidays#2490 File: holidays/locale/en_ET/LC_MESSAGES/ET.po:99-101 Timestamp: 2025-04-23T09:53:20.043Z Learning: For Ethiopian holidays in the en_ET locale, translations must maintain the exact official wording from government sources such as Negarit Gazeta Proclamations, even when they contain redundancies like the word "Day" appearing twice (e.g., "Ethiopian National Unity Day (Ethiopian Nations and Nationalities) Day").
tests/countries/test_bhutan.py (1)
19-152
: Comprehensive test coverage implemented correctly.The test suite properly covers all Bhutan holidays with individual tests for each holiday type and a comprehensive validation for 2024. The mix of fixed-date and movable holiday testing follows established patterns.
snapshots/countries/BT_COMMON.json (1)
4-8
: Losar naming issue fixed – snapshot looks goodThe previous static “Losar Wood Male Dragon Year” bug is gone; entries now use the generic “Losar” label (or a semicolon-separated compound when multiple holidays fall on the same date).
No red flags spotted in this auto-generated snapshot.
holidays/calendars/tibetan.py
Outdated
def day_of_offering_date(self, year: int) -> tuple[Optional[date], bool]: | ||
return self._get_holiday("DAY_OF_OFFERING", year) | ||
|
||
def losar_date(self, year: int) -> tuple[Optional[date], bool]: | ||
return self._get_holiday("LOSAR", year) | ||
|
||
def death_of_zhabdrung_date(self, year: int) -> tuple[Optional[date], bool]: | ||
return self._get_holiday("DEATH_OF_ZHABDRUNG", year) | ||
|
||
def buddha_parinirvana_date(self, year: int) -> tuple[Optional[date], bool]: | ||
return self._get_holiday("BUDDHA_PARINIRVANA", year) | ||
|
||
def birth_of_guru_rinpoche_date(self, year: int) -> tuple[Optional[date], bool]: | ||
return self._get_holiday("BIRTH_OF_GURU_RINPOCHE", year) | ||
|
||
def buddha_first_sermon_date(self, year: int) -> tuple[Optional[date], bool]: | ||
return self._get_holiday("BUDDHA_FIRST_SERMON", year) | ||
|
||
def blessed_rainy_day_date(self, year: int) -> tuple[Optional[date], bool]: | ||
return self._get_holiday("BLESSED_RAINY_DAY", year) | ||
|
||
def dashain_date(self, year: int) -> tuple[Optional[date], bool]: | ||
return self._get_holiday("DASHAIN", year) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorting Alphabetically:
def day_of_offering_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("DAY_OF_OFFERING", year) | |
def losar_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("LOSAR", year) | |
def death_of_zhabdrung_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("DEATH_OF_ZHABDRUNG", year) | |
def buddha_parinirvana_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("BUDDHA_PARINIRVANA", year) | |
def birth_of_guru_rinpoche_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("BIRTH_OF_GURU_RINPOCHE", year) | |
def buddha_first_sermon_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("BUDDHA_FIRST_SERMON", year) | |
def blessed_rainy_day_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("BLESSED_RAINY_DAY", year) | |
def dashain_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("DASHAIN", year) | |
def birth_of_guru_rinpoche_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("BIRTH_OF_GURU_RINPOCHE", year) | |
def blessed_rainy_day_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("BLESSED_RAINY_DAY", year) | |
def buddha_first_sermon_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("BUDDHA_FIRST_SERMON", year) | |
def buddha_parinirvana_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("BUDDHA_PARINIRVANA", year) | |
def dashain_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("DASHAIN", year) | |
def day_of_offering_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("DAY_OF_OFFERING", year) | |
def death_of_zhabdrung_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("DEATH_OF_ZHABDRUNG", year) | |
def losar_date(self, year: int) -> tuple[Optional[date], bool]: | |
return self._get_holiday("LOSAR", year) |
holidays/calendars/tibetan.py
Outdated
which is sourced from <https://github.com/wp-plugins/bhutanese-calendar>. | ||
""" | ||
|
||
DAY_OF_OFFERING_DATES = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please sort these declarations as well 🙏
holidays/countries/bhutan.py
Outdated
name = "Birth Anniversary of His Majesty the King" | ||
# Birth Anniversary of His Majesty the King (Day 1). | ||
self._add_holiday_feb_21(name) | ||
|
||
# Birth Anniversary of His Majesty the King (Day 2). | ||
self._add_holiday_feb_22(name) | ||
|
||
# Birth Anniversary of His Majesty the King (Day 3). | ||
self._add_holiday_feb_23(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name = "Birth Anniversary of His Majesty the King" | |
# Birth Anniversary of His Majesty the King (Day 1). | |
self._add_holiday_feb_21(name) | |
# Birth Anniversary of His Majesty the King (Day 2). | |
self._add_holiday_feb_22(name) | |
# Birth Anniversary of His Majesty the King (Day 3). | |
self._add_holiday_feb_23(name) | |
# Birth Anniversary of His Majesty the King. | |
name = "Birth Anniversary of His Majesty the King" | |
self._add_holiday_feb_21(name) | |
self._add_holiday_feb_22(name) | |
self._add_holiday_feb_23(name) |
We'll need to add checks for Jigme Singye Wangchuk (NOV, 11, for 1973-2006), Jigme Dorji Wangchuck (MAY 2, for 1952-1972) - Jigme Wangchuk got no definite birth dates so we can probably skip him.
Edit: fix wrong date for Jigme Singye Wangchuk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it be something like this?
if 1952 <= self._year <= 1972:
name = "Birth Anniversary of Jigme Dorji Wangchuck"
elif 1973 <= self._year <= 2006:
name = "Birth Anniversary of Jigme Singye Wangchuck"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the name, but the date changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 1952 <= self._year <= 1972:
self._add_holiday_may_2(name)
elif 1973 <= self._year <= 2006:
self._add_holiday_feb_21(name)
else:
self._add_holiday_feb_21(name)
self._add_holiday_feb_22(name)
self._add_holiday_feb_23(name)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jigme Singye Wangchuck was born November 11. And I think the holiday has always been three days long.
README.md
Outdated
<td>Bhutan</td> | ||
<td>BT</td> | ||
<td></td> | ||
<td><strong>dz_BT</strong>, en_US</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that l10n support is removed
<td><strong>dz_BT</strong>, en_US</td> | |
<td></td> |
holidays/countries/bhutan.py
Outdated
""" | ||
|
||
country = "BT" | ||
start_year = 1970 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless there's a specific reason I think we can went down all the way to 1948 as our start_year
(our source https://github.com/wp-plugins/bhutanese-calendar supports down all the way to 1900 so it's feasible)
start_year = 1970 | |
# Gained Independence on August 15th, 1947. | |
start_year = 1948 |
Or alternatively, since we are lacking in term of non-religious holidays sources, 2007 work as well:
start_year = 1970 | |
# Jigme Khesar Namgyel Wangchuck ascended to the throne on December 9th, 2006. | |
start_year = 2007 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are starting the year from 2007, I think it will not be valid to include holidays specific to these days, as all the holidays listed fall before 2007. #2635 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @KJhellico, could you please take a look at my comment above regarding the holidays before 2007? I want to make sure we're aligned before proceeding. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we take 2007 as start_year
, then we don't look at the changes that came before that.
holidays/countries/bhutan.py
Outdated
# Thimphu Drubchoe (Thimphu only). | ||
self._add_holiday_sep_9("Thimphu Drubchoe") | ||
|
||
name = "Thimphu Tshechu" | ||
# Thimphu Tshechu (Thimphu only, Day 1). | ||
self._add_holiday_sep_13(name) | ||
|
||
# Thimphu Tshechu (Thimphu only, Day 2). | ||
self._add_holiday_sep_14(name) | ||
|
||
# Thimphu Tshechu (Thimphu only, Day 3). | ||
self._add_holiday_sep_15(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that these are for Thimphu only, maybe move this to subdiv 15
https://www.iso.org/obp/ui/#iso:code:3166:BT
# Thimphu Drubchoe (Thimphu only). | |
self._add_holiday_sep_9("Thimphu Drubchoe") | |
name = "Thimphu Tshechu" | |
# Thimphu Tshechu (Thimphu only, Day 1). | |
self._add_holiday_sep_13(name) | |
# Thimphu Tshechu (Thimphu only, Day 2). | |
self._add_holiday_sep_14(name) | |
# Thimphu Tshechu (Thimphu only, Day 3). | |
self._add_holiday_sep_15(name) | |
# Thimphu Drubchoe. | |
self._add_holiday_sep_9("Thimphu Drubchoe") | |
# Thimphu Tshechu. | |
name = "Thimphu Tshechu" | |
self._add_holiday_sep_13(name) | |
self._add_holiday_sep_14(name) | |
self._add_holiday_sep_15(name) |
tests/countries/test_bhutan.py
Outdated
def test_kings_birthday_day1(self): | ||
self.assertHolidayName( | ||
"Birth Anniversary of His Majesty the King", | ||
(f"{year}-02-21" for year in range(1970, 2050)), | ||
) | ||
|
||
def test_kings_birthday_day2(self): | ||
self.assertHolidayName( | ||
"Birth Anniversary of His Majesty the King", | ||
(f"{year}-02-22" for year in range(1970, 2050)), | ||
) | ||
|
||
def test_kings_birthday_day3(self): | ||
self.assertHolidayName( | ||
"Birth Anniversary of His Majesty the King", | ||
(f"{year}-02-23" for year in range(1970, 2050)), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def test_kings_birthday_day1(self): | |
self.assertHolidayName( | |
"Birth Anniversary of His Majesty the King", | |
(f"{year}-02-21" for year in range(1970, 2050)), | |
) | |
def test_kings_birthday_day2(self): | |
self.assertHolidayName( | |
"Birth Anniversary of His Majesty the King", | |
(f"{year}-02-22" for year in range(1970, 2050)), | |
) | |
def test_kings_birthday_day3(self): | |
self.assertHolidayName( | |
"Birth Anniversary of His Majesty the King", | |
(f"{year}-02-23" for year in range(1970, 2050)), | |
) | |
def test_birthday_anniversary_of_his_majesty_the_king(self): | |
name = "Birth Anniversary of His Majesty the King" | |
self.assertHolidayName(name, (f"{year}-02-21" for year in range(1970, 2050)) | |
self.assertHolidayName(name, (f"{year}-02-22" for year in range(1970, 2050)) | |
self.assertHolidayName(name, (f"{year}-02-23" for year in range(1970, 2050)) |
tests/countries/test_bhutan.py
Outdated
dt = ("2020-01-25", "2021-01-14", "2022-02-02", "2023-01-22", "2024-01-12", "2025-01-30") | ||
self.assertHolidayName(name, dt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same goes for other movable holidays cases:
dt = ("2020-01-25", "2021-01-14", "2022-02-02", "2023-01-22", "2024-01-12", "2025-01-30") | |
self.assertHolidayName(name, dt) | |
self.assertHolidayName( | |
name, | |
"2020-01-25", | |
"2021-01-14", | |
"2022-02-02", | |
"2023-01-22", | |
"2024-01-12", | |
"2025-01-30", | |
) | |
self.assertHolidayName(name, range(1970, 2050)) |
…, update start_year, and enhance test coverage.
…into add-bhutan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (3)
tests/countries/test_bhutan.py (2)
22-22
: Remove unnecessary parentheses around range() call.
46-50
: Formatting issue with multi-day holiday test.The current format tests each day separately. Consider consolidating the assertions for better readability.
holidays/calendars/tibetan.py (1)
809-809
: Add parentheses around return tuple for clarity.The return statement would be more readable with explicit tuple parentheses:
- return date(year, *dt) if dt else None, year not in exact_dates + return (date(year, *dt) if dt else None, year not in exact_dates)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
README.md
(2 hunks)holidays/calendars/tibetan.py
(1 hunks)holidays/countries/bhutan.py
(1 hunks)snapshots/countries/BT_COMMON.json
(1 hunks)tests/countries/test_bhutan.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:0-0
Timestamp: 2025-05-10T04:32:15.760Z
Learning: In the holidays package, detailed historical context and additional information should be added as comments at the method level or above conditional blocks, while comments directly above tr() function calls should only contain the holiday name itself (e.g., "# Independence Day.").
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: KJhellico
PR: vacanza/holidays#2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.163Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: README.md:108-108
Timestamp: 2025-06-14T20:13:29.536Z
Learning: In the vacanza/holidays repository, the team prefers to manually update the country count in README.md when adding new countries, with tests in place to verify the count stays accurate. They are satisfied with this approach and do not want it automated.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.
Learnt from: KJhellico
PR: vacanza/holidays#2593
File: holidays/countries/senegal.py:66-110
Timestamp: 2025-06-06T14:40:31.932Z
Learning: In the holidays library, within the _populate_public_holidays method, holidays should be arranged by calendar type (Islamic holidays first, then Gregorian holidays) without additional type grouping comments. The organization by calendar type is sufficient and follows the project's established conventions.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Learnt from: KJhellico
PR: vacanza/holidays#2631
File: tests/countries/test_sint_maarten.py:62-0
Timestamp: 2025-06-14T21:12:07.224Z
Learning: KJhellico prefers to focus on completing and reviewing the main holiday implementation code before doing detailed reviews of the corresponding test files.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:278-377
Timestamp: 2025-03-05T02:35:03.298Z
Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.
README.md (16)
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
Learnt from: KJhellico
PR: vacanza/holidays#2606
File: README.md:562-568
Timestamp: 2025-06-06T16:02:09.910Z
Learning: The README.md country table displays ISO 3166-1 alpha-2 codes only in the "Code" column. Alpha-3 codes or country aliases should not be included in this table format, maintaining consistency with all other country entries.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2593
File: holidays/countries/senegal.py:104-110
Timestamp: 2025-06-05T17:22:43.114Z
Learning: In the holidays library codebase, country alias classes (like SN, SEN for Senegal) follow a consistent convention of having no docstrings and just containing "pass". This pattern is used across all countries - examples include BR/BRA for Brazil, CA/CAN for Canada, DE/DEU for Germany, etc. Static analysis tools may flag missing docstrings, but the established codebase convention is to keep these alias classes minimal.
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:1-12
Timestamp: 2025-04-24T04:59:38.436Z
Learning: The holidays library uses a standard file header across country implementation files that includes copyright information, authors, website, and license details. New country implementation files should follow this same header format.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:1-12
Timestamp: 2025-04-24T04:59:38.436Z
Learning: The holidays library uses a standard file header across country implementation files that includes copyright information, authors, website, and license details. New country implementation files should follow this same header format.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T04:54:07.204Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: README.md:108-108
Timestamp: 2025-06-14T20:13:29.536Z
Learning: In the vacanza/holidays repository, the team prefers to manually update the country count in README.md when adding new countries, with tests in place to verify the count stays accurate. They are satisfied with this approach and do not want it automated.
Learnt from: KJhellico
PR: vacanza/holidays#2375
File: README.md:224-226
Timestamp: 2025-03-26T22:41:55.075Z
Learning: The countries table in README.md uses HTML format consistently throughout, not Markdown.
Learnt from: PPsyrius
PR: vacanza/holidays#2362
File: holidays/ical.py:53-80
Timestamp: 2025-03-26T08:55:08.917Z
Learning: The holidays library intentionally limits language code support to ISO 639-1 and ISO 639-2 standards (2-3 letter language codes with optional region) to maintain consistency with other modules like `common_holidays` and `financial_holidays`, rather than implementing full RFC 5646 compliance.
Learnt from: KJhellico
PR: vacanza/holidays#2601
File: README.md:108-108
Timestamp: 2025-06-09T19:39:38.818Z
Learning: The correct way to count supported countries in the holidays library is by counting unique country module files in holidays/countries/ (excluding __init__.py) or by counting entries in the COUNTRIES registry, not by counting individual class definitions which include alias classes.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:17.842Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:17.842Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
Learnt from: KJhellico
PR: vacanza/holidays#2483
File: holidays/registry.py:177-177
Timestamp: 2025-04-18T21:13:55.589Z
Learning: In the holidays/registry.py file, COUNTRIES dictionary entries should use the class name (without spaces) as the first element of the tuple (e.g., "TurksAndCaicosIslands"), not the human-readable country name with spaces.
snapshots/countries/BT_COMMON.json (20)
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.
Learnt from: KJhellico
PR: vacanza/holidays#2654
File: snapshots/countries/CV_RS.json:471-478
Timestamp: 2025-06-24T17:26:17.728Z
Learning: Snapshot files in the holidays library (like those in snapshots/countries/) are generated automatically and should not be manually edited. Any issues with snapshot content should be addressed in the source code that generates them, not in the snapshot files themselves.
Learnt from: PPsyrius
PR: vacanza/holidays#2349
File: snapshots/countries/TW_COMMON.json:9-12
Timestamp: 2025-03-13T07:50:10.598Z
Learning: JSON files in the `snapshots/` directory (like `snapshots/countries/TW_COMMON.json`) are automatically generated by the `make snapshot` command and not meant to be manually edited.
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:1-12
Timestamp: 2025-04-24T04:59:38.436Z
Learning: The holidays library uses a standard file header across country implementation files that includes copyright information, authors, website, and license details. New country implementation files should follow this same header format.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:1-12
Timestamp: 2025-04-24T04:59:38.436Z
Learning: The holidays library uses a standard file header across country implementation files that includes copyright information, authors, website, and license details. New country implementation files should follow this same header format.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_polynesia.py:1-12
Timestamp: 2025-06-19T05:54:49.792Z
Learning: The holidays library uses a standard file header format across all country implementation files consisting of a comprehensive comment block with project description, authors, website, and license information. Country files do not use module-level docstrings but instead rely on this header format followed by class-level docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2676
File: holidays/countries/tunisia.py:25-25
Timestamp: 2025-06-25T10:12:30.448Z
Learning: The holidays library intentionally duplicates label strings like `estimated_label` across country modules rather than centralizing them. This duplication is the established library-wide approach and should not be suggested for refactoring.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
Learnt from: PPsyrius
PR: vacanza/holidays#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: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: tests/countries/test_mongolia.py:128-156
Timestamp: 2025-06-15T11:52:39.572Z
Learning: In the vacanza/holidays project tests, when testing holidays that span multiple consecutive days across many years (like Mongolia's National Festival spanning July 11-13), prefer explicit for loops over complex nested generator expressions with unpacking. The explicit loops are more readable, easier to maintain, and better communicate the testing intent even though the Big O complexity is equivalent.
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/calendars/mongolian.py:1-1
Timestamp: 2025-06-10T12:43:10.577Z
Learning: The holidays project's calendar files (in holidays/calendars/) follow a consistent pattern of NOT having module-level docstrings. They only use class-level docstrings for their main classes. When reviewing calendar files, maintain this consistency and do not suggest adding module docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
tests/countries/test_bhutan.py (23)
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.
Learnt from: PPsyrius
PR: vacanza/holidays#2615
File: tests/countries/test_anguilla.py:1-12
Timestamp: 2025-06-16T15:48:48.680Z
Learning: Test files in the holidays repository follow a standardized structure without module or class docstrings. All country test files use the same pattern: license header, imports, and class definition (`class Test{Country}(CommonCountryTests, TestCase):`) without docstrings. This is an established codebase convention that should be maintained for consistency.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:33:53.254Z
Learning: For Turkmenistan holiday tests, recommend using CommonCountryTests as the base class rather than unittest.TestCase to follow project conventions, be consistent with other country test files, and gain access to common test utilities.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
Learnt from: PPsyrius
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:17:53.319Z
Learning: In the Saint Vincent and the Grenadines holidays implementation, New Year's Day is added without observed rules using `_add_new_years_day()` and should not include observed rule testing in its test method. Only holidays explicitly wrapped with `_add_observed()` have observed behavior.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` or `super().setUpClass(HolidayClass, years=...)` where HolidayClass is passed as the first argument. This is the correct signature that matches the CommonCountryTests.setUpClass method which accepts test_class as the first parameter after cls. Pylint warnings about parameter count mismatch are false positives when comparing against TestCase.setUpClass instead of the immediate parent CommonCountryTests.setUpClass.
Learnt from: PPsyrius
PR: vacanza/holidays#2629
File: tests/countries/test_namibia.py:22-23
Timestamp: 2025-06-14T10:58:43.636Z
Learning: In the vacanza/holidays project, country test files consistently use range(start_year, 2050) which intentionally excludes 2050 and stops at 2049. This is a library-wide implementation pattern, not an off-by-one error.
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: tests/countries/test_mongolia.py:128-156
Timestamp: 2025-06-15T11:52:39.572Z
Learning: In the vacanza/holidays project tests, when testing holidays that span multiple consecutive days across many years (like Mongolia's National Festival spanning July 11-13), prefer explicit for loops over complex nested generator expressions with unpacking. The explicit loops are more readable, easier to maintain, and better communicate the testing intent even though the Big O complexity is equivalent.
Learnt from: PPsyrius
PR: vacanza/holidays#2490
File: holidays/countries/ethiopia.py:45-45
Timestamp: 2025-04-23T09:59:19.886Z
Learning: For the Ethiopia holidays class, it's appropriate to add a return type hint only to the `_is_leap_year` method to match the base class implementation in `holidays/holiday_base.py`, while keeping other methods without type hints to maintain consistency with other country implementations.
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: PPsyrius
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:57-60
Timestamp: 2025-06-14T11:04:31.180Z
Learning: In the holidays library, the base `HolidayBase._populate()` method already includes a guard clause that prevents holiday population methods like `_populate_public_holidays()` from being called when the year is before `start_year` or after `end_year`. Therefore, individual country implementations do not need to add their own guard clauses for years before independence or other start dates.
Learnt from: KJhellico
PR: vacanza/holidays#2631
File: tests/countries/test_sint_maarten.py:62-0
Timestamp: 2025-06-14T20:46:32.773Z
Learning: In the vacanza/holidays project tests, inner classes that shadow outer test class names are not standard practice. The test_sint_maarten.py file appears to be the only file using this pattern, making it an outlier rather than following project conventions.
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:21:59.268Z
Learning: In the Saint Vincent and the Grenadines holiday tests, for holidays without observed rules that only require a single assertHolidayName call, pass the holiday name directly as a string literal rather than storing it in a variable first for cleaner, more concise code.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are covered by the test_eid_al_fitr_day() method, which tests both regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
Learnt from: KJhellico
PR: vacanza/holidays#2532
File: tests/countries/test_cocos_islands.py:78-89
Timestamp: 2025-05-12T15:31:58.079Z
Learning: In the holidays project, tests for movable holidays (like Easter Monday) should always use static date sets only, not calculation functions.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
holidays/countries/bhutan.py (48)
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2490
File: holidays/countries/ethiopia.py:45-45
Timestamp: 2025-04-23T09:59:19.886Z
Learning: For the Ethiopia holidays class, it's appropriate to add a return type hint only to the `_is_leap_year` method to match the base class implementation in `holidays/holiday_base.py`, while keeping other methods without type hints to maintain consistency with other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: PPsyrius
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:78-90
Timestamp: 2025-06-13T12:18:03.539Z
Learning: The holidays codebase now uses the constructor signature pattern `__init__(self, *args, islamic_show_estimated: bool = True, **kwargs)` across country classes.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: holidays/countries/nepal.py:24-26
Timestamp: 2025-03-30T20:18:46.006Z
Learning: In the holidays library, country classes do not directly implement `_populate()`. Instead, they implement specialized methods like `_populate_public_holidays()`, and the base class `HolidayBase` handles the orchestration by calling these specialized methods.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: holidays/countries/mongolia.py:140-146
Timestamp: 2025-06-15T11:50:44.366Z
Learning: The holidays library doesn't currently have helper functions like `_add_holiday_span` for adding consecutive multi-day holidays. Countries like Mongolia, Thailand, and Vietnam implement multi-day holiday spans using inline loops with `_timedelta(dt, delta)` pattern.
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/countries/bhutan.py:13-16
Timestamp: 2025-06-16T14:08:09.492Z
Learning: In the holidays library, translation is performed in the `_add_holiday` methods, not at the string level. Holiday strings passed to `_add_holiday_*` methods are processed through the translation machinery within those methods, so using `tr()` or `self.tr()` wrappers is unnecessary.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: holidays/countries/andorra.py:13-14
Timestamp: 2025-05-06T15:29:31.893Z
Learning: In this codebase, `tr` imported as `from gettext import gettext as tr` is used as a message marker for extracting translatable strings when generating .po files, not just for runtime translation.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:0-0
Timestamp: 2025-05-10T04:32:15.760Z
Learning: In the holidays package, detailed historical context and additional information should be added as comments at the method level or above conditional blocks, while comments directly above tr() function calls should only contain the holiday name itself (e.g., "# Independence Day.").
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: PPsyrius
PR: vacanza/holidays#2676
File: holidays/countries/tunisia.py:25-25
Timestamp: 2025-06-25T10:12:30.448Z
Learning: The holidays library intentionally duplicates label strings like `estimated_label` across country modules rather than centralizing them. This duplication is the established library-wide approach and should not be suggested for refactoring.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:195-199
Timestamp: 2025-05-09T18:34:33.990Z
Learning: In the holidays library, localization (l10n) is handled through separate .po files for different languages rather than combining multiple translations in a single string. The code should use the default language with tr() function, and translations are provided in language-specific .po files.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.
Learnt from: KJhellico
PR: vacanza/holidays#2483
File: holidays/countries/turks_and_caicos_islands.py:117-118
Timestamp: 2025-05-13T13:23:11.375Z
Learning: The holidays library uses `_add_christmas_day_two` method to add Boxing Day holiday, not `_add_boxing_day`.
Learnt from: PPsyrius
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:84-85
Timestamp: 2025-03-30T08:08:30.415Z
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: 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/locale/en_CI/LC_MESSAGES/CI.po:88-88
Timestamp: 2025-03-30T18:25:07.087Z
Learning: In the holidays library, localization files have a specific structure: message comments are in standard English (en_US) describing the holiday, while actual translations (msgstr) should use the locale-specific terminology (e.g., en_CI for Ivory Coast English). For example, "Night of Power" in standard English is translated as "Lailatou-Kadr" in Ivory Coast English.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants like FEB, TUE, MAR, and SUN internally through parent class implementations even when these constants don't appear directly in the file.
Learnt from: KJhellico
PR: vacanza/holidays#2631
File: holidays/countries/sint_maarten.py:94-95
Timestamp: 2025-06-14T20:43:15.370Z
Learning: The `_add_*` helper methods in the holidays library (such as `_add_christmas_day_two()`, `_add_labor_day()`, etc.) don't have default holiday names, so the name parameter should always be explicitly specified when calling these methods.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2385
File: holidays/countries/pakistan.py:59-60
Timestamp: 2025-03-31T11:50:50.488Z
Learning: In the holidays library, function names and comments follow en_US spelling conventions (e.g., "Labor Day"), while the default strings may use different locale conventions (e.g., "Labour Day" for en_PK) and are translated appropriately using the gettext function.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:114-116
Timestamp: 2025-06-14T20:36:17.239Z
Learning: In the holidays codebase, message comments should always use en_US spelling conventions, while translatable strings can use appropriate local spellings for the target country/region.
Learnt from: PPsyrius
PR: vacanza/holidays#2615
File: tests/countries/test_anguilla.py:52-64
Timestamp: 2025-06-15T10:15:39.883Z
Learning: In the Anguilla holidays implementation, March 2 only has "James Ronald Webster Day" (from 2010 onwards). There is no "Sovereignty Day" holiday on this date. Queen's/King's Birthday holidays are in June, not March.
Learnt from: PPsyrius
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:48-50
Timestamp: 2025-06-14T11:05:21.250Z
Learning: In the holidays library, newer implementations use `start_year` to indicate the earliest year with complete holiday data coverage, not necessarily the first year a holiday existed. If a holiday system starts partway through a year (like Nauru's Public Holidays Act starting Jan 31, 1968), the start_year should be set to the following year (1969) to ensure users get full annual holiday coverage.
Learnt from: PPsyrius
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:57-60
Timestamp: 2025-06-14T11:04:31.180Z
Learning: In the holidays library, the base `HolidayBase._populate()` method already includes a guard clause that prevents holiday population methods like `_populate_public_holidays()` from being called when the year is before `start_year` or after `end_year`. Therefore, individual country implementations do not need to add their own guard clauses for years before independence or other start dates.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:30-39
Timestamp: 2025-04-02T13:58:21.457Z
Learning: Second Republic Day in Guinea was abolished by at least 2022 according to Decree D/2022/0526/PRG/CNRD/SGG, and this is correctly implemented in the holidays library by only including the holiday for years up to and including 2021.
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: PPsyrius
PR: vacanza/holidays#2629
File: tests/countries/test_namibia.py:22-23
Timestamp: 2025-06-14T10:58:43.636Z
Learning: In the vacanza/holidays project, country test files consistently use range(start_year, 2050) which intentionally excludes 2050 and stops at 2049. This is a library-wide implementation pattern, not an off-by-one error.
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:17:53.319Z
Learning: In the Saint Vincent and the Grenadines holidays implementation, New Year's Day is added without observed rules using `_add_new_years_day()` and should not include observed rule testing in its test method. Only holidays explicitly wrapped with `_add_observed()` have observed behavior.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Learnt from: KJhellico
PR: vacanza/holidays#2593
File: holidays/countries/senegal.py:66-110
Timestamp: 2025-06-06T14:40:31.932Z
Learning: In the holidays library, within the _populate_public_holidays method, holidays should be arranged by calendar type (Islamic holidays first, then Gregorian holidays) without additional type grouping comments. The organization by calendar type is sufficient and follows the project's established conventions.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Learnt from: KJhellico
PR: vacanza/holidays#2606
File: holidays/countries/faroe_islands.py:62-67
Timestamp: 2025-06-15T15:24:53.055Z
Learning: The `HolidayBase` class uses `__getattr__` to dynamically implement `_add_holiday_*` methods through pattern matching, including patterns like `_add_holiday_<n>_days_past_easter`, `_add_holiday_<month>_<day>`, and various weekday-relative patterns. Methods like `_add_holiday_26_days_past_easter` are not explicitly defined but are dynamically generated when called.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: holidays/countries/nepal.py:203-208
Timestamp: 2025-05-01T19:13:44.664Z
Learning: Multiple holidays on the same date are properly handled in the holidays library. When multiple `_add_...` methods are called with different holiday names for the same date, both holidays are preserved rather than the latter overwriting the former. This happens because the `__setitem__` method in `HolidayBase` merges multiple holidays on the same date by combining their names.
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:551-554
Timestamp: 2025-05-01T19:19:42.346Z
Learning: In the holidays library, when multiple holidays fall on the same date, their names are always sorted alphabetically (in __setitem__ of HolidayBase), so the order of addition does not affect the resulting string.
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: holidays/countries/mongolia.py:66-75
Timestamp: 2025-06-14T08:58:06.311Z
Learning: Mongolia's Naadam Festival was extended from 3 days (July 11-13) to 5 days (July 11-15) in 2014 through an amendment to the Law on Public Holidays and Ceremonies. Before 2014, only July 11-13 were public holidays for Naadam.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/france.py:300-319
Timestamp: 2025-06-18T10:21:01.376Z
Learning: In the France holidays implementation, legislative years for holiday changes should be hard-coded rather than extracted into constants, as this maintains consistency with the existing codebase pattern and provides historical accuracy for specific legislative acts.
Learnt from: KJhellico
PR: vacanza/holidays#2631
File: tests/countries/test_sint_maarten.py:62-0
Timestamp: 2025-06-14T21:12:07.224Z
Learning: KJhellico prefers to focus on completing and reviewing the main holiday implementation code before doing detailed reviews of the corresponding test files.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:171-184
Timestamp: 2025-06-19T02:34:14.456Z
Learning: In the holidays library, `_CustomIslamicHolidays` subclasses follow a consistent pattern of NOT having docstrings. They go directly to defining date dictionaries, as evidenced by Malaysia, Singapore, UAE, and dozens of other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:407-461
Timestamp: 2025-03-04T11:32:45.095Z
Learning: In the holidays library, the standard approach for organizing static holidays is to use separate dictionaries for different categories (`government`, `mandatory`, and `public`), which are utilized by syntactic sugar methods.
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: holidays/countries/nepal.py:52-60
Timestamp: 2025-04-13T20:42:13.152Z
Learning: In the holidays library, country classes follow a consistent initialization pattern: first explicitly initializing each parent holiday group class with their specific parameters, then calling `super().__init__(*args, **kwargs)` at the end to properly initialize the base `HolidayBase` class.
holidays/calendars/tibetan.py (21)
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants like FEB, TUE, MAR, and SUN internally through parent class implementations even when these constants don't appear directly in the file.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2593
File: holidays/calendars/islamic.py:3993-3994
Timestamp: 2025-06-04T10:09:28.732Z
Learning: In the holidays/calendars/islamic.py file, the Islamic calendar date methods in the _IslamicLunar class (like ali_al_rida_death_dates, ashura_dates, etc.) follow a consistent pattern of being single-line methods that return self._get_holiday(CONSTANT, year) without docstrings. New methods should follow this same pattern for consistency.
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/calendars/mongolian.py:1-1
Timestamp: 2025-06-10T12:43:10.577Z
Learning: The holidays project's calendar files (in holidays/calendars/) follow a consistent pattern of NOT having module-level docstrings. They only use class-level docstrings for their main classes. When reviewing calendar files, maintain this consistency and do not suggest adding module docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2490
File: holidays/countries/ethiopia.py:45-45
Timestamp: 2025-04-23T09:59:19.886Z
Learning: For the Ethiopia holidays class, it's appropriate to add a return type hint only to the `_is_leap_year` method to match the base class implementation in `holidays/holiday_base.py`, while keeping other methods without type hints to maintain consistency with other country implementations.
Learnt from: KJhellico
PR: vacanza/holidays#2465
File: holidays/countries/suriname.py:219-251
Timestamp: 2025-04-13T19:10:31.502Z
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.
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: PPsyrius
PR: vacanza/holidays#2601
File: tests/countries/test_mongolia.py:128-156
Timestamp: 2025-06-15T11:52:39.572Z
Learning: In the vacanza/holidays project tests, when testing holidays that span multiple consecutive days across many years (like Mongolia's National Festival spanning July 11-13), prefer explicit for loops over complex nested generator expressions with unpacking. The explicit loops are more readable, easier to maintain, and better communicate the testing intent even though the Big O complexity is equivalent.
Learnt from: KJhellico
PR: vacanza/holidays#2437
File: holidays/calendars/tibetan.py:805-810
Timestamp: 2025-04-08T14:50:15.325Z
Learning: The standard behavior for calendar date methods in the holidays library is to return `(None, True)` when a requested year is not found in the date dictionary, rather than raising an exception or requiring documentation for out-of-range years.
Learnt from: KJhellico
PR: vacanza/holidays#2437
File: holidays/calendars/tibetan.py:805-810
Timestamp: 2025-04-08T14:50:15.325Z
Learning: The standard behavior for calendar date methods in the holidays library is to return `(None, True)` when a requested year is not found in the date dictionary, rather than raising an exception or requiring documentation for out-of-range years.
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: holidays/countries/mongolia.py:140-146
Timestamp: 2025-06-15T11:50:44.366Z
Learning: The holidays library doesn't currently have helper functions like `_add_holiday_span` for adding consecutive multi-day holidays. Countries like Mongolia, Thailand, and Vietnam implement multi-day holiday spans using inline loops with `_timedelta(dt, delta)` pattern.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:551-554
Timestamp: 2025-05-01T19:19:42.346Z
Learning: In the holidays library, when multiple holidays fall on the same date, their names are always sorted alphabetically (in __setitem__ of HolidayBase), so the order of addition does not affect the resulting string.
Learnt from: KJhellico
PR: vacanza/holidays#2593
File: holidays/countries/senegal.py:66-110
Timestamp: 2025-06-06T14:40:31.932Z
Learning: In the holidays library, within the _populate_public_holidays method, holidays should be arranged by calendar type (Islamic holidays first, then Gregorian holidays) without additional type grouping comments. The organization by calendar type is sufficient and follows the project's established conventions.
Learnt from: KJhellico
PR: vacanza/holidays#2671
File: holidays/countries/libya.py:51-108
Timestamp: 2025-06-29T10:36:06.129Z
Learning: There is no project-wide convention in the holidays library to organize holidays by calendar type (Islamic holidays first, then Gregorian holidays). Countries organize holidays in various ways - often chronologically, by importance, or by logical grouping - and Islamic holidays are frequently placed at the end of the _populate_public_holidays method rather than at the beginning.
Learnt from: KJhellico
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:551-554
Timestamp: 2025-05-01T19:19:42.346Z
Learning: In the holidays library, multiple holidays on the same date are sorted alphabetically internally, so the order in which holidays are added does not affect the resulting holiday name string when multiple holidays occur on the same date.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
🧬 Code Graph Analysis (2)
holidays/countries/bhutan.py (2)
holidays/groups/tibetan.py (9)
TibetanCalendarHolidays
(20-104)_add_day_of_offering
(58-64)_add_losar
(50-56)_add_death_of_zhabdrung
(82-88)_add_buddha_parinirvana
(42-48)_add_birth_of_guru_rinpoche
(74-80)_add_buddha_first_sermon
(66-72)_add_blessed_rainy_day
(90-96)_add_dashain
(98-104)holidays/holiday_base.py (1)
HolidayBase
(57-1306)
holidays/calendars/tibetan.py (2)
holidays/calendars/custom.py (1)
_CustomCalendar
(33-34)holidays/holiday_base.py (1)
get
(972-995)
⏰ Context from checks skipped due to timeout of 300000ms (2)
- GitHub Check: Test build on windows-latest
- GitHub Check: Test build on ubuntu-latest
🔇 Additional comments (13)
README.md (2)
108-108
: Country count update looks correct.The increment from 205 to 206 properly reflects the addition of Bhutan as a new supported country.
318-323
: Bhutan entry properly formatted.The table entry follows the established HTML format and correctly shows empty cells for subdivisions, languages, and supported categories, which aligns with the implementation.
tests/countries/test_bhutan.py (3)
1-17
: Standard test file structure implemented correctly.The license header, imports, and class setup follow established project conventions for country test files.
33-44
: Good pattern for testing variable holidays.This correctly tests specific known dates first, then validates the holiday exists across the full range.
151-175
: Comprehensive year-specific test implemented well.The 2024 test validates all holidays for that year, which complements the individual holiday tests nicely.
snapshots/countries/BT_COMMON.json (1)
1-915
: Snapshot data appears correctly generated.The holiday data looks comprehensive and properly formatted. The previous Losar labeling issue has been resolved - entries now show "Losar" rather than the static cyclic suffix. Multiple holidays on the same date are correctly separated with semicolons.
holidays/countries/bhutan.py (5)
13-14
: Clean imports following library conventions.Good use of the TibetanCalendarHolidays group and standard HolidayBase import.
17-27
: Solid class structure and configuration.The multiple inheritance pattern and start_year reasoning are well implemented. The 2007 start year makes sense given the throne succession context.
29-31
: Constructor follows proper initialization pattern.Correctly initializes the TibetanCalendarHolidays first, then calls super().init() as per library conventions.
33-90
: Well-structured holiday definitions.The holiday implementation properly uses the library's helper methods and follows established patterns. Holiday names are clear and the mix of fixed-date and Tibetan calendar holidays is correctly handled.
92-97
: Standard alias classes provided.Simple and clean alias implementations for BT and BTN country codes.
holidays/calendars/tibetan.py (2)
811-833
: LGTM! Methods are properly sorted alphabetically.The date accessor methods follow the correct alphabetical ordering as requested in previous reviews.
1-838
: Solid implementation following established patterns.The file structure, naming conventions, and integration with the custom calendar mechanism follow the holidays library patterns well. The approach of using pre-calculated date dictionaries with fallback logic is appropriate for this use case.
holidays/calendars/tibetan.py
Outdated
1972: (FEB, 15), | ||
1973: (FEB, 4), | ||
1974: (FEB, 23), | ||
1975: (FEB, 12), | ||
1976: (MAR, 1), | ||
1977: (FEB, 19), | ||
1978: (FEB, 8), | ||
1979: (FEB, 27), | ||
1980: (FEB, 17), | ||
1981: (FEB, 5), | ||
1982: (FEB, 24), | ||
1983: (FEB, 13), | ||
1984: (FEB, 2), | ||
1985: (FEB, 20), | ||
1986: (FEB, 9), | ||
1987: (FEB, 28), | ||
1988: (FEB, 18), | ||
1989: (FEB, 7), | ||
1990: (FEB, 26), | ||
1991: (FEB, 15), | ||
1992: (FEB, 4), | ||
1993: (FEB, 22), | ||
1994: (FEB, 11), | ||
1995: (MAR, 2), | ||
1996: (FEB, 19), | ||
1997: (FEB, 8), | ||
1998: (FEB, 27), | ||
1999: (FEB, 17), | ||
2000: (FEB, 6), | ||
2001: (FEB, 24), | ||
2002: (FEB, 13), | ||
2003: (MAR, 4), | ||
2004: (FEB, 21), | ||
2005: (FEB, 9), | ||
2006: (FEB, 28), | ||
2007: (FEB, 18), | ||
2008: (FEB, 8), | ||
2009: (FEB, 25), | ||
2010: (FEB, 14), | ||
2011: (FEB, 3), | ||
2012: (FEB, 22), | ||
2013: (FEB, 11), | ||
2014: (MAR, 2), | ||
2015: (FEB, 19), | ||
2016: (FEB, 9), | ||
2017: (FEB, 27), | ||
2018: (FEB, 16), | ||
2019: (FEB, 5), | ||
2020: (FEB, 24), | ||
2021: (FEB, 12), | ||
2022: (MAR, 3), | ||
2023: (FEB, 21), | ||
2024: (FEB, 11), | ||
2025: (FEB, 28), | ||
2026: (FEB, 18), | ||
2027: (FEB, 7), | ||
2028: (FEB, 26), | ||
2029: (FEB, 14), | ||
2030: (MAR, 5), | ||
2031: (FEB, 22), | ||
2032: (FEB, 12), | ||
2033: (MAR, 2), | ||
2034: (FEB, 19), | ||
2035: (FEB, 9), | ||
2036: (FEB, 28), | ||
2037: (FEB, 16), | ||
2038: (FEB, 5), | ||
2039: (FEB, 24), | ||
2040: (FEB, 13), | ||
2041: (MAR, 3), | ||
2042: (FEB, 21), | ||
2043: (FEB, 10), | ||
2044: (FEB, 29), | ||
2045: (FEB, 17), | ||
2046: (FEB, 6), | ||
2047: (FEB, 25), | ||
2048: (FEB, 14), | ||
2049: (FEB, 3), | ||
2050: (FEB, 22), | ||
2051: (FEB, 12), | ||
2052: (MAR, 2), | ||
2053: (FEB, 19), | ||
2054: (FEB, 8), | ||
2055: (FEB, 27), | ||
2056: (FEB, 16), | ||
2057: (FEB, 4), | ||
2058: (FEB, 23), | ||
2059: (FEB, 13), | ||
2060: (MAR, 3), | ||
2061: (FEB, 21), | ||
2062: (FEB, 10), | ||
2063: (MAR, 1), | ||
2064: (FEB, 18), | ||
2065: (FEB, 6), | ||
2066: (FEB, 25), | ||
2067: (FEB, 14), | ||
2068: (MAR, 4), | ||
2069: (FEB, 22), | ||
2070: (FEB, 12), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Address data inconsistencies across holiday dictionaries.
The holiday date dictionaries have inconsistent coverage that could impact reliability:
BLESSED_RAINY_DAY_DATES
ends at 2052 (missing 2053-2070)BUDDHA_PARINIRVANA_DATES
ends at 2068 (missing 2069-2070)DASHAIN_DATES
starts at 2001 (missing 1970-2000)DAY_OF_OFFERING_DATES
has gaps: 1978, 2031, 2040, 2059, 2069DEATH_OF_ZHABDRUNG_DATES
has gaps: 1982, 1992, 2001, 2010, 2011, 2020, 2041
Consider extending coverage to maintain consistency across the 1970-2070 range or documenting the limitations.
Let me verify the coverage gaps:
🏁 Script executed:
#!/bin/bash
# Check for missing years in holiday dictionaries to confirm data gaps
echo "Checking DAY_OF_OFFERING_DATES gaps:"
grep -n "DAY_OF_OFFERING_DATES" holidays/calendars/tibetan.py -A 100 | grep -E "197[8]|203[1]|204[0]|205[9]|206[9]" || echo "Confirmed missing years"
echo "Checking DEATH_OF_ZHABDRUNG_DATES gaps:"
grep -n "DEATH_OF_ZHABDRUNG_DATES" holidays/calendars/tibetan.py -A 100 | grep -E "198[2]|199[2]|200[1]|201[01]|202[0]|204[1]" || echo "Confirmed missing years"
echo "Checking DASHAIN_DATES range:"
grep -n "DASHAIN_DATES" holidays/calendars/tibetan.py -A 100 | head -5
Length of output: 809
Address data coverage gaps in Tibetan holiday mappings
The verification confirms uneven year coverage across several dictionaries, which may lead to missing holiday entries:
- BLESSED_RAINY_DAY_DATES ends at 2052 (missing 2053–2070)
- BUDDHA_PARINIRVANA_DATES ends at 2068 (missing 2069–2070)
- DASHAIN_DATES starts in 2001 (missing 1970–2000)
- DAY_OF_OFFERING_DATES has gaps in 1978, 2031, 2040, 2059, 2069
- DEATH_OF_ZHABDRUNG_DATES has gaps in 1982, 1992, 2001, 2010, 2011, 2020, 2041
Please extend each mapping (or add placeholder entries) to uniformly cover 1970–2070, or clearly document any unavoidable omissions above each dictionary. Ensuring consistent ranges will prevent unexpected missing-date behavior.
🤖 Prompt for AI Agents
In holidays/calendars/tibetan.py between lines 140 and 803, several holiday date
dictionaries have inconsistent year coverage, causing potential missing holiday
entries. Extend each dictionary to cover all years from 1970 to 2070 uniformly
by adding missing years with appropriate dates or placeholder entries. If
certain years cannot be filled, add clear documentation comments above each
dictionary explaining the omissions to maintain clarity and prevent unexpected
missing-date issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK our calendar source support goes upto 2099 - so maybe we can future proof and implement up to that too on top of bot's list of missing years
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
@PPsyrius, great suggestion! Let me investigate the calendar source to verify the 2099 support and see what data is available for extending the coverage.
🏁 Script executed:
#!/bin/bash
# First, let's check the calendar source referenced in the docstring
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/README.md" | head -20
# Check if there are any data files in the repository
curl -s "https://api.github.com/repos/wp-plugins/bhutanese-calendar/contents" | jq '.[].name' 2>/dev/null || echo "API call failed, trying alternative approach"
# Look for any PHP or data files that might contain the calendar calculations
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/bhutanese-calendar.php" | head -50
Length of output: 437
🏁 Script executed:
#!/bin/bash
# Check the data folder contents to see what calendar data is available
curl -s "https://api.github.com/repos/wp-plugins/bhutanese-calendar/contents/data" | jq '.[].name' 2>/dev/null || echo "Failed to get data folder contents"
# Try to access some potential data files
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/data/calendar.json" | head -20
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/data/dates.json" | head -20
# Check the main plugin file for any calendar calculations or data ranges
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/bhutanesecalendar.php" | grep -i "year\|date\|calendar" | head -10
Length of output: 989
🏁 Script executed:
#!/bin/bash
# Check the data.txt file which seems to be the main data source
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/data/data.txt" | head -30
# Check the total number of lines to understand the data scope
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/data/data.txt" | wc -l
# Look for specific years to understand the data format and coverage
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/data/data.txt" | grep -E "^(1978|2031|2040|2059|2069|2099)" | head -10
Length of output: 1987
🏁 Script executed:
#!/bin/bash
# Check the end of the data file to see what the last year is
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/data/data.txt" | tail -10
# Look for year patterns in the data - the format seems to be (..., wyear) where wyear is the Western year
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/data/data.txt" | grep "2099" | head -5
# Check for years around our missing data points
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/data/data.txt" | grep ", 1978)," | head -3
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/data/data.txt" | grep ", 2031)," | head -3
curl -s "https://raw.githubusercontent.com/wp-plugins/bhutanese-calendar/master/data/data.txt" | grep ", 2099)," | head -3
Length of output: 2007
Perfect! You're absolutely right. The calendar source does support up to 2099 (and even beyond to 2101). I can see from the data that:
-
The source has comprehensive coverage: It contains data for all the missing years identified by the bot (1978, 2031, 2040, 2059, 2069, etc.)
-
Data format is clear: The source provides mappings between Tibetan calendar dates and Gregorian dates in the format
(entry_id, day_name, bdate, bmonth, intercalary, byear, wdate, wmonth, wyear)
-
Range extends to 2099+: The data goes from 1900 to 2101, so extending to 2099 would be well within the source's capabilities
Given this, we should definitely:
Immediate fixes needed:
- Fill in the missing years for existing dictionaries (1978, 2031, 2040, 2059, 2069, etc.)
- Extend
BLESSED_RAINY_DAY_DATES
from 2052 to 2099 - Extend
BUDDHA_PARINIRVANA_DATES
from 2068 to 2099 - Extend
DASHAIN_DATES
backwards to 1970 and forwards to 2099 - Complete the gaps in
DAY_OF_OFFERING_DATES
andDEATH_OF_ZHABDRUNG_DATES
Future-proofing extension:
- Extend all dictionaries consistently to 2099 to match the source's full capability
This would provide comprehensive, reliable coverage for Bhutan's Tibetan calendar holidays and eliminate the inconsistent date ranges that could cause missing holiday entries.
Would you like me to create an issue to track this data extension work, or do you prefer to handle it as part of this current PR?
🐰
ears perked up with excitement about extending the calendar coverage!
🧬 Code Graph Analysis Results
Relevant snippet from holidays/calendars/custom.py
(lines 33-34)
class _CustomCalendar(metaclass=_CustomCalendarType):
pass
- Defines a base class
_CustomCalendar
using a metaclass_CustomCalendarType
. - No additional implementation details provided here.
Relevant snippet from holidays/holiday_base.py
(lines 972-995)
def get(self, key: DateLike, default: Union[str, Any] = None) -> Union[str, Any]:
"""Retrieve the holiday name(s) for a given date.
If the date is a holiday, returns the holiday name as a string.
If multiple holidays fall on the same date, their names are joined by a semicolon (`;`).
If the date is not a holiday, returns the provided `default` value (defaults to `None`).
Args:
key:
The date expressed in one of the following types:
* `datetime.date`,
* `datetime.datetime`,
* a `str` of any format recognized by `dateutil.parser.parse()`,
* or a `float` or `int` representing a POSIX timestamp.
default:
The default value to return if no value is found.
Returns:
The holiday name(s) as a string if the date is a holiday,
or the `default` value otherwise.
"""
return dict.get(self, self.__keytransform__(key), default)
- Method to retrieve holiday names for a given date key.
- Supports multiple input types for the date.
- Returns holiday name(s) or a default value if no holiday is found.
These snippets provide context on the _CustomCalendar
base class used in tibetan.py
and a general method for retrieving holiday names by date, which may be relevant for extending or future-proofing holiday date data up to 2099 as mentioned in the user comment.
🧠 Learnings used
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Learnt from: PPsyrius
PR: vacanza/holidays#2629
File: tests/countries/test_namibia.py:22-23
Timestamp: 2025-06-14T10:58:43.636Z
Learning: In the vacanza/holidays project, country test files consistently use range(start_year, 2050) which intentionally excludes 2050 and stops at 2049. This is a library-wide implementation pattern, not an off-by-one error.
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: vacanza/holidays#2385
File: holidays/locale/en_US/LC_MESSAGES/PK.po:17-26
Timestamp: 2025-03-28T21:04:53.171Z
Learning: Always verify the current year before flagging dates in project metadata as "future dates." As of March 2025, dates with year 2025 are current, not future dates.
Learnt from: PPsyrius
PR: vacanza/holidays#2609
File: holidays/countries/nauru.py:48-50
Timestamp: 2025-06-14T11:05:21.250Z
Learning: In the holidays library, newer implementations use `start_year` to indicate the earliest year with complete holiday data coverage, not necessarily the first year a holiday existed. If a holiday system starts partway through a year (like Nauru's Public Holidays Act starting Jan 31, 1968), the start_year should be set to the following year (1969) to ensure users get full annual holiday coverage.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_france.py:24-27
Timestamp: 2025-06-18T10:10:46.158Z
Learning: The holidays library prioritizes full test coverage over performance in test suites. Modern library-wide standards favor comprehensive testing across all subdivisions and wide year ranges (e.g., 1803-2050 for France) to ensure thorough validation, even if it creates many test objects.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.
Learnt from: PPsyrius
PR: vacanza/holidays#2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.
Learnt from: KJhellico
PR: vacanza/holidays#2437
File: holidays/calendars/tibetan.py:805-810
Timestamp: 2025-04-08T14:50:15.325Z
Learning: The standard behavior for calendar date methods in the holidays library is to return `(None, True)` when a requested year is not found in the date dictionary, rather than raising an exception or requiring documentation for out-of-range years.
Learnt from: KJhellico
PR: vacanza/holidays#2437
File: holidays/calendars/tibetan.py:805-810
Timestamp: 2025-04-08T14:50:15.325Z
Learning: The standard behavior for calendar date methods in the holidays library is to return `(None, True)` when a requested year is not found in the date dictionary, rather than raising an exception or requiring documentation for out-of-range years.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:146-179
Timestamp: 2025-06-14T20:12:37.212Z
Learning: The `_CustomHinduHolidays` mechanism works through `_CustomCalendarType` metaclass which renames public attributes (like `DIWALI_INDIA_DATES`) with a postfix, allowing `_HinduLunisolar::_get_holiday` to find and use custom holiday dates. When `_add_diwali_india()` is called, it uses the custom dates if available rather than calculated dates.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants like FEB, TUE, MAR, and SUN internally through parent class implementations even when these constants don't appear directly in the file.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/calendars/mongolian.py:1-1
Timestamp: 2025-06-10T12:43:10.577Z
Learning: The holidays project's calendar files (in holidays/calendars/) follow a consistent pattern of NOT having module-level docstrings. They only use class-level docstrings for their main classes. When reviewing calendar files, maintain this consistency and do not suggest adding module docstrings.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2593
File: holidays/calendars/islamic.py:3993-3994
Timestamp: 2025-06-04T10:09:28.732Z
Learning: In the holidays/calendars/islamic.py file, the Islamic calendar date methods in the _IslamicLunar class (like ali_al_rida_death_dates, ashura_dates, etc.) follow a consistent pattern of being single-line methods that return self._get_holiday(CONSTANT, year) without docstrings. New methods should follow this same pattern for consistency.
Learnt from: KJhellico
PR: vacanza/holidays#2593
File: holidays/countries/senegal.py:66-110
Timestamp: 2025-06-06T14:40:31.932Z
Learning: In the holidays library, within the _populate_public_holidays method, holidays should be arranged by calendar type (Islamic holidays first, then Gregorian holidays) without additional type grouping comments. The organization by calendar type is sufficient and follows the project's established conventions.
Learnt from: KJhellico
PR: vacanza/holidays#2465
File: holidays/countries/suriname.py:219-251
Timestamp: 2025-04-13T19:10:31.502Z
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.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:0-0
Timestamp: 2025-05-10T04:32:15.760Z
Learning: In the holidays package, detailed historical context and additional information should be added as comments at the method level or above conditional blocks, while comments directly above tr() function calls should only contain the holiday name itself (e.g., "# Independence Day.").
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: KJhellico
PR: vacanza/holidays#2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.185Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: README.md:108-108
Timestamp: 2025-06-14T20:13:29.536Z
Learning: In the vacanza/holidays repository, the team prefers to manually update the country count in README.md when adding new countries, with tests in place to verify the count stays accurate. They are satisfied with this approach and do not want it automated.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_polynesia.py:1-12
Timestamp: 2025-06-19T05:54:49.792Z
Learning: The holidays library uses a standard file header format across all country implementation files consisting of a comprehensive comment block with project description, authors, website, and license information. Country files do not use module-level docstrings but instead rely on this header format followed by class-level docstrings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am currently encountering issues with invalid holiday dates for some holidays in certain years. While extracting and parsing dates from the source website, some entries are either missing, have an incorrect format, or contain placeholder values like '000' or '00:'. These invalid entries cannot be reliably converted into usable date objects, resulting in their exclusion from the main holiday datasets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Bhutanese calendar, a certain day of month may not be present in a given year. In this case, the holiday is not celebrated.
Signed-off-by: Prateekshit Jaiswal <[email protected]>
…into add-bhutan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
README.md (1)
108-110
: Bump the supported-country counter.Adding Bhutan takes us to 208 country codes, not 207.
-We currently support 207 country codes. +We currently support 208 country codes.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
README.md
(1 hunks)holidays/countries/__init__.py
(1 hunks)holidays/registry.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:0-0
Timestamp: 2025-05-10T04:32:15.760Z
Learning: In the holidays package, detailed historical context and additional information should be added as comments at the method level or above conditional blocks, while comments directly above tr() function calls should only contain the holiday name itself (e.g., "# Independence Day.").
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: KJhellico
PR: vacanza/holidays#2684
File: holidays/locale/it/LC_MESSAGES/SM.po:13-13
Timestamp: 2025-06-28T10:39:19.185Z
Learning: In the holidays project, .po file header comments use the format "# [Country] holidays." for default language files (without trailing hash) and "# [Country] holidays [locale] localization." for non-default language files (also without trailing hash).
Learnt from: ankushhKapoor
PR: vacanza/holidays#2601
File: holidays/locale/en_MN/LC_MESSAGES/MN.po:13-14
Timestamp: 2025-06-11T18:32:25.595Z
Learning: For non-default locale `.po` files, the header comment format is:
`# <Country> holidays <locale> localization.` (no trailing hash).
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: README.md:108-108
Timestamp: 2025-06-14T20:13:29.536Z
Learning: In the vacanza/holidays repository, the team prefers to manually update the country count in README.md when adding new countries, with tests in place to verify the count stays accurate. They are satisfied with this approach and do not want it automated.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: holidays/countries/finland.py:249-253
Timestamp: 2025-05-10T04:02:13.815Z
Learning: Holiday name comments directly above tr() function calls in the holidays package should only contain the holiday name itself (e.g., "# Independence Day.") without any additional context, dates, or historical information.
Learnt from: KJhellico
PR: vacanza/holidays#2593
File: holidays/countries/senegal.py:66-110
Timestamp: 2025-06-06T14:40:31.932Z
Learning: In the holidays library, within the _populate_public_holidays method, holidays should be arranged by calendar type (Islamic holidays first, then Gregorian holidays) without additional type grouping comments. The organization by calendar type is sufficient and follows the project's established conventions.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: KJhellico
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.
Learnt from: KJhellico
PR: vacanza/holidays#2631
File: tests/countries/test_sint_maarten.py:62-0
Timestamp: 2025-06-14T21:12:07.224Z
Learning: KJhellico prefers to focus on completing and reviewing the main holiday implementation code before doing detailed reviews of the corresponding test files.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.
Learnt from: PPsyrius
PR: vacanza/holidays#2537
File: tests/countries/test_finland.py:23-26
Timestamp: 2025-05-09T18:36:09.607Z
Learning: The holidays project prioritizes complete historical coverage in tests, verifying holidays from their first year of observance (e.g., 1853 for Finland) through future projections, rather than using shorter sliding windows.
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:22-26
Timestamp: 2025-04-23T14:55:35.504Z
Learning: References in holidays classes should only be included if they're used for test case cross-checks or provide historical context about when holidays were added/removed, not just for the sake of having more references.
Learnt from: PPsyrius
PR: vacanza/holidays#2323
File: holidays/countries/macau.py:278-377
Timestamp: 2025-03-05T02:35:03.298Z
Learning: For Macau holiday implementations, it's preferable to maintain separate methods for different holiday categories (MANDATORY, GOVERNMENT, PUBLIC) as they are based on different sets of laws, making the code easier to maintain despite having multiple year-based conditionals.
README.md (10)
Learnt from: KJhellico
PR: vacanza/holidays#2606
File: README.md:562-568
Timestamp: 2025-06-06T16:02:09.910Z
Learning: The README.md country table displays ISO 3166-1 alpha-2 codes only in the "Code" column. Alpha-3 codes or country aliases should not be included in this table format, maintaining consistency with all other country entries.
Learnt from: KJhellico
PR: vacanza/holidays#2375
File: README.md:224-226
Timestamp: 2025-03-26T22:41:55.075Z
Learning: The countries table in README.md uses HTML format consistently throughout, not Markdown.
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
Learnt from: KJhellico
PR: vacanza/holidays#2614
File: README.md:108-108
Timestamp: 2025-06-14T20:13:29.536Z
Learning: In the vacanza/holidays repository, the team prefers to manually update the country count in README.md when adding new countries, with tests in place to verify the count stays accurate. They are satisfied with this approach and do not want it automated.
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:1-12
Timestamp: 2025-04-24T04:59:38.436Z
Learning: The holidays library uses a standard file header across country implementation files that includes copyright information, authors, website, and license details. New country implementation files should follow this same header format.
Learnt from: PPsyrius
PR: vacanza/holidays#2489
File: holidays/countries/sao_tome_and_principe.py:1-12
Timestamp: 2025-04-24T04:59:38.436Z
Learning: The holidays library uses a standard file header across country implementation files that includes copyright information, authors, website, and license details. New country implementation files should follow this same header format.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T04:54:07.204Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_polynesia.py:1-12
Timestamp: 2025-06-19T05:54:49.792Z
Learning: The holidays library uses a standard file header format across all country implementation files consisting of a comprehensive comment block with project description, authors, website, and license information. Country files do not use module-level docstrings but instead rely on this header format followed by class-level docstrings.
holidays/countries/__init__.py (16)
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
Learnt from: PPsyrius
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:78-90
Timestamp: 2025-06-13T12:18:03.539Z
Learning: The holidays codebase now uses the constructor signature pattern `__init__(self, *args, islamic_show_estimated: bool = True, **kwargs)` across country classes.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/saint_pierre_and_miquelon.py:39-48
Timestamp: 2025-06-18T15:34:18.326Z
Learning: The holidays library does not use `__all__` declarations in country modules. Country files follow a standard pattern without explicit exports, and suggesting `__all__` goes against the established library-wide convention.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2490
File: holidays/countries/ethiopia.py:45-45
Timestamp: 2025-04-23T09:59:19.886Z
Learning: For the Ethiopia holidays class, it's appropriate to add a return type hint only to the `_is_leap_year` method to match the base class implementation in `holidays/holiday_base.py`, while keeping other methods without type hints to maintain consistency with other country implementations.
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: PPsyrius
PR: vacanza/holidays#2632
File: holidays/countries/solomon_islands.py:95-98
Timestamp: 2025-06-16T12:28:31.641Z
Learning: Library-wide holiday patterns and their optimizations should be handled at the base class level (like InternationalHolidays) rather than documenting workarounds in individual country modules. This maintains separation of concerns and avoids documentation duplication.
Learnt from: PPsyrius
PR: vacanza/holidays#2615
File: tests/countries/test_anguilla.py:1-12
Timestamp: 2025-06-16T15:48:48.680Z
Learning: Test files in the holidays repository follow a standardized structure without module or class docstrings. All country test files use the same pattern: license header, imports, and class definition (`class Test{Country}(CommonCountryTests, TestCase):`) without docstrings. This is an established codebase convention that should be maintained for consistency.
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: holidays/countries/saint_vincent_and_the_grenadines.py:39-44
Timestamp: 2025-06-07T11:19:38.945Z
Learning: In the holidays library, it's standard practice to explicitly call ChristianHolidays.__init__(self) and InternationalHolidays.__init__(self) in country class __init__ methods, even when these mixins don't define their own __init__ methods. This follows the established codebase convention across all country implementations (confirmed in Zimbabwe, Zambia, and other countries).
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:171-184
Timestamp: 2025-06-19T02:34:14.456Z
Learning: In the holidays library, `_CustomIslamicHolidays` subclasses follow a consistent pattern of NOT having docstrings. They go directly to defining date dictionaries, as evidenced by Malaysia, Singapore, UAE, and dozens of other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_southern_territories.py:41-44
Timestamp: 2025-06-18T10:07:58.780Z
Learning: Territorial holiday classes that inherit from parent countries (like HolidaysAX from Finland, HolidaysSJ from Norway, HolidaysTF from France) follow a standard pattern of silently overriding self.subdiv in their _populate_public_holidays() method without validation, as this ensures they always use the correct subdivision code for their territory regardless of user input.
Learnt from: PPsyrius
PR: vacanza/holidays#2601
File: holidays/countries/mongolia.py:140-146
Timestamp: 2025-06-15T11:50:44.366Z
Learning: The holidays library doesn't currently have helper functions like `_add_holiday_span` for adding consecutive multi-day holidays. Countries like Mongolia, Thailand, and Vietnam implement multi-day holiday spans using inline loops with `_timedelta(dt, delta)` pattern.
Learnt from: KJhellico
PR: vacanza/holidays#2601
File: README.md:108-108
Timestamp: 2025-06-09T19:39:38.818Z
Learning: The correct way to count supported countries in the holidays library is by counting unique country module files in holidays/countries/ (excluding __init__.py) or by counting entries in the COUNTRIES registry, not by counting individual class definitions which include alias classes.
holidays/registry.py (10)
Learnt from: KJhellico
PR: vacanza/holidays#2483
File: holidays/registry.py:177-177
Timestamp: 2025-04-18T21:13:55.589Z
Learning: In the holidays/registry.py file, COUNTRIES dictionary entries should use the class name (without spaces) as the first element of the tuple (e.g., "TurksAndCaicosIslands"), not the human-readable country name with spaces.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.
Learnt from: KJhellico
PR: vacanza/holidays#2635
File: holidays/locale/dz_BT/LC_MESSAGES/BT.po:29-32
Timestamp: 2025-06-16T14:05:58.032Z
Learning: For Bhutan holidays, dz_BT (Dzongkha) is the default language. In default language .po files, empty msgstr values are correct since the msgid already contains the source text in the default language.
Learnt from: PPsyrius
PR: vacanza/holidays#2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.
Learnt from: PPsyrius
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:78-90
Timestamp: 2025-06-13T12:18:03.539Z
Learning: The holidays codebase now uses the constructor signature pattern `__init__(self, *args, islamic_show_estimated: bool = True, **kwargs)` across country classes.
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.
Learnt from: KJhellico
PR: vacanza/holidays#2601
File: README.md:108-108
Timestamp: 2025-06-09T19:39:38.818Z
Learning: The correct way to count supported countries in the holidays library is by counting unique country module files in holidays/countries/ (excluding __init__.py) or by counting entries in the COUNTRIES registry, not by counting individual class definitions which include alias classes.
Learnt from: PPsyrius
PR: vacanza/holidays#2490
File: holidays/countries/ethiopia.py:45-45
Timestamp: 2025-04-23T09:59:19.886Z
Learning: For the Ethiopia holidays class, it's appropriate to add a return type hint only to the `_is_leap_year` method to match the base class implementation in `holidays/holiday_base.py`, while keeping other methods without type hints to maintain consistency with other country implementations.
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/saint_pierre_and_miquelon.py:39-48
Timestamp: 2025-06-18T15:34:18.326Z
Learning: The holidays library does not use `__all__` declarations in country modules. Country files follow a standard pattern without explicit exports, and suggesting `__all__` goes against the established library-wide convention.
Learnt from: KJhellico
PR: vacanza/holidays#2583
File: holidays/countries/niger.py:1-1
Timestamp: 2025-06-01T17:58:53.279Z
Learning: In the holidays project, module-level docstrings are not required or needed for country holiday files in the holidays/countries/ directory.
🧬 Code Graph Analysis (1)
holidays/countries/__init__.py (1)
holidays/countries/bhutan.py (3)
Bhutan
(17-89)BT
(92-93)BTN
(96-97)
🪛 Flake8 (7.2.0)
holidays/countries/__init__.py
[error] 39-39: 'holidays.countries.bhutan.Bhutan' imported but unused
(F401)
[error] 39-39: 'holidays.countries.bhutan.BT' imported but unused
(F401)
[error] 39-39: 'holidays.countries.bhutan.BTN' imported but unused
(F401)
⏰ Context from checks skipped due to timeout of 300000ms (1)
- GitHub Check: CodeQL
🔇 Additional comments (2)
holidays/countries/__init__.py (1)
39-40
: Import looks good – nothing else to change.Placement keeps the block alphabetised and the existing
# ruff: noqa: F401
header already suppresses unused-import lint for the whole file.
No action needed.holidays/registry.py (1)
47-48
: Registry entry ✔️Tuple follows the
("ClassName", "BT", "BTN")
pattern and is inserted in the right spot alphabetically.
Good job.
|
Proposed change
Add Bhutan holidays
Resolves #1156.
Type of change
holidays
functionality in general)Checklist
make check
, all checks and tests are green