powsybl / pypowsybl

A PowSyBl and Python integration based on GraalVM native image
Mozilla Public License 2.0
53 stars 10 forks source link

Mismatch between docs and Parameters #723

Closed BDonnot closed 2 months ago

BDonnot commented 6 months ago

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

EtienneLt commented 5 months ago

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

jeandemanged commented 5 months ago

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

EtienneLt commented 5 months ago

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

jeandemanged commented 5 months ago

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.

BDonnot commented 5 months ago

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

jeandemanged commented 2 months ago

closing / online doc has been properly deployed meanwhile