Read the operational mode from Python components - #99
Open
shsms wants to merge 3 commits into
Open
Conversation
Bump the component-graph dependency from v0.6.0 to v0.6.1, which adds an operational mode to graph components: one that provides no telemetry is not used as a measurement source. Reading that mode from Python components follows in the next commit. Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Translate the operational mode the way the category is translated: Python splits the mode into `provides_telemetry()` and `accepts_control()`, and the two together name one `OperationalMode`. A mode is named only when both flags are known -- `provides_telemetry() == false` fits both `Inactive` and `ControlOnly` -- and a component may lack the methods entirely, as the assets client does. Both cases read as unspecified rather than failing the graph. Raise the `microgrid` extra to `frequenz-client-microgrid >= 0.18.4`, the release the two methods arrived in. On the old floor of 0.18.3 the mode was never readable and the mode tests could not run. Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Bump the crate version to 0.5.1 and write the release summary. Drop the empty Bug Fixes section, as CONTRIBUTING asks for at release time. Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
shsms
requested review from
florian-wagner-frequenz
and removed request for
a team
July 28, 2026 09:39
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.
frequenz-microgrid-component-graphv0.6.1 adds an operational mode to graphcomponents, but the trait default leaves every component
Unspecified— thebindings have to read the mode off each Python component for it to have any
effect. This builds against v0.6.1, translates the mode, and releases 0.5.1.
Changes
provides_telemetry()/accepts_control()into oneOperationalModeinComponent::try_new, alongside the existing categorytranslation.
microgridextra's floor tofrequenz-client-microgrid >= 0.18.4,the release the two methods arrived in. On 0.18.3 the mode is never readable
and the new tests cannot run.
Worth a look
provides_telemetry() == falsefitsInactiveandControlOnlyalike, so ahalf-known mode stays
Unspecifiedrather than being guessed at.methods, so their absence reads as unspecified instead of failing the graph —
the same tolerance the category lookup already has.
getattrandcall0are separate steps so a missing method reads asunspecified while an
AttributeErrorfrom inside the method body propagates.call_method0cannot tell those apart, and swallowing the second would hide acaller's bug and leave the component measuring.