Skip to content

docs(alarm): consolidate parameters and docs of Alarm factory methods - #1603

Open
Solaris-star wants to merge 1 commit into
collective:mainfrom
Solaris-star:docs/1591-consolidate-alarm-factory-params
Open

docs(alarm): consolidate parameters and docs of Alarm factory methods#1603
Solaris-star wants to merge 1 commit into
collective:mainfrom
Solaris-star:docs/1591-consolidate-alarm-factory-params

Conversation

@Solaris-star

@Solaris-star Solaris-star commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Linked issue

Description

Aligns the three Alarm factory methods with Alarm.new(), following the issue checklist: optional parameters and their docstring Parameters entries are now alphabetical, and each method gained a versionadded admonition for 7.3.0, which was overlooked in #1417.

Required parameters keep their names and positions, and these methods are not in a released tag yet, so no call sites break.

New tests cover attribute forwarding through every factory and assert the optional parameters stay alphabetical. The order test fails on main and passes here.

Ran the full test suite, the doctest suite, and ruff locally.

Checklist

  • I added a change log entry.
  • I followed icalendar's Artificial intelligence policy and disclosed my Responsible AI use in my commit messages.
  • I added or updated tests.
  • I ran and ensured all tests pass locally.
  • I added or edited documentation as necessary.

@github-actions github-actions Bot added the ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding. label Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request did not pass quality checks and AI use is suspected. Please review Contribute and make any necessary amendments.

@github-actions

Copy link
Copy Markdown
Contributor

Profile summary:

GitHub user: Solaris-star
🟡 Some concerns found with user's profile.
🟢 No concerns found with recent PR activity.
🟢 No concerns found with recent issue activity.

For a more detailed report, run `gh-profiler Solaris-star`.
Full profile
GitHub user: Solaris-star
🟡 Some concerns found with user's profile.
   🟢 Account age: 6 years
   🟡 Profile information:
        company: University of Bristol
        location: China
      Empty fields: name, blog, email, bio

🟢 No concerns found with recent PR activity.
   100 PRs opened in the last 21 days.
      0 opened against repos the user owns.
      0 opened against repos in publicly associated orgs.
      100 opened against external repos.

   🟢 19 of 100 external PRs closed without merging in the last 21 days.

🟢 No concerns found with recent issue activity.
   2 new issues opened in the last 21 days.
      0 opened in repos the user owns.
      0 opened in repos in publicly associated orgs.
      2 opened in external repos.

   🟢 0 external issues closed as NOT_PLANNED.
   🟢 0 external issues opened with the same title.

@Solaris-star

Copy link
Copy Markdown
Contributor Author

I trimmed the pull request description to fit the PR quality thresholds (under 1000 characters, no inline code references). The ai-suspicion label was applied on the original oversized description; I cannot remove it myself, so please re-evaluate when convenient.

AI use is disclosed in the commit message and in the change log entry, per the Responsible AI use policy.

@read-the-docs-community

read-the-docs-community Bot commented Jul 27, 2026

Copy link
Copy Markdown

Documentation build overview

📚 icalendar | 🛠️ Build #33789803 | 📁 Comparing 4e47b9a against latest (a7530bb)

  🔍 Preview build  

5 files changed · ± 5 modified

± Modified

@stevepiercy

Copy link
Copy Markdown
Member

I trimmed the pull request description to fit the PR quality thresholds (under 1000 characters

@Solaris-star FYI, this limit is now 1500 characters, per #1604. Thanks for pointing it out.

@stevepiercy stevepiercy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure whether all parameters should be sorted. What do you think? @Solaris-star @niccokunzmann

I also flagged versionadded and added them to #1595 when this gets released.

Comment on lines 377 to 378
description: str,
trigger: timedelta | datetime,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should these two parameters be sorted as well?


Conforms to :rfc:`5545#section-3.6.6`.

.. versionadded:: 7.3.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Flagging this for the release manager to check that its version number is correct upon release. See #1595

Comment on lines 397 to 401
description: The text to display when the alarm fires.
Corresponds to the :attr:`description` property.
trigger: When the alarm fires, as a :class:`~datetime.timedelta`
relative to the event start (negative means before) or as an
absolute :class:`~datetime.datetime` (recommend UTC-aware).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sort?

Comment on lines 475 to 476
trigger: timedelta | datetime,
attach: str | bytes | None = None,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sort?


Conforms to :rfc:`5545#section-3.6.6`.

.. versionadded:: 7.3.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Check this upon release.

Comment on lines 496 to 503
@@ -497,16 +501,16 @@
sound file, or :class:`bytes` for inline binary audio data
(stored as ``VALUE=BINARY``). When ``None`` the client uses
its default sound.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sort?

Comment on lines 561 to 563
summary: str,
description: str,
trigger: timedelta | datetime,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sort?


Conforms to :rfc:`5545#section-3.6.6`.

.. versionadded:: 7.3.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Check on release.

Comment on lines 584 to 596
@@ -588,16 +594,16 @@
required.
attachments: Optional URI or sequence of URIs to attach to the
email.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sort?

`Alarm.new_display()`, `Alarm.new_audio()` and `Alarm.new_email()` were
added in collective#1417, but their optional parameters and `Parameters` entries did
not follow the alphabetical order that `Alarm.new()` establishes, and none
of them carried a `versionadded` admonition.

- Order the optional parameters of the three factory methods
  alphabetically, matching `Alarm.new()`. The required positional
  parameters keep their existing order, so no call site breaks.
- Order the `Parameters` entries in the docstrings the same way.
- Add a `.. versionadded:: 7.3.0` admonition to each factory method,
  which was overlooked in collective#1417.
- Add tests that assert the optional parameters of all four factory
  methods are in alphabetical order, and that `links`, `related_to`,
  `refids`, `concepts` and `uid` are forwarded to `Alarm.new()`.

The three factory methods are not part of any released tag yet, so
reordering their keyword parameters is not a breaking change.

Fixes collective#1591

AI disclosure: I used Claude Opus 4.5 to help draft this change and its
tests. Prompt: work on collective/icalendar issue collective#1591, verify which of
its checklist items are actually still open on current main, align the
optional parameters and docstring `Parameters` order of the three Alarm
factory methods with `Alarm.new()`, add the missing `versionadded`
admonitions, and add tests that fail before the change. Output: this
commit. I reviewed the result, confirmed the new tests fail on unpatched
main and pass with the change, and validated it locally with the full
pytest suite (17837 passed), `pytest src/icalendar/tests/test_with_doctest.py`
(368 passed) and `ruff check` / `ruff format`.
@Solaris-star
Solaris-star force-pushed the docs/1591-consolidate-alarm-factory-params branch from 2cf08ab to 4e47b9a Compare July 28, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

consolidate parameters and documentation for Alarm factory methods

2 participants