Conversation
aviralni
force-pushed
the
pyzes_power_apis
branch
from
September 23, 2026 06:03
3ddad26 to
6b09af3
Compare
Added following power APIs to python binding: 1. zesPowerGetUsage 2. zesPowerGetLimitsExt2 3. zesPowerSetLimitsExt2 4. zesPowerGetEnergyThreshold 5. zesPowerSetEnergyThreshold Along with the zes_energy_threshold_t structure, unit tests, power black box test coverage and README updates. Related-To: SYSM-430 Signed-off-by: Aviral Nigam <aviral.nigam@intel.com>
aviralni
force-pushed
the
pyzes_power_apis
branch
from
September 23, 2026 10:48
6b09af3 to
143c652
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Moderate issues can cause unintended hardware changes, invalid inputs, or silently skipped operations.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Adds five power-management APIs to the Python Sysman binding, including tests, examples, CLI controls, and documentation.
Changes:
- Adds usage, extended-limit, and energy-threshold wrappers.
- Adds unit and black-box coverage.
- Documents the new APIs.
| File | Description |
|---|---|
bindings/sysman/python/test/unit_tests/test_power.py |
Tests the new power API wrappers. |
bindings/sysman/python/source/pyzes.py |
Adds ctypes structures and API wrappers. |
bindings/sysman/python/source/examples/pyzes_black_box_test.py |
Adds runtime checks and setter CLI options. |
bindings/sysman/python/README.md |
Documents the newly supported APIs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| print_verbose( | ||
| " Skipping power set operations due to insufficient permissions" | ||
| ) | ||
| elif properties.canControl: |
Comment on lines
+1183
to
+1189
| elif energy_threshold is not None and energy_threshold.enable: | ||
| # Only re-apply an already enabled threshold since it cannot be unset afterwards | ||
| rc = pz.zesPowerSetEnergyThreshold( | ||
| power_handles[i], energy_threshold.threshold | ||
| ) | ||
| if check_rc(f"zesPowerSetEnergyThreshold(power {i})", rc): | ||
| print_verbose(" Set energy threshold successfully") |
Comment on lines
+172
to
+176
| | `zesPowerGetUsage` | Power | 0.1.3 | None | | ||
| | `zesPowerGetLimitsExt2` | Power | 0.1.3 | None | | ||
| | `zesPowerSetLimitsExt2` | Power | 0.1.3 | Linux: Requires superuser | | ||
| | `zesPowerGetEnergyThreshold` | Power | 0.1.3 | None | | ||
| | `zesPowerSetEnergyThreshold` | Power | 0.1.3 | Linux: Requires superuser | |
This branch has not been deployed
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.


Uh oh!
There was an error while loading. Please reload this page.