fix: correct to_powerdata, unify zero impedance handling, name the DC axes (0.11.1) - #144
Open
samtalki wants to merge 2 commits into
Open
fix: correct to_powerdata, unify zero impedance handling, name the DC axes (0.11.1)#144samtalki wants to merge 2 commits into
samtalki wants to merge 2 commits into
Conversation
… axes (0.11.1) The six findings from the PowerDiff.jl port, bound against PowerIO 0.11.1 over C ABI 7. - to_powerdata returns bus.va in radians, as its docstring states (#138); generator rows carry model, cost.model verbatim or 0 without a cost record (#142); validation runs only on in-service rows, so an out of service row cannot refuse the conversion, and strict=false copies in-service rows as stated (#143). - One zero impedance convention (#140): the DC calc_* family, the Julia assembled admittance matrices and to_powerdata throw PowerIOError with code BUILD.OPERATOR.ZERO_IMPEDANCE and every one accepts skip_zero_impedance=true; to_powerdata(net; zero_impedance=:open) keeps the former substitution as an explicit choice. ArgumentError is no longer thrown for assembly failures. - calc_dc_index_map names the bus and branch axes every DC calculation shares (#139); each calc_* docstring states its row and column selection; the binding builds the operators once through the pio_calc_dc_operators handle PowerIO 0.11.1 adds. - calc_branch_admittances returns (y_ff, y_ft, y_tf, y_tt) per in-service branch and to_powerdata documents the c1..c8 correspondence (#141). Project.toml is 0.11.1 with the changelog and news sections; the release intent returns to draft for prepare-intent. Two small original MATPOWER fixtures cover the zero impedance tie and the out of service cubic cost. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NoJFzdnTLwtFZLPhUeyCvR
`calc_branch_admittances` documented its rows as the selection `calc_dc_index_map` reports. They are not the same axis: the DC branch axis omits self loop branches and appends three winding transformer windings, while this function walks `net.branches` and filters on `in_service` alone. The `calc_dc_index_map` docstring made the mirror claim about the `c1..c8` rows of `to_powerdata`, which emits one row per branch with its own `status`. Reword both, and the Matrices page, to state each axis for what it is. `_branch_coeffs` carried an `open` keyword whose guard could never fire: the single call site passes `open=true`, and the real check, with the branch and its buses named, already runs before the call. Remove the keyword and the dead throw; the zero series admittance substitution stays, since that is the `zero_impedance=:open` path. Pin that `strict=false` relaxes the field checks only, not the zero impedance refusal, in the bridge tests. Emit a workflow warning when the companion powerio branch lookup falls back to `.github/powerio-companion`, so the substitution is visible in the run summary rather than buried in the step log. The earlier red CI on this PR was that fallback: the branch lookup ran seconds before the companion branch existed, so the job built a C ABI older than the views this branch mirrors. This push reruns CI, which now resolves the companion branch. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NoJFzdnTLwtFZLPhUeyCvR
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.
Summary
PowerIO.jl 0.11.1: the six findings from the PowerDiff.jl port, against PowerIO 0.11.1 over C ABI 7 (eigenergy/powerio branch of the same name, which the Julia binding job resolves).
vain degrees while its docstring says angles are radians #138to_powerdatareturnsbus.vain radians, as its docstring states and asshift,angmin,angmaxalready did.model(0 without a cost record, elsecost.modelverbatim).statusand cannot refuse the conversion.strict=falsecopies in-service rows as stated too.calc_*family,calc_admittance_matrix,calc_bprime_matrix,calc_bdoubleprime_matrix, andto_powerdatathrowPowerIOErrorwith codeBUILD.OPERATOR.ZERO_IMPEDANCE, and every one acceptsskip_zero_impedance=true;to_powerdata(net; zero_impedance=:open)keeps the former substitution as an explicit choice. The Julia assembled matrices no longer throwArgumentError.calc_dc_index_map(net)names the axes every DC calculation shares (idx_to_bus,bus_to_idx,idx_to_branch,branch_ids,skipped_branch_rows); everycalc_*docstring states its row and column selection; the binding builds the operators once through thepio_calc_dc_operatorshandle.calc_branch_admittances(net)returns(y_ff, y_ft, y_tf, y_tt)per in-service branch, andto_powerdatadocuments thec1..c8correspondence.Return types of the existing
calc_*functions are unchanged (0.11.x compatible).Project.tomlis 0.11.1, the changelog and NEWS carry the section, and.github/powerio-release.tomlis back indraftfor the maintainer'sprepare-intent.Closes #138, closes #139, closes #140, closes #141, closes #142, closes #143
Validation
Pkg.test()against apowerio-capibuilt from the companion branch (POWERIO_CAPIset): 1041 passed. The powerio repository'scheck-capi-v7.shpasses with this checkout (245 entry points named, all declared).🤖 Generated with Claude Code
https://claude.ai/code/session_01NoJFzdnTLwtFZLPhUeyCvR
Generated by Claude Code