Skip to content
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

Open
antoinebhs opened this issue Jun 18, 2024 · 0 comments
Open

Comments

@antoinebhs
Copy link
Contributor

antoinebhs commented Jun 18, 2024

Describe the current behavior

In the current implementation, we can retrieve a List<Parameter> from the following methods:

Importer.getParameters()
Exporter.getParameters()
LoadFlowProvider.getSpecificParameters()
ShortCircuitAnalysisProvider.getSpecificParameters()

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 with open-loadflow-default-parameters: in .itools/config.yml.

Describe the expected behavior

Importer.getParameters()
Exporter.getParameters()
LoadFlowProvider.getSpecificParameters()
ShortCircuitAnalysisProvider.getSpecificParameters()

should retrieve a List<Parameter> that reflects both the default parameters set in their respective Provider/Importer/Exporter implementations and any overrides specified in the PlatformConfig (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 the PlatformConfig.

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 the PlatformConfig 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 with PlatformConfig 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant