-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Synchronize parameter retrieval methods with PlatformConfig overrides #3066
Synchronize parameter retrieval methods with PlatformConfig overrides #3066
Comments
ProposalConceptThe signature of the DetailsA new class It will have a single constructor defined as private: This constructor should:
They both will return a list of
These methods will be called in the For instance, @Override
public List<Parameter> getParameters() {
return DynamicValueParameter.load(PARAMETERS, getFormat(), defaultValueConfig);
} instead of: @Override
public List<Parameter> getParameters() {
return PARAMETERS;
} |
Updated proposalConceptThe signature of the DetailsA new class It will have a single constructor defined as private: This constructor should:
They both will return a list of
These methods will be called in the For instance, @Override
public List<Parameter> getParameters() {
return ConfiguredParameter.load(PARAMETERS, getFormat(), defaultValueConfig);
} instead of: @Override
public List<Parameter> getParameters() {
return PARAMETERS;
} |
Describe the current behavior
In the current implementation, we can retrieve a
List<Parameter>
from the following methods:These methods return the default parameters from their respective Provider/Importer/Exporter implementations. However, they do not account for the default parameter overrides specified in the
PlatformConfig
(in.itools/config.yml
).For example, in open-loadflow, the method returns a hard-coded list of default parameters: https://github.com/powsybl/powsybl-open-loadflow/blob/3404c7fa00058d278f0a78915653cab4e103a5b3/src/main/java/com/powsybl/openloadflow/OpenLoadFlowProvider.java#L312.
The issue is that this list is not synchronized with the parameters actually used in the calculation, which correctly accounts for the
PlatformConfig
if the default parameters are overridden withopen-loadflow-default-parameters:
in.itools/config.yml
.Describe the expected behavior
should retrieve a
List<Parameter>
that reflects both the default parameters set in their respective Provider/Importer/Exporter implementations and any overrides specified in thePlatformConfig
(in.itools/config.yml
).For instance, in open-loadflow, instead of returning a hard-coded list of default parameters, the method should dynamically generate this list, incorporating any overrides defined under open-loadflow-default-parameters: in
.itools/config.yml
. This ensures that the parameters retrieved are synchronized with the ones specified in thePlatformConfig
.Describe the motivation
In GridSuite, we retrieve the
List<Parameter>
from providers/importers and only save the parameters that differ from this list. However, the current implementation of these methods is not synchronized with the actual parameters used in the calculation, as it does not account for thePlatformConfig
overrides.Due to this discrepancy, we must manually hard-code the overrides in the code, as there is no straightforward way to retrieve the default parameters with the
PlatformConfig
overrides applied. This adds complexity and redundancy.For example, in the LoadFlow parameters, LoadFlowService.java#L81-L97, there is a manual override that would be unnecessary if the methods accurately reflected the
PlatformConfig
settings. Synchronizing these methods withPlatformConfig
would simplify parameter management. We would only need to modify the default parameters in.itools/config.yml
with no code addition.Extra Information
No response
The text was updated successfully, but these errors were encountered: