powsybl-core icon indicating copy to clipboard operation
powsybl-core copied to clipboard

Parameter extensions update from map

Open sylvlecl opened this issue 2 years ago • 0 comments

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

Feature.

  • What is the current behavior?

#2033 added a method to create Extension<LoadFlowParameters> based on a Map<String, String>.

However, the behaviour we need is typically to first load an extension from configuration, and then only update it with values from a map.

This is not possible with the current API.

  • What is the expected behavior?

We should be able to update parameters with a map of properties. We can imagine 2 implementations:

  • as a method in LF providers
  • as a method in a new interface for extensions

The first option requires less changes in existing code.

// Option 1: additional method
interface LoadFlowProvider {
...
   void updateSpecificParameters(Extension<LoadFlowParameters> extension, Map<String, String> properties);
}

// Option 2: new interface
interface LoadFlowParametersExtension extends Extension<LoadFlowParameters> {
   void update(Map<String, String> properties);
}

sylvlecl avatar May 12 '22 11:05 sylvlecl