Update documentation: surface API for ObservedHolidayBase and NoHolidayBase#3511
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Summary by CodeRabbit
WalkthroughDocstring and documentation link/formatting updates across docs and library modules; added explicit forwarding Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3511 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 313 313
Lines 18687 18689 +2
Branches 2389 2389
=========================================
+ Hits 18687 18689 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@holidays/holiday_base.py`:
- Around line 396-397: The docstring for HolidayBase.__add__ is inaccurate: for
unsupported operand types the method raises TypeError (except the special-case
when other == 0 where it returns self); update the return/behavior description
in the HolidayBase.__add__ docstring to state that it returns a HolidayBase when
addition succeeds, returns self when other == 0, and raises TypeError for
unsupported operand types so the docs match the implementation.
- Around line 304-305: The __init__ docstring on HolidayBase incorrectly
includes a "Returns" section describing a HolidayBase object; remove the
"Returns" block from the __init__ docstring in class HolidayBase
(holiday_base.py) so the constructor docstring only documents
parameters/behavior (and optionally side effects), leaving return descriptions
out; update the docstring for __init__ to describe input args (e.g.,
country/market) and behavior instead of claiming a returned object.
In `@holidays/ical.py`:
- Around line 231-233: The sentence in the RFC 5545 filename sentence is awkward
and implies the spec governs filenames; replace it with a tighter phrasing such
as: "RFC 5545 does not define filenames for .ics files; follow general
filesystem conventions and avoid problematic characters." Update the sentence in
the docstring/comment in holidays/ical.py where the RFC 5545 filename text
appears so it no longer suggests RFC 5545 specifies filenames and instead
clearly advises following filesystem conventions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: c59fb563-d6b0-4518-ad3a-330739984c5f
📒 Files selected for processing (10)
README.mddocs/api.mddocs/examples.mddocs/holiday_categories.mdholidays/holiday_base.pyholidays/ical.pyholidays/no_holiday_base.pyholidays/observed_holiday_base.pyholidays/utils.pyscripts/docs/gen_index.py
There was a problem hiding this comment.
♻️ Duplicate comments (1)
holidays/ical.py (1)
231-233: 🧹 Nitpick | 🔵 TrivialSimplify the RFC 5545 filename guidance.
The current phrasing ("While...does not explicitly restrict...it is still advisable") is harder to parse than needed. A more direct statement would improve clarity.
✨ Suggested simplification
- While [RFC 5545](https://datatracker.ietf.org/doc/html/rfc5545) does not explicitly - restrict filenames for `.ics` files, it is still advisable to follow general filesystem - conventions and avoid problematic characters. + [RFC 5545](https://datatracker.ietf.org/doc/html/rfc5545) does not define filename + conventions for `.ics` files. Follow general filesystem conventions and avoid + problematic characters.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@holidays/ical.py` around lines 231 - 233, The sentence explaining RFC 5545 filename guidance is wordy and hard to parse; replace the current line in holidays/ical.py with a concise statement such as "RFC 5545 does not restrict .ics filenames; still follow general filesystem conventions and avoid problematic characters." Locate the explanatory text block that currently begins "While RFC 5545 does not explicitly restrict filenames..." and substitute it with the simplified wording to improve clarity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@holidays/ical.py`:
- Around line 231-233: The sentence explaining RFC 5545 filename guidance is
wordy and hard to parse; replace the current line in holidays/ical.py with a
concise statement such as "RFC 5545 does not restrict .ics filenames; still
follow general filesystem conventions and avoid problematic characters." Locate
the explanatory text block that currently begins "While RFC 5545 does not
explicitly restrict filenames..." and substitute it with the simplified wording
to improve clarity.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: fa3ca3a0-4941-42ef-bd09-28a262c2bdea
📒 Files selected for processing (2)
holidays/holiday_base.pyholidays/ical.py
KJhellico
left a comment
There was a problem hiding this comment.
LGTM! Documentation is something I've always been bad at. 🤷♂️
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Line 91: The README uses an absolute branch-specific link to HolidayBase
(https://github.com/vacanza/holidays/blob/main/holidays/holiday_base.py);
replace it with a branch/tag-agnostic relative link to the HolidayBase source so
docs remain stable across branches (e.g., use the repository-relative path to
holidays/holiday_base.py or a link that omits "blob/main") and ensure the
textual reference to HolidayBase still points to the same symbol/class name.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e6b4c999-8026-4c3f-a27f-8c0659f61341
📒 Files selected for processing (3)
README.mddocs/holiday_categories.mdholidays/holiday_base.py
Proposed change
ObservedHolidayBaseAPI file, add/update docstring references for both public and private methods (the latter isn't visible to ReadTheDocs, but a nice QoL change for first-time contributors for sure)NoHolidayBaseto API file, removeHolidayBasebase class boilerplate for readability.Type of change
holidaysfunctionality in general)Checklist
make checklocally; all checks and tests passed.