-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: for parameter servers, update existing parameters instead of creating new and deleting old #905
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
base: main
Are you sure you want to change the base?
refactor: for parameter servers, update existing parameters instead of creating new and deleting old #905
Conversation
…f creating new and deleting old Added forgotten ShortCircuit parameter deletion on study deletion Use DTO for updating LoadFlow parameters Refactored createOrUpdate methods for parameters to better handle the creation of new parameters or update of existing parameters and removed the return in the middle of the method Updated tests to work with updated code
2485cbc to
9fb3765
Compare
|
dbraquart
left a comment
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.
code : a few remarks
tests : ok for LF (todo for others)
| assertTrue(requests.stream().anyMatch(r -> r.getPath().matches("/v1/cases/" + CASE_UUID))); | ||
| assertTrue(requests.stream().anyMatch(r -> r.getPath().matches("/v1/parameters/" + studyEntity.getVoltageInitParametersUuid()))); | ||
| assertTrue(requests.stream().anyMatch(r -> r.getPath().matches("/v1/parameters/" + studyEntity.getLoadFlowParametersUuid()))); | ||
| assertTrue(requests.stream().anyMatch(r -> r.getPath().matches("/v1/parameters/" + studyEntity.getVoltageInitParametersUuid()))); |
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.
| assertTrue(requests.stream().anyMatch(r -> r.getPath().matches("/v1/parameters/" + studyEntity.getVoltageInitParametersUuid()))); | |
| assertTrue(requests.stream().anyMatch(r -> r.getPath().matches("/v1/parameters/" + studyEntity.getLoadFlowParametersUuid()))); |
LF check has been deleted
| LOGGER.error(String.format("Could not retrieve short circuit parameters with id '%s' from user/profile '%s/%s'. Using default parameters", | ||
| profileSParamId, userId, userProfileinfos.getName()), e); | ||
| // In case of error (ex: wrong/dangling uuid in the profile), fall back to default parameters | ||
| scParametersToUse = scParameters; |
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.
can be removed, same as line 1380
And maybe the comment can be removed too, cause the LOG says everything ?
|
|
||
| if (profileSAParamId != null) { | ||
| try { | ||
| saParametersToUse = securityAnalysisService.getSecurityAnalysisParameters(profileSAParamId); |
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.
I think we need the "keptProvider" here too
| LOGGER.error(String.format("Could not retrieve voltage init parameters with id '%s' from user/profile '%s/%s'. Using default parameters", | ||
| profileVIParamId, userId, userProfileinfos.getName()), e); | ||
| // In case of error (ex: wrong/dangling uuid in the profile), fall back to default parameters | ||
| viParametersToUse = viParameters; |
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.
already done at line 1761
| "Could not retrieve spreadsheet config collection with id '%s' from user/profile '%s/%s'. Using default collection", | ||
| profileSCCId, userId, userProfileinfos.getName()), e); | ||
| // In case of error (ex: wrong/dangling uuid in the profile), fall back to default parameters | ||
| sccToUse = spreadsheetConfigCollection; |
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.
done at line 2847
| LOGGER.error(String.format("Could not retrieve dynamic security analysis parameters with id '%s' from user/profile '%s/%s'. Using default parameters", | ||
| profileDSAParamId, userId, userProfileInfos.getName()), e); | ||
| // In case of error (ex: wrong/dangling uuid in the profile), fall back to default parameters | ||
| dsaParametersToUse = dsaParameters; |
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.
done at line 3121
| LOGGER.error(String.format("Could not retrieve sensitivity analysis parameters with id '%s' from user/profile '%s/%s'. Using default parameters", | ||
| profileSAParamId, userId, userProfileinfos.getName()), e); | ||
| // In case of error (ex: wrong/dangling uuid in the profile), fall back to default parameters | ||
| saParametersToUse = saParameters; |
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.
done at line 3308



PR Summary
Added forgotten ShortCircuit parameter deletion on study deletion
Use DTO for updating LoadFlow parameters
Refactored createOrUpdate methods for parameters to better handle the creation of new parameters or update of existing parameters and removed the return in the middle of the method
Updated tests to work with updated code