Skip to content

Conversation

@shsms
Copy link
Contributor

@shsms shsms commented Apr 22, 2025

And revert back to plain Matryoshka for PV and EV chargers.

shsms added 2 commits April 22, 2025 11:21
And revert back to plain Matryoshka for PV and EV chargers.

Signed-off-by: Sahas Subramanian <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings April 22, 2025 09:30
@shsms shsms requested a review from a team as a code owner April 22, 2025 09:30
@shsms shsms requested review from daniel-zullo-frequenz and removed request for a team April 22, 2025 09:30
@github-actions github-actions bot added part:docs Affects the documentation part:microgrid Affects the interactions with the microgrid labels Apr 22, 2025
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 PR reverses the previously introduced change where the additive ShiftingMatryoshka algorithm was applied universally by restoring the plain Matryoshka algorithm for PV and EV chargers while retaining the shifting algorithm exclusively for batteries.

  • Modifies the PowerWrapper init to accept a power management algorithm
  • Updates the PowerManagingActor to receive the algorithm parameter instead of using a default
  • Adjusts the instantiation of PowerWrapper in the data pipeline and updates the release notes accordingly

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/frequenz/sdk/microgrid/_power_wrapper.py Introduces a new parameter "power_manager_algorithm" in the constructor and passes it to the actor.
src/frequenz/sdk/microgrid/_power_managing/_power_managing_actor.py Removes the default algorithm and accepts the algorithm parameter explicitly.
src/frequenz/sdk/microgrid/_data_pipeline.py Updates algorithm selection: batteries use ShiftingMatryoshka; PV and EV use Matryoshka.
RELEASE_NOTES.md Updates the release notes to reflect that the algorithm selection has been reverted for PV and EV chargers.
Comments suppressed due to low confidence (1)

src/frequenz/sdk/microgrid/_power_managing/_power_managing_actor.py:42

  • [nitpick] Consider renaming the parameter from 'algorithm' to 'power_manager_algorithm' for consistency with the PowerWrapper init signature and to reduce potential confusion.
algorithm: Algorithm,

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.

Nice to see how simple this change was 🎉

@github-project-automation github-project-automation bot moved this from To do to Review approved in Python SDK Roadmap Apr 22, 2025
@shsms shsms added this pull request to the merge queue Apr 22, 2025
Merged via the queue into frequenz-floss:v1.x.x with commit c1c887e Apr 22, 2025
5 checks passed
@shsms shsms deleted the only-shift-batteries branch April 22, 2025 10:04
@github-project-automation github-project-automation bot moved this from Review approved to Done in Python SDK Roadmap Apr 22, 2025
Copy link
Contributor

@ela-kotulska-frequenz ela-kotulska-frequenz left a comment

Choose a reason for hiding this comment

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

LGTM.
Just have one question.

Comment on lines 111 to 123
self._ev_power_wrapper = PowerWrapper(
self._channel_registry,
api_power_request_timeout=api_power_request_timeout,
power_manager_algorithm=Algorithm.MATRYOSHKA,
component_category=ComponentCategory.EV_CHARGER,
)
self._pv_power_wrapper = PowerWrapper(
self._channel_registry,
api_power_request_timeout=api_power_request_timeout,
power_manager_algorithm=Algorithm.MATRYOSHKA,
component_category=ComponentCategory.INVERTER,
component_type=InverterType.SOLAR,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

If I remember correctly, original Matryoshka algorithm had something like operating point adjustment.
How it works now?

Copy link
Contributor

Choose a reason for hiding this comment

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

That was like a partition, so all actors that were in the operating point group would shift the other actors or something like that. I think now is like the operating point group is always empty. But maybe @shsms can check I'm not mistaken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was mainly for battery use cases and is gone now. We only have a single matryoshka instance for PV and EV chargers.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, thanks a lot! :)

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