Skip to content

feature: Add more power APIs to L0 Sysman python binding - #520

Open
aviralni wants to merge 1 commit into
oneapi-src:masterfrom
aviralni:pyzes_power_apis
Open

aviralni wants to merge 1 commit into
oneapi-src:masterfrom
aviralni:pyzes_power_apis

Conversation

@aviralni

@aviralni aviralni commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor
  1. zesPowerGetUsage
  2. zesPowerGetLimitsExt2
  3. zesPowerSetLimitsExt2
  4. zesPowerGetEnergyThreshold
  5. zesPowerSetEnergyThreshold

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 Medium severity · 1 Low severity

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants