Fix and improve docstring documentation#279
Merged
Merged
Conversation
Add relative_crossrefs: true to the mkdocstrings Python handler options in mkdocs.yml. This is part of the rolling-out of the relative cross-reference convention across all Frequenz projects. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Add check-class-attributes, check-style-mismatch, and require-inline-class-var-docs to the pydoclint configuration in pyproject.toml. These are part of the rolling-out of stricter docstring conventions across all Frequenz projects. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
The module-level type alias docstring must use the attribute convention: a noun phrase starting with "The". Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
- Add missing "A" article to class summary (Dispatch) - Fix property summary style: use noun phrase instead of imperative (started property: "Whether the dispatch is currently started.") - Fix boolean method summary: use "Return whether ..." instead of "Check if ..." (started_at) - Fix Args description: add "The" prefix and missing period - Fix Yields type annotation (remove type from docstring section) - Remove wrong Returns: section from generator method (missed_runs) - Remove redundant sentence that repeats the summary - Drop the # noqa: DOC405 suppression that is no longer needed Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
- Add missing "A" article to class summaries (MergeByType, MergeByTypeTarget) - Fix method summary mood: use imperative "Return whether ..." instead of noun phrases for identity and filter methods - Add missing Args: and Returns: sections to all abstract method overrides - Expand filter docstring with the actual propagation logic Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
- Add missing "A" articles to MergeStrategy and DispatchScheduler summaries
- Fix MergeStrategy.identity: add proper summary with Args and Returns
- Add inline docstrings to all QueueItem dataclass fields (time,
priority, dispatch_id, dispatch), fixing missing attribute documentation
- Add Args section to QueueItem.__init__
- Fix stale comment: _scheduled_events used tuples (now uses QueueItem)
- Add missing periods to bullet point list entries in
new_running_state_event_receiver docstring
- Replace bare backtick symbol mentions with proper cross-references
(MergeByType, MergeByTypeTarget, MergeStrategy, identity, filter)
- Fix tense mismatch in _execute_scheduled_event summary
("schedules" → "schedule")
- Add missing Args section to _fetch
- Fix _update_changed_running_state: use "Return whether ..." mood
- Add missing periods to Args descriptions in _update_changed_running_state
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
- Add missing "A"/"An" articles to class summaries (DispatchActorId,
DispatchInfo, ActorDispatcher, ActorAndChannel)
- Fix components property: use noun phrase ("The target components
(deprecated)") and replace non-standard Deprecation: admonition
with Warning:
- Fix cross-reference to target attribute: use relative ref [.target]
instead of absolute
- Add "The" prefix to target and options attribute docstrings
- Fix DispatchInfo.__init__ Args: add "The" to descriptions
- Replace "Example usage:" with standard "Example:" admonition
- Fix indentation of the entire example code block
- Add missing imports in example code (Any, Self from typing)
- Replace deprecated .components usage with .target in example
- Add missing await to new_running_state_event_receiver call in example
- Add missing Args section to _start_actor
- Fix misleading _stop_actor summary: it stops one actor, not all
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
- Fix typo: "highlevel" → "high-level" - Add backticks to all cross-reference display text so rendered links read as code (Dispatcher, Dispatch, ActorDispatcher, Created, Updated, Deleted) Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
- Fix typo: "highlevel" → "high-level" in module docstring and class docstring - Fix cross-references: use relative refs [.new_lifecycle_events_receiver] and [.new_running_state_event_receiver] in class docstring - Fix example imports: add missing Receiver, DispatchInfo, Actor - Fix example whitespace: remove double space (key = → key =) - Fix example bugs: add missing await to start_managing and new_running_state_event_receiver calls - Add "A" article to class summary - Fix microgrid_id Args description: "id" → "ID" - Fix sign_secret Args description: add period and restructure - Fix Raises description: add missing period - Add missing Args section to cancel method - Fix is_managed summary: use "Return whether ..." for boolean methods - Replace bare backtick mentions with cross-references (Dispatcher, start_managing, stop_managing) - Add missing period after stop_managing reference - Fix retry_interval description: "Retry interval" → "The retry interval to use ..." - Fix client property: use noun phrase with cross-reference to DispatchApiClient - Fix new_lifecycle_events_receiver: improve summary and Returns desc - Fix new_running_state_event_receiver: improve summary, add missing period to MergeStrategy sentence, fix bullet list periods, fix merge_strategy Args description Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
- Fix relative ref [.target] → [..target] in DispatchInfo.components: target is a sibling of components, not a child - Remove DispatchApiClient cross-reference: the symbol does not appear in the client-dispatch inventory; use plain prose description - Fix [Dispatcher][] → [frequenz.dispatch.Dispatcher]: bare name is not resolvable without the full qualified path - Fix [.start_managing] and [.stop_managing] → [..start_managing] and [..stop_managing]: these are siblings of start_managing within Dispatcher, not children Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
- Remove "(deprecated)" suffix from components property one-liner to avoid D402 (pydocstyle: first line should not be function's signature) - Wrap long line in start_managing docstring (E501: > 100 chars) Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
- __init__.py (module frequenz.dispatch): use .X for children (.Dispatcher, .Dispatch, .ActorDispatcher, .Created, .Updated, .Deleted) - _bg_service.py (DispatchScheduler.new_running_state_event_receiver): use ....X for frequenz.dispatch.* (4 levels: method → class → private module → package) - _dispatcher.py (Dispatcher.start_managing and new_running_state_event_receiver): use ...X for frequenz.dispatch.* (3 levels: method → class → package, since Dispatcher is exported directly under frequenz.dispatch) Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Marenz
approved these changes
Jun 30, 2026
Contributor
|
Manually reviewed!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This pull request is part of an automated effort to improve the docstring documentation of all our projects.
Main issues being resolved:
Other things to note: