Skip to content

Conversation

@ela-kotulska-frequenz
Copy link
Contributor

Commit 41d4543 changed float to Power in PowerDistributor's battery manager, but left %d in formatting.

@ela-kotulska-frequenz ela-kotulska-frequenz self-assigned this Jun 11, 2025
@Copilot Copilot AI review requested due to automatic review settings June 11, 2025 09:02
@ela-kotulska-frequenz ela-kotulska-frequenz requested a review from a team as a code owner June 11, 2025 09:02
@ela-kotulska-frequenz ela-kotulska-frequenz added the type:bug Something isn't working label Jun 11, 2025
@github-actions github-actions bot added the part:microgrid Affects the interactions with the microgrid label Jun 11, 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 fixes a formatting mismatch in the battery manager’s debug log by using %s instead of %d to print Power values.

  • Replaced an integer format specifier (%d) with a string specifier (%s) in a debug log.
  • Ensured consistent formatting when logging Power objects.
Comments suppressed due to low confidence (1)

src/frequenz/sdk/microgrid/_power_distributing/_component_managers/_battery_manager.py:276

  • Ensure that the Power class implements a clear __str__ method so that logging with %s produces a human-readable value rather than the default representation.
"Distributing power %s between the batteries %s",

Commit 41d4543 changed `float` to `Power` in PowerDistributor's
battery manager, but left %d in formatting.

Signed-off-by: Elzbieta Kotulska <[email protected]>
@github-actions github-actions bot added the part:docs Affects the documentation label Jun 11, 2025
@ela-kotulska-frequenz ela-kotulska-frequenz changed the title Bug fix: Print Power as str instead of int Bug fix: Print Power as str instead of decimal Jun 11, 2025
@github-project-automation github-project-automation bot moved this from To do to Review approved in Python SDK Roadmap Jun 11, 2025
@ela-kotulska-frequenz ela-kotulska-frequenz added this pull request to the merge queue Jun 11, 2025
Merged via the queue into frequenz-floss:v1.x.x with commit 5f5c540 Jun 11, 2025
5 checks passed
@ela-kotulska-frequenz ela-kotulska-frequenz deleted the bug_str branch June 11, 2025 09:24
@github-project-automation github-project-automation bot moved this from Review approved to Done in Python SDK Roadmap Jun 11, 2025
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 type:bug Something isn't working

Projects

Development

Successfully merging this pull request may close these issues.

2 participants