Conversation
Changeing logic messages from hour to "slots". Adding a message to show interval at the beginning of evaluation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Batcontrol’s default logic logging to better reflect 15-minute operation (time “slots” instead of “hours”) and reduces some confusing recharge-related log output, aligning with issue #275.
Changes:
- Reworded multiple default-logic debug messages from “hours” to “slots” and updated related docstrings.
- Adjusted displayed evaluation-window timestamps for slot-based evaluation logging.
- Added cycle-start logging in the main
Batcontrol.run()loop.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
src/batcontrol/logic/default.py |
Renames hour-based terms to slot-based terms in logs/docstrings and tweaks recharge/discharge evaluation logging behavior. |
src/batcontrol/core.py |
Adds log lines at the start of each evaluation cycle, including the configured time resolution. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
* Initial plan * Fix PEP8 whitespace: remove extra spaces in append(slot) call Co-authored-by: MaStr <1036501+MaStr@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MaStr <1036501+MaStr@users.noreply.github.com>
* Initial plan * Fix last_time calculation to align to slot boundary Co-authored-by: MaStr <1036501+MaStr@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MaStr <1036501+MaStr@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/batcontrol/logic/default.py:422
- After computing
recharge_energy = required_energy - stored_usable_energy, the code no longer short-circuits whenrecharge_energy <= 0. That means a negative/zerorecharge_energyflows into the free-capacity/min-threshold logic and can trigger the "below threshold" debug message even though no charging is needed. Add an early return (and/or a dedicated debug message) whenrecharge_energy <= 0.0to keep logs and control flow consistent with the intended meaning.
free_capacity = calc_input.free_capacity
if recharge_energy > free_capacity:
recharge_energy = free_capacity
logger.debug(
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
As stated in #275 , there are multiple occasions, where the logmessages tells "hour", but in fact it is working on 15 minutes.
That was adjusted.
In addition some odd logic messages, when having no recharge energy defined are left out.