powsybl-core
powsybl-core copied to clipboard
Parameter extensions update from map
- 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);
}