Skip to content

Comments

Support fetching CHP data from the DataSourcingActor#1355

Merged
shsms merged 4 commits intofrequenz-floss:v1.x.xfrom
shsms:chp-streaming
Feb 18, 2026
Merged

Support fetching CHP data from the DataSourcingActor#1355
shsms merged 4 commits intofrequenz-floss:v1.x.xfrom
shsms:chp-streaming

Conversation

@shsms
Copy link
Contributor

@shsms shsms commented Feb 17, 2026

No description provided.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
To be able to keep the resampling actor from crashing or closing the
stream for components that are not streaming, we have to keep their
upstream channels open.

This will be revamped soon when we start supporting stream lifetimes
based on downstream needs.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
@shsms shsms requested a review from a team as a code owner February 17, 2026 16:37
@shsms shsms requested review from llucax and removed request for a team February 17, 2026 16:37
@github-actions github-actions bot added the part:microgrid Affects the interactions with the microgrid label Feb 17, 2026
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
@github-actions github-actions bot added the part:docs Affects the documentation label Feb 17, 2026
@shsms shsms requested review from a team and cwasicki February 17, 2026 16:39
@cwasicki cwasicki requested a review from Copilot February 17, 2026 19:59
)


@dataclass(kw_only=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder why there is so much boilerplate code in this module, but given the module's name I assume this code will go away soon?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, might be a few months, but this is a temporary layer to use old data sourcing and some other actors with the new client.

Metric.AC_REACTIVE_POWER_PHASE_3: lambda msg: msg.reactive_power_per_phase[2],
}

_CHP_DATA_METHODS: dict[Metric | TransitionalMetric, Callable[[ChpData], float]] = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like there is quite some code duplication here, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is also old stuff, will go away.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds support for fetching telemetry data from Combined Heat and Power (CHP) components to the SDK's data pipeline. The implementation follows the established pattern used for other component types like inverters and EV chargers.

Changes:

  • Added ChpData class to represent CHP component telemetry data
  • Integrated CHP support into MicrogridApiSource for data fetching and extraction
  • Updated release notes to document the new CHP telemetry support

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/frequenz/sdk/microgrid/_old_component_data.py Added ChpData class with fields, metrics, and conversion methods following the InverterData pattern
src/frequenz/sdk/microgrid/_data_sourcing/microgrid_api_source.py Added CHP data extraction methods, request validation, and integrated CHP category into data sourcing logic; also includes unrelated removal of channel cleanup code
RELEASE_NOTES.md Documented new CHP telemetry support feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -422,13 +482,6 @@ async def clean_tasks(
sending_tasks = await clean_tasks(sending_tasks)

await asyncio.gather(*sending_tasks)
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

This code removal appears unrelated to adding CHP support. The removed lines were responsible for cleaning up and closing channels from the registry after data streaming ends. If this removal is intentional (perhaps as a bug fix or optimization), it should be documented in the PR description or release notes. If unintentional, these lines should be restored as they handle important cleanup logic.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@cwasicki cwasicki left a comment

Choose a reason for hiding this comment

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

LGTM

@github-project-automation github-project-automation bot moved this from To do to Review approved in Python SDK Roadmap Feb 18, 2026
Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

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

LATM (Looks Awful To Me), but LGTM. 😆

Even when I read the commit message, it is not entirely clear to me why "Keep data sourcing actor channels open for non-streaming components" is needed, but since this is throw-away code, I'm not very concerned. As long as it works for now, it is fine with me, so approving.

@shsms
Copy link
Contributor Author

shsms commented Feb 18, 2026

"Keep data sourcing actor channels open for non-streaming components"

The resampling actor crashes when its input channel is gone.

@shsms shsms added this pull request to the merge queue Feb 18, 2026
Merged via the queue into frequenz-floss:v1.x.x with commit ddd5a8d Feb 18, 2026
12 checks passed
@shsms shsms deleted the chp-streaming branch February 18, 2026 12:29
@github-project-automation github-project-automation bot moved this from Review approved to Done in Python SDK Roadmap Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:microgrid Affects the interactions with the microgrid

Projects

Development

Successfully merging this pull request may close these issues.

3 participants