pypowsybl icon indicating copy to clipboard operation
pypowsybl copied to clipboard

Mismatch between docs and Parameters

Open BDonnot opened this issue 4 months ago • 5 comments

Describe the current behavior

After upgrading (from a much older version) to the most recent one (1.3.1) the code I was using does not work any more.

I double check the documentation here, https://pypowsybl.readthedocs.io/en/stable/reference/loadflow/parameters.html but it seems to be outdated.

Describe the expected behavior

A fix of the doc for example.

Describe the steps

import pypowsybl.loadflow as lf
lf.Parameters(voltage_init_mode=None, transformer_voltage_control_on=None, no_generator_reactive_limits=None, phase_shifter_regulation_on=None, twt_split_shunt_admittance=None, simul_shunt=None, read_slack_bus=None, write_slack_bus=None, distributed_slack=None, balance_type=None, dc_use_transformer_ratio=None, countries_to_balance=None, connected_component_mode=None, provider_parameters=None)
# copy paste from the doc https://pypowsybl.readthedocs.io/en/stable/reference/loadflow/parameters.html

raises the error TypeError: __init__() got an unexpected keyword argument 'no_generator_reactive_limits' once removed i get: TypeError: __init__() got an unexpected keyword argument 'simul_shunt'

I suppose that the no_generator_reactive_limits has been renamed use_reactive_limits but I don't really know how to change the "simul_shunt" unfortunately.

Environment

Linux, ubuntu 20.04 (but not really relevant as it concerns the doc on the website)

Relevant Log Output

See paragraph above.

Extra Information

No response

BDonnot avatar Mar 11 '24 09:03 BDonnot

no_generator_reactive_limits is as you guessed use_reactive_limits simul_shunt is now shunt_compensator_voltage_control_on I will modify the documentation

https://github.com/powsybl/pypowsybl/commit/928300180d097cb44c117e3cc715572b7ececa33

EtienneLt avatar Mar 12 '24 08:03 EtienneLt

@EtienneLt it seems online documentation was not updated from latest release source code

jeandemanged avatar Mar 12 '24 08:03 jeandemanged

@jeandemanged yes it seems to be broken, we'll try to fix it

EtienneLt avatar Mar 12 '24 10:03 EtienneLt

Hi @BDonnot

I suppose that the no_generator_reactive_limits has been renamed use_reactive_limits but I don't really know how to change the "simul_shunt" unfortunately.

Be careful here it is not just a rename, because it is opposite logic now.

See #709 for migration guide.

jeandemanged avatar Mar 12 '24 10:03 jeandemanged

Thanks for the precision. I figure it out with the new names but it's nice to have the confirmation.

BDonnot avatar Mar 12 '24 12:03 BDonnot