What is the new behavior (if this is a feature change)?
LoadFlow API aligned with powsybl-core:
pypowsybl.loadflow.Parameters:
⚠️ simul_shunt is now shunt_compensator_voltage_control_on
⚠️ no_generator_reactive_limits is now use_reactive_limitsCaution: with different meaning / boolean flipped
pypowsybl.loadflow.ComponentResult:
⚠️ ComponentStatus.SOLVER_FAILED removed
ComponentStatus.NO_CALCULATION added
ComponentResult.status_text added
ComponentResult.reference_bus_id added
⚠️ ComponentResult.slack_bus_id and ComponentResult.slack_bus_active_power_mismatch are replaced by ComponentResult.slack_bus_results array of pypowsybl.loadflow.SlackBusResult objects, with properties id and active_power_mismatch. (adds support for multiple slack buses as e.g. possible in OLF)
Does this PR introduce a breaking change or deprecate an API?
[x] Yes
If yes, please check if the following requirements are fulfilled
[x] The Breaking Change or Deprecated label has been added
[x] The migration steps are described in the following section
What changes might users need to make in their application due to this PR? (migration steps)
see above listed changes marked ⚠️
⚠️ simul_shunt is now shunt_compensator_voltage_control_on
# before
lf.Parameters(simul_shunt=True)
# now
lf.Parameters(shunt_compensator_voltage_control_on=True)
⚠️ no_generator_reactive_limits is now use_reactive_limitsCaution: with different meaning / boolean flipped
# before
lf.Parameters(no_generator_reactive_limits=False)
# now
lf.Parameters(use_reactive_limits=True)
⚠️ ComponentStatus.SOLVER_FAILED removed
This enum constant was not used to known PowSyBl LoadFlow providers/implementations. If you were using it/testing for this outcome, just replace with ComponentStatus.FAILED. LoadFlow providers/implementations are supposed to provide failure reason in the new status_text field.
⚠️ ComponentResult.slack_bus_id and ComponentResult.slack_bus_active_power_mismatch are replaced by ComponentResult.slack_bus_results array of pypowsybl.loadflow.SlackBusResult objects, with properties id and active_power_mismatch. (adds support for multiple slack buses as e.g. possible in OLF)
results = lf.run_ac(n)
# before
print(results[0].slack_bus_id)
print(results[0].slack_bus_active_power_mismatch)
# now
print(results[0].slack_bus_results[0].id)
print(results[0].slack_bus_results[0].active_power_mismatch)
Other information:
Including ComponentResult-s metrics is left for future work.
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Feature
What is the current behavior?
LoadFlow API not aligned with powsybl-core (LoadFlowParameters, LoadFlowResults), See changes that are not accounted so far:
What is the new behavior (if this is a feature change)? LoadFlow API aligned with powsybl-core:
pypowsybl.loadflow.Parameters
:simul_shunt
is nowshunt_compensator_voltage_control_on
no_generator_reactive_limits
is nowuse_reactive_limits
Caution: with different meaning / boolean flippedpypowsybl.loadflow.ComponentResult
:ComponentStatus.SOLVER_FAILED
removedComponentStatus.NO_CALCULATION
addedComponentResult.status_text
addedComponentResult.reference_bus_id
addedComponentResult.slack_bus_id
andComponentResult.slack_bus_active_power_mismatch
are replaced byComponentResult.slack_bus_results
array ofpypowsybl.loadflow.SlackBusResult
objects, with propertiesid
andactive_power_mismatch
. (adds support for multiple slack buses as e.g. possible in OLF)Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
see above listed changes marked ⚠️
simul_shunt
is nowshunt_compensator_voltage_control_on
no_generator_reactive_limits
is nowuse_reactive_limits
Caution: with different meaning / boolean flippedComponentStatus.SOLVER_FAILED
removedThis enum constant was not used to known PowSyBl LoadFlow providers/implementations. If you were using it/testing for this outcome, just replace with
ComponentStatus.FAILED
. LoadFlow providers/implementations are supposed to provide failure reason in the newstatus_text
field.ComponentResult.slack_bus_id
andComponentResult.slack_bus_active_power_mismatch
are replaced byComponentResult.slack_bus_results
array ofpypowsybl.loadflow.SlackBusResult
objects, with propertiesid
andactive_power_mismatch
. (adds support for multiple slack buses as e.g. possible in OLF)Other information:
Including ComponentResult-s metrics is left for future work.