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

Fix getUsageMethod bug introduced by #979 #989

Merged
merged 4 commits into from
May 2, 2024
Merged

Conversation

bqth29
Copy link
Collaborator

@bqth29 bqth29 commented Apr 29, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What is the new behavior (if this is a feature change)?
PR #979 introduced an optimized way of retrieving a remedial action's usage rule for a given state. However, for onConstraint usage rules, in the computeUsageMethodPerStateAndInstant method, the following check was missing before to upate the state to usage rule map:

if (usageRule.getInstant().equals(state.getInstant())) {
    updateMapWithValue(usageMethodPerState, state, usageRule.getUsageMethod());
}

This check is necessary to remain equivalent to UsageRule::getUsageMethod(State state)

Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
@bqth29 bqth29 requested a review from pet-mit April 29, 2024 09:15
@bqth29 bqth29 added bug Something isn't working PR: waiting-for-review This PR is waiting to be reviewed labels Apr 29, 2024
bqth29 and others added 3 commits April 29, 2024 11:48
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
@pet-mit pet-mit merged commit 495303b into main May 2, 2024
9 checks passed
@pet-mit pet-mit deleted the fix/bug_introduced_by_979 branch May 2, 2024 09:15
MartinBelthle pushed a commit that referenced this pull request May 28, 2024
Signed-off-by: belthlemar <martin.belthle@rte-france.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR: waiting-for-review This PR is waiting to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants