-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support partial variants #494
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
… into diff-variant
Signed-off-by: BOUHOURS Antoine <[email protected]>
… into diff-variant Signed-off-by: BOUHOURS Antoine <[email protected]>
… into diff-variant
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: BOUHOURS Antoine <[email protected]>
Signed-off-by: Antoine Bouhours <[email protected]>
@@ -0,0 +1,165 @@ | |||
/** | |||
* Copyright (c) 2020, RTE (http://www.rte-france.com) |
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.
Change year
@@ -35,4 +37,18 @@ public class BranchSvAttributes extends AbstractAttributes implements Attributes | |||
@Schema(description = "Side 2 reactive power in MVar") | |||
@Builder.Default | |||
private double q2 = Double.NaN; | |||
|
|||
public static void bindAttributes(BranchSvAttributes attributes, List<Object> values) { |
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.
Why these 2 static methods bind and update in the client ?
They are only used in the server ...
Same for other *SvAttributes class ...
Quality Gate passedIssues Measures |
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
This PR adds support for partial variant clone.
In the following, we'll use these terms:
Note: the concept of partial variant as it is implemented assumes (as before) that when a variant is modified, all the "child" variants are deleted and need to be rebuilt.
What is the current behavior?
When cloning a network, all the identifiables and external attributes (reactive capability curves, temporary limits, etc.) are cloned. It leads to long clone time and duplicates unnecessary data in the server.
What is the new behavior (if this is a feature change)?
We add support for partial clone to only save on the server created/updated identifiables or external attributes in partial variants. Most of the logic is implemented in the server.
In the network store, this is done by adding two new network attributes:
In order to change the cloneStrategy, one can:
Note: NetworkStoreService.setCloneStrategy() does a synchronous call to the server to update the network attributes. This is done to make sure that we read the correct clone strategy as cloneVariant are also synchronous.
By default, when creating a network or cloning a network, the clone strategy is always set to partial. This means that if you have N1 with clone strategy full and you full clone it to N2, the clone strategy of N2 will be partial. I did it that way because I consider that full clone are a one time operation and should not be persisted for the next variants. This logic is applied in the server and cached client/buffered client too.
We also added utility methods to bind and update attributes for SV updates (see corresponding code in the server). It simplified the code on the server but I'm not sure it's a good implementation to have this in the client as it does not make much sense. To be discussed.
Does this PR introduce a breaking change or deprecate an API?
Other information:
As we don't implement a way to have a full clone from a partial variant, all variants are partial except the initial variant (variantNum = 0). We can thus see this first implementation as a "diff from initial variant". See further work to see what's missing to have full variant in between partial variants.
Prerequisite for this PR:
Further work should be done to: