-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dynawo models supplier #349
Conversation
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
dynawaltz/src/main/java/com/powsybl/dynawaltz/suppliers/dynamicmodels/DynamicModelConfig.java
Outdated
Show resolved
Hide resolved
|
||
private static void invokeMethod(Class<? extends ModelBuilder> builderClass, ModelBuilder<DynamicModel> builder, Property property) { | ||
try { | ||
builderClass.getMethod(property.name(), property.propertyClass()).invoke(builder, property.value()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep in mind that this might take time and that we could maybe cache the getMethod?
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
Add javadoc Signed-off-by: lisrte <laurent.issertial@rte-france.com>
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
dynawaltz/src/main/java/com/powsybl/dynawaltz/suppliers/PropertyParserUtils.java
Outdated
Show resolved
Hide resolved
return builder.build(); | ||
} | ||
|
||
private static void parseArrays(JsonParser parser, PropertyBuilder builder) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You tried to reuse JsonUtil methods, so why didn't you use JsonUtil::parseValueArray
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JsonUtil::parseValueArray
does not work since we try to parse array of arrays. The method expects a value when we want to parse internal array's parenthesis.
.../java/com/powsybl/dynawaltz/suppliers/dynamicmodels/DynamicModelConfigsJsonDeserializer.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/powsybl/dynawaltz/suppliers/dynamicmodels/DynawoDynamicModelsSupplier.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/powsybl/dynawaltz/suppliers/events/EventModelConfigsJsonDeserializer.java
Outdated
Show resolved
Hide resolved
@@ -21,7 +21,7 @@ | |||
*/ | |||
public class TapChangerAutomationSystemBuilder extends AbstractAutomationSystemModelBuilder<TapChangerAutomationSystemBuilder> { | |||
|
|||
private static final String CATEGORY = "tapChangers"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason of changing the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the first version of this PR, the category field became accessible to user and the lower case and plural form did not seem to match the 'unique category' meaning it was supposed to be.
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
Quality Gate passedIssues Measures |
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
What kind of change does this PR introduce?
Feature
What is the current behavior?
The only
DynamicModelsSupplier
implementation come from powsybl-core and use groovy script as input (same for event).What is the new behavior (if this is a feature change)?
Add a new implementation using
DynamicModelConfig
from JSON file.Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Other information: