+
Skip to content

Conversation

KJhellico
Copy link
Collaborator

Proposed change

Add subdivisions aliases where missing, reorder class attributes.

Type of change

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

Checklist

Copy link
Contributor

coderabbitai bot commented May 2, 2025

Summary by CodeRabbit

  • New Features

    • Added support for referencing country subdivisions by their full names and aliases in multiple countries, enhancing clarity and usability.
  • Documentation

    • Updated documentation and subdivision listings to display full subdivision names, aliases, and improved formatting for several countries and territories.
  • Style

    • Improved consistency and clarity of subdivision comments and formatting across multiple country configurations.
  • Tests

    • Refined subdivision alias parsing and normalization in documentation tests for greater accuracy and coverage.
      """

Summary by CodeRabbit

  • Documentation
    • Improved subdivision descriptions and formatting for multiple countries and territories, making names and aliases clearer and more informative in documentation.
  • New Features
    • Added support for subdivision name aliases in several countries, allowing users to reference subdivisions by their full names or common variants.
    • Introduced explicit start years for holiday data in various countries, providing clearer metadata.
  • Style
    • Enhanced readability of subdivision listings with expanded comments, punctuation, and consistent formatting.
  • Tests
    • Updated subdivision parsing logic in documentation tests for improved accuracy.

Walkthrough

This update reorganizes and enhances subdivision metadata for holiday classes across multiple countries. It introduces or expands subdivision alias dictionaries, adds or repositions start_year and language/category attributes, and improves inline documentation and comments for subdivision codes. Several classes now include explicit empty alias dictionaries to prevent inheritance from base classes. The README is updated for clarity, listing subdivision names more descriptively. Parsing logic in the documentation test is adjusted to align with the new subdivision formatting. No logic or control flow in holiday calculations is altered.

Changes

File(s) Change Summary
README.md Expanded and clarified subdivision descriptions for multiple countries; replaced codes with full names and added formatting improvements.
holidays/countries/american_samoa.py
holidays/countries/guam.py
holidays/countries/northern_mariana_islands.py
holidays/countries/puerto_rico.py
holidays/countries/united_states_minor_outlying_islands.py
holidays/countries/united_states_virgin_islands.py
Added explicit empty subdivisions_aliases dictionaries to prevent inheritance from base US class. No logic changes.
holidays/countries/andorra.py
holidays/countries/bolivia.py
holidays/countries/canada.py
holidays/countries/chile.py
holidays/countries/malaysia.py
holidays/countries/spain.py
holidays/countries/switzerland.py
holidays/countries/united_states.py
Introduced or expanded subdivisions_aliases dictionaries mapping full subdivision names (and variants) to codes. Enhanced subdivision tuple comments with full names and clarifications.
holidays/countries/australia.py
holidays/countries/austria.py
holidays/countries/argentina.py
holidays/countries/brazil.py
holidays/countries/el_salvador.py
holidays/countries/france.py
holidays/countries/germany.py
holidays/countries/india.py
holidays/countries/macau.py
holidays/countries/new_zealand.py
holidays/countries/portugal.py
holidays/countries/sao_tome_and_principe.py
holidays/countries/tuvalu.py
Reordered class attributes for clarity: moved or added start_year, supported_languages, and supported_categories attributes; improved comments and formatting in subdivision tuples. No logic changes.
holidays/countries/bosnia_and_herzegovina.py
holidays/countries/nicaragua.py
Improved or reordered comments for subdivision codes; minor attribute reordering. No logic changes.
tests/test_docs.py Updated subdivision parsing logic in documentation test to split by semicolons and strip whitespace, reflecting new subdivision formatting.

Possibly related PRs

Suggested labels

doc, l10n

Suggested reviewers

  • PPsyrius
    """

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 956fda6 and 4c04ebb.

📒 Files selected for processing (6)
  • README.md (11 hunks)
  • holidays/countries/canada.py (1 hunks)
  • holidays/countries/macau.py (1 hunks)
  • holidays/countries/portugal.py (2 hunks)
  • holidays/countries/united_states.py (2 hunks)
  • tests/test_docs.py (2 hunks)
🔇 Additional comments (23)
holidays/countries/macau.py (1)

65-66: Attribute reordering and inline documentation approved.
Moving start_year directly under default_language with a reference to “Decreto-Lei n.º 4/82/M” improves readability and aligns with other country classes’ metadata grouping. LGTM.

holidays/countries/portugal.py (2)

42-61: Good addition of descriptive comments for subdivision codes.

Adding region names as comments to each subdivision code improves code readability and makes it immediately clear what each code represents. This is a helpful change that aligns with the PR's goal of enhancing subdivision metadata.


86-86: Properly repositioned _deprecated_subdivisions attribute.

Moving the _deprecated_subdivisions attribute to follow supported_languages improves attribute organization and maintains a consistent structure throughout the codebase. This type of cleanup helps with code maintainability.

tests/test_docs.py (3)

104-104: Updated parser to handle semicolon delimiters in subdivision aliases.

The change from splitting on periods to semicolons aligns with changes in the README format, ensuring consistent parsing of subdivision aliases.


121-124: Special case handling for "Virgin Islands, U.S." alias.

Good solution for handling the comma in "Virgin Islands, U.S." which would otherwise cause incorrect splitting of the alias into separate parts.


127-127: Refined whitespace stripping behavior.

The simplified strip() call now properly preserves meaningful characters like asterisks that might appear in subdivision names while still removing whitespace.

README.md (11)

180-180: Improved Andorra subdivision information.

Full parish names have been added alongside their codes, making the documentation more descriptive and user-friendly.


292-292: Enhanced Bolivia subdivision documentation.

Added department names alongside their codes for better clarity and usability.


362-362: Comprehensive Canada subdivision information.

Both English and French names are now included alongside province/territory codes, improving accessibility for bilingual users.


376-376: Expanded Chile region information.

Added full region names alongside their codes for better readability and reference.


558-558: Improved Germany subdivision terminology.

Changed from "States" to "Lands" which better reflects the German "Länder" designation.


692-692: Comprehensive Italy province listing.

All province names are now shown alongside their codes, significantly improving clarity for users.


825-825: Enhanced Malaysia state and territory information.

Full names for states and federal territories now accompany their codes, providing more context.


916-916: Improved New Zealand region information.

Added both English and Māori names for regions alongside their codes, enhancing cultural relevance.


1154-1154: Expanded Spain autonomous communities information.

Full names of autonomous communities now accompany their codes, with both Castilian and Catalan names where applicable.


1182-1182: Comprehensive Switzerland canton information.

Added full canton names in multiple national languages alongside their codes, reflecting Switzerland's multilingual reality.


1280-1280: Improved United States state and territory listing.

Full names of all states and territories now accompany their abbreviations, making the documentation more accessible.

holidays/countries/united_states.py (2)

88-88: Added explicit start year for US holidays.

Setting start_year to 1777 provides clear metadata about the earliest applicable year for holiday calculations in the United States.


207-207: Reorganized class attributes.

Moved supported_categories after the subdivisions_aliases dictionary, maintaining logical grouping of related attributes.

holidays/countries/canada.py (4)

54-54: Added explicit start year for Canadian holidays.

Setting start_year to 1867 (Canadian Confederation) provides clear historical context for holiday calculations.


56-68: Enhanced subdivision comments.

Added full English and French names as comments next to each code, improving code readability and documentation.


70-91: Comprehensive bilingual subdivisions_aliases.

Added dictionary mapping all province/territory names in both English and French to their codes, supporting multilingual access to Canadian subdivisions.


92-92: Reorganized class attributes.

Moved supported_categories after the subdivisions_aliases dictionary, maintaining logical grouping of related attributes.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

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

Other keywords and placeholders

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

Documentation and Community

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

@github-actions github-actions bot added the test label May 2, 2025
Copy link

codecov bot commented May 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (8b56d46) to head (4c04ebb).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2520   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          215       215           
  Lines        13650     13663   +13     
  Branches      1930      1930           
=========================================
+ Hits         13650     13663   +13     

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

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 180b104 and d4aee3c.

📒 Files selected for processing (31)
  • README.md (11 hunks)
  • holidays/countries/american_samoa.py (1 hunks)
  • holidays/countries/andorra.py (1 hunks)
  • holidays/countries/argentina.py (2 hunks)
  • holidays/countries/australia.py (2 hunks)
  • holidays/countries/austria.py (1 hunks)
  • holidays/countries/bolivia.py (1 hunks)
  • holidays/countries/bosnia_and_herzegovina.py (2 hunks)
  • holidays/countries/brazil.py (1 hunks)
  • holidays/countries/canada.py (1 hunks)
  • holidays/countries/chile.py (1 hunks)
  • holidays/countries/el_salvador.py (2 hunks)
  • holidays/countries/france.py (2 hunks)
  • holidays/countries/germany.py (2 hunks)
  • holidays/countries/guam.py (1 hunks)
  • holidays/countries/india.py (2 hunks)
  • holidays/countries/macau.py (1 hunks)
  • holidays/countries/malaysia.py (2 hunks)
  • holidays/countries/new_zealand.py (1 hunks)
  • holidays/countries/nicaragua.py (2 hunks)
  • holidays/countries/northern_mariana_islands.py (1 hunks)
  • holidays/countries/portugal.py (2 hunks)
  • holidays/countries/puerto_rico.py (1 hunks)
  • holidays/countries/sao_tome_and_principe.py (2 hunks)
  • holidays/countries/spain.py (1 hunks)
  • holidays/countries/switzerland.py (1 hunks)
  • holidays/countries/tuvalu.py (2 hunks)
  • holidays/countries/united_states.py (2 hunks)
  • holidays/countries/united_states_minor_outlying_islands.py (1 hunks)
  • holidays/countries/united_states_virgin_islands.py (1 hunks)
  • tests/test_docs.py (2 hunks)
⏰ Context from checks skipped due to timeout of 300000ms (1)
  • GitHub Check: Test build on windows-latest
🔇 Additional comments (73)
holidays/countries/sao_tome_and_principe.py (3)

35-41: Subdivision tuple enriched with inline comments
The tuple now lists each code alongside its human‐readable name, greatly improving clarity.


43-53: Mapping full subdivision names to codes
The new subdivisions_aliases covers all districts and the autonomous region, ensuring reliable lookups and avoiding base‐class inheritance gaps.


54-54: Reordered supported_languages for consistency
Placing supported_languages after subdivisions_aliases aligns attribute grouping with other country modules.

holidays/countries/brazil.py (1)

35-36: Repositioned start_year for clearer attribute grouping
Placing start_year immediately after default_language matches the pattern in other country classes and improves readability. The decree comment succinctly documents the historical source.

holidays/countries/bosnia_and_herzegovina.py (3)

64-66: Good addition of periods to subdivision comments.

The addition of periods at the end of the subdivision comments provides better readability and maintains consistent punctuation style across the codebase.


68-75: Well-structured subdivision aliases dictionary.

The addition of the subdivisions_aliases dictionary is a solid improvement. It maps both full names and common abbreviations to their corresponding subdivision codes, which enhances API usability by allowing flexibility in how users reference subdivisions.


76-76: Proper attribute reordering.

Moving the supported_languages attribute after the subdivisions_aliases dictionary follows a logical organization pattern. This reordering creates consistency across different country modules and improves code readability.

holidays/countries/portugal.py (3)

42-61: Good use of inline region comments
Adding descriptive comments next to each subdivision code greatly improves readability and maintainability. The annotations accurately map codes to their regions.


63-84: Well-defined subdivisions_aliases mapping
The new subdivisions_aliases dictionary complements the subdivisions tuple and ensures lookup flexibility by name. All entries correctly correspond to their codes.


86-86: Attribute reordered for consistency
Moving _deprecated_subdivisions immediately after supported_languages aligns with the grouping of class metadata attributes.

holidays/countries/guam.py (1)

27-27: Override subdivisions_aliases to empty dict
Adds an explicit subdivisions_aliases = {} to prevent Guam from inheriting US subdivision aliases. This aligns with other US‐territory classes.

holidays/countries/puerto_rico.py (1)

27-27: Override subdivisions_aliases to empty dict
Explicitly setting subdivisions_aliases = {} ensures Puerto Rico does not inherit US subdivision aliases, matching the pattern in other territories.

holidays/countries/northern_mariana_islands.py (1)

27-27: Override subdivisions_aliases to empty dict
Adding subdivisions_aliases = {} cleanly isolates the Northern Mariana Islands from US subdivisions, consistent with the other territory classes.

holidays/countries/macau.py (1)

65-66: Reposition and annotate start_year
Moving start_year = 1982 immediately after default_language with a reference comment improves attribute grouping and consistency across country classes.

holidays/countries/el_salvador.py (3)

30-31: Add start_year with reference comment
Introducing # Labor Code 1972. and start_year = 1973 right after default_language follows the standardized attribute ordering for clarity.


33-46: Define subdivision codes with comments
Listing all 14 subdivision codes with descriptive inline comments enhances readability and user guidance. Looks complete and well‐formatted.


64-64: Confirm supported language code
You’ve relocated supported_languages correctly. Please verify that "uk" (Ukrainian) is intended here and follows the project’s locale conventions.

holidays/countries/bolivia.py (4)

43-43: Good repositioning of start_year attribute.

Moving the start_year attribute closer to the beginning of the class attributes improves code organization and makes it more consistent with other country classes.


45-53: Improved subdivision comments with trailing periods.

The addition of trailing periods to subdivision comments enhances readability and maintains a consistent style throughout the codebase.


55-65: Appropriate addition of subdivisions_aliases dictionary.

This new dictionary mapping full subdivision names to their codes enhances the API by allowing users to reference subdivisions by their full names rather than just codes. This makes the library more user-friendly and intuitive.


66-66: Logical repositioning of supported_languages.

Moving the supported_languages tuple after all subdivision-related attributes creates a more consistent attribute ordering pattern across country classes.

holidays/countries/france.py (2)

33-33: Good repositioning of start_year attribute.

Moving the start_year attribute to appear just below default_language improves attribute organization and aligns with the standardized pattern being implemented across country classes.


62-62: Proper repositioning of supported_languages.

Moving the supported_languages tuple to after the subdivisions_aliases dictionary creates a more consistent attribute ordering pattern across country classes.

holidays/countries/india.py (3)

49-50: Good improvement with labeled and positioned start_year.

Adding the comment about India's independence provides useful context for the start_year value, and placing it near the top of the class attributes follows the standardization pattern being implemented across country classes.


146-148: Appropriate repositioning of category and language attributes.

Moving the supported_categories and supported_languages after the subdivision-related attributes improves attribute grouping consistency across country classes.


148-151: Good addition of _deprecated_subdivisions.

Reintroducing the _deprecated_subdivisions tuple ensures backwards compatibility while documenting which subdivision codes are no longer current, which is helpful for maintainers and users.

holidays/countries/australia.py (3)

56-56: Good repositioning of start_year attribute.

Moving the start_year attribute to appear early in the class attributes list improves organization and follows the standardization pattern being implemented across country classes.


57-66: Enhanced subdivision documentation with descriptive comments.

The reformatted subdivisions tuple with detailed comments for each subdivision code significantly improves readability and makes the code more self-documenting. This is especially helpful for developers who might not be familiar with Australian state/territory codes.


77-78: Logical repositioning of category and language attributes.

Moving the supported_categories and supported_languages attributes after subdivision-related attributes creates a more consistent attribute ordering pattern across country classes.

holidays/countries/nicaragua.py (2)

31-47: Great addition of inline comments for subdivisions.

The detailed comments for each code improve readability and help other contributors quickly identify regions.


65-67: Aliases reordered to match subdivisions tuple.

Swapping “Río San Juan” below “Rivas” aligns the alias dictionary order with the subdivisions tuple. The mapping logic remains correct.

holidays/countries/american_samoa.py (1)

26-27: Override subdivision aliases to isolate from US.

Explicitly setting subdivisions_aliases = {} ensures no US aliases bleed into American Samoa. Well aligned with the empty subdivisions override.

holidays/countries/andorra.py (1)

35-43: Nice mapping of full names to codes.

Introducing subdivisions_aliases enables name-to-code lookups for Andorra’s parishes. The entries mirror the subdivisions tuple perfectly.

holidays/countries/united_states_minor_outlying_islands.py (1)

27-27: Consistent override of subdivision aliases.

Adding subdivisions_aliases = {} here matches the pattern in other US territories and correctly prevents inheritance.

holidays/countries/austria.py (1)

63-64: Reordered metadata for clarity.

Moving supported_categories and supported_languages below subdivisions_aliases groups related attributes and matches the structure used elsewhere.

tests/test_docs.py (2)

104-104: Improved subdivision parsing logic

This change simplifies the parsing of subdivision aliases by directly splitting on semicolons, aligning with the updated README format where subdivision descriptions are more structured and detailed.


124-124: Simplified string stripping

Removed unnecessary characters from strip() to only remove whitespace, making the code cleaner and behavior more predictable.

holidays/countries/united_states_virgin_islands.py (1)

27-27: Good defensive programming practice

Explicitly overriding the US subdivisions_aliases with an empty dictionary prevents unintended inheritance of US subdivision aliases, which is consistent with the approach used in other US territories.

README.md (11)

180-180: Improved subdivision descriptions for Andorra

Added full parish names in parentheses, making the documentation more informative and user-friendly.


292-292: Enhanced Bolivia department names

Added full department names for better clarity and usability.


362-362: Added bilingual names for Canadian provinces

Including both English and French names for Canadian provinces and territories improves accessibility for both official language users.


376-376: Expanded Chilean region names

Added full official names for Chilean regions, enhancing documentation completeness.


558-558: Used more accurate terminology for German subdivisions

Changed "States" to "Lands" which better reflects the German "Länder" concept.


692-692: Comprehensive Italian province listing

Provided detailed province names and variants, significantly improving the usability of the documentation.


825-825: Enhanced Malaysian state information

Added full state names and codes for better clarity and reference.


916-916: Added indigenous names for New Zealand regions

Including Māori names for regions shows cultural sensitivity and provides more complete information.


1154-1154: Improved Spanish autonomous community descriptions

Added alternative names in different languages, reflecting Spain's multilingual character.


1182-1182: Enhanced Swiss canton information

Added multilingual canton names to reflect Switzerland's linguistic diversity.


1280-1280: Complete US state and territory names

Listed full names for all US states and territories, improving documentation clarity.

holidays/countries/new_zealand.py (2)

31-31: Improved attribute organization

Moving the start_year attribute closer to the top of the class groups related class-level attributes together, improving code organization and readability.


35-51: Enhanced subdivision documentation

Reformatted subdivision comments to use parentheses for Māori names instead of slashes, with better capitalization and spacing. This improves readability and cultural sensitivity while maintaining code clarity.

holidays/countries/spain.py (1)

58-76: Clear and consistent subdivisions listing
The subdivisions tuple is correctly ordered by ISO code and each entry is annotated with a descriptive comment. This improves readability and maintainability.

holidays/countries/chile.py (2)

63-63: Added start_year attribute
Placing start_year = 1915 above subdivisions aligns with the pattern in other country modules and clearly documents the earliest supported year for Chile.


65-81: Descriptive subdivision comments
Each Chile subdivision code is now paired with its full name in a comment, which enhances discoverability and reduces guesswork when browsing the code.

holidays/countries/united_states.py (2)

88-88: Introduced start_year attribute
Adding start_year = 1777 makes the earliest year explicit. Placement right after observed_label is consistent with other country classes.


207-207: Reordered supported_categories
Moving supported_categories below subdivisions_aliases improves attribute grouping and readability.

holidays/countries/argentina.py (2)

152-153: Repositioned and added start_year
Moving start_year = 1957 right after the observed label documents when Argentina’s modern holiday schedule began.


206-207: Reordered supported_languages and supported_categories
Relocating these attributes to follow subdivisions_aliases matches the organizational pattern used across other country modules.

holidays/countries/tuvalu.py (2)

42-45: Annotated independence and act dates with start_year
The comments clarify Tuvalu’s independence (1978) and the Public Holidays Amendment Act (1990). Defining start_year = 1990 immediately after these notes makes the timeline explicit.


68-68: Confirmed supported_languages placement
Keeping supported_languages = ("en_GB", "en_US", "tvl") after subdivisions_aliases maintains consistency with other country modules.

holidays/countries/switzerland.py (3)

32-32: Explicit start_year attribute added.

The addition of start_year = 1801 makes it clear when holidays for Switzerland begin to be calculated. This is a good improvement for consistency and clarity.


34-59: Improved subdivision documentation.

Adding descriptive comments to each subdivision code enhances maintainability by making it easier to understand what each code represents without having to consult external documentation. The additional information about alternative names (e.g., "Bern (Berne)") is particularly useful for multilingual contexts.


61-93: Added comprehensive subdivision aliases.

The new subdivisions_aliases dictionary provides a mapping between full canton names and their respective codes, including multilingual variants. This improves the API's usability by allowing users to reference subdivisions using full names rather than just codes.

holidays/countries/germany.py (3)

38-38: Repositioned start_year attribute.

Moving the start_year attribute to follow directly after default_language improves consistency with other country classes and makes this important attribute more prominent.


40-55: Enhanced subdivision documentation.

Adding descriptive comments to each German state improves code readability and makes it easier to understand what each subdivision code represents at a glance.


75-76: Repositioned supported categories and languages.

Moving supported_categories and supported_languages attributes to appear after the subdivisions information creates a more consistent attribute ordering pattern across country classes.

holidays/countries/canada.py (4)

54-54: Added explicit start_year attribute.

Setting start_year = 1867 makes it clear that Canadian holidays are calculated starting from the year of Confederation. This is a good addition for historical accuracy and consistency.


56-69: Enhanced subdivision documentation.

The addition of descriptive comments for each Canadian province and territory, including both English and French names where applicable, significantly improves code readability and maintainability.


70-91: Added comprehensive subdivision aliases.

The new subdivisions_aliases dictionary provides valuable mappings between full province/territory names and their respective codes, including French variants. This makes the API more user-friendly by allowing references using full names.


92-92: Repositioned supported_categories attribute.

Moving the supported_categories attribute to follow after the new subdivisions_aliases dictionary maintains a consistent attribute ordering pattern across country classes.

holidays/countries/malaysia.py (3)

97-97: Added explicit start_year attribute.

Setting start_year = 1952 aligns with when holidays for Malaysia began to be officially recognized after the Holidays Act 1951. This is a good addition for historical accuracy and consistency with other country classes.


99-114: Enhanced subdivision documentation.

The addition of descriptive comments for each Malaysian state and federal territory significantly improves code readability and makes it clear what each subdivision code represents.


143-143: Updated federal territory alias names.

Replacing abbreviated federal territory keys with their full official names ("Wilayah Persekutuan Kuala Lumpur", "Wilayah Persekutuan Labuan", "Wilayah Persekutuan Putrajaya") improves consistency and makes the aliases more formal and accurate.

Also applies to: 145-145, 147-147

@arkid15r arkid15r changed the title Add subdivisions aliases where missing Add missing subdivisions aliases May 3, 2025
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>
Signed-off-by: ~Jhellico <KJhellico@users.noreply.github.com>
PPsyrius
PPsyrius previously approved these changes May 5, 2025
Copy link
Collaborator

@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

sonarqubecloud bot commented May 5, 2025

@arkid15r arkid15r added this pull request to the merge queue May 5, 2025
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

LGTM

Merged via the queue into vacanza:dev with commit 4bdbd69 May 5, 2025
33 checks passed
@KJhellico KJhellico deleted the add-subdiv-aliases branch May 5, 2025 14:56
@arkid15r arkid15r mentioned this pull request May 5, 2025
kritibirda26 pushed a commit to kritibirda26/holidays that referenced this pull request May 7, 2025
Signed-off-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

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