Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the “energy imported by source” calculation to avoid missing-key failures (notably in charge log processing) by consolidating the per-CP and “all” variants into a single function and making name lookups more tolerant.
Changes:
- Replaced the split
calc_energy_imported_by_source_all/calc_energy_imported_by_source_cplogic with a unifiedcalc_energy_imported_by_source(...). - Adjusted
_analyse_energy_sourceto use the unified function and to optionally filter which error messages are emitted. - Updated unit tests to import and call the renamed function.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/helpermodules/measurement_logging/process_log.py | Consolidates energy-source import calculation and adds message filtering to prevent missing-key crashes in charge log flows. |
| packages/helpermodules/measurement_logging/process_log_unit_test.py | Updates imports/test name to use the unified calculation function. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.