Fix and improve docstrings#215
Merged
Merged
Conversation
Several category docstrings had drifted from the protobuf documentation and were semantically wrong, too narrow, or too broad: - `INVERTER` described an inverter as "an electricity generator", which is wrong; it converts DC to AC power and vice versa. - `UNSPECIFIED` described an "unknown" category with error-handling advice; the proto means the sender did not specify a category and it should not be used (unknown/forward-incompatible categories are handled separately by `UnrecognizedElectricalComponent`). - `BATTERY` said "used by inverters", implying a fixed topology; it is a battery energy storage system on its own. - `BREAKER` said "a relay"; a circuit breaker adds protection semantics. - `CHP` restricted the source to combustion, which the proto does not. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
The proto describes this state as the component being *temporarily* unavailable for operation. The wrapper dropped "temporarily", which could mislead users into reading the state as permanent. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Several diagnostic-code docstrings had dropped important context from the
protobuf documentation: the grid and inverter codes mean the component is
*inoperable*, not merely that a value is out of range; the threshold codes
omitted the manufacturer/user-defined threshold context;
`RELAY_CYCLE_LIMIT_REACHED` is about the battery's DC contactor or relays
reaching end of life; and `GRID_DISCONNECTED`/`GRID_VOLTAGE_IMBALANCE`/
`GRID_ABNORMAL`/`PLAUSIBILITY_ERROR` lost their qualifying conditions.
`PROTECTIVE_SHUTDOWN` is intentionally left as-is: the proto comment for it is
a copy-paste duplicate of `HARDWARE_FAULT` ("inoperable due to its hardware
being faulty"), so the existing, more accurate wrapper wording is kept rather
than introducing a misleading duplicate.
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Three small docstring/comment issues in the metrics sample module: - `MetricSample.connection` was documented as an "electrical connection within the component", but `MetricSample` is also used by sensor telemetry and `MetricConnectionCategory` includes ambient, cabinet, heatsink, and transformer connections. Use neutral wording. - The `MetricSample` class docstring dropped "or derived"; the value is either measured or derived at a particular time. - Remove the stale comment claiming `value` is limited to `float`; the annotation is already `float | AggregatedMetricValue | None` and the converter handles aggregated metrics. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
daniel-zullo-frequenz
approved these changes
Jun 16, 2026
Merged
via the queue into
frequenz-floss:v0.x.x
with commit Jun 16, 2026
c20db72
12 of 13 checks passed
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.
Part of #203.