pypowsybl icon indicating copy to clipboard operation
pypowsybl copied to clipboard

load_from_string parameters are ambiguous

Open sylvlecl opened this issue 2 years ago • 0 comments

  • Do you want to request a feature or report a bug?

API clarification

  • What is the current behavior?

load_from_string method expects a "file name" as first parameter, which is surprising for the user, since it does not read the network from a file ...

Behind the scene, the filename is mainly used for selecting the right file format.

  • What is the expected behavior?

It would make more sense to specify the format instead of providing a filename. For example:

pp.network.load_from_string(format='XIIDM', content=...)

At least, the docstring should be clear about the use of that parameter. It's not the case today.

sylvlecl avatar Dec 05 '22 08:12 sylvlecl