-
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
[WIP] Clean orphan elements script #1
base: main
Are you sure you want to change the base?
Conversation
…for now Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier@rte-france.com>
print("Getting existing networks from existing studies") | ||
get_studies_response = requests.get(constant.GET_STUDIES) | ||
|
||
get_studies_response_json = get_studies_response.json() |
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.
Use a form more concise and more readable ?
existing_networks_uuid = [study["networkUuid"] for study in get_studies_response.json()]
print("Getting networks from network store server") | ||
get_networks_response = requests.get(constant.GET_NETWORKS) | ||
|
||
get_networks_response_json = get_networks_response.json() |
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.
Use a form more concise and more readable ?
all_networks_uuid = [network["uuid"] for network in get_networks_response.json()]
|
||
get_studies_response_json = get_studies_response.json() | ||
get_studies_response_json_network_uuid = map(get_network_uuid_from_study, get_studies_response_json) | ||
existing_networks_uuid = list(get_studies_response_json_network_uuid) |
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.
existing_networks_uuids ?
|
||
get_networks_response_json = get_networks_response.json() | ||
get_networks_response_json_uuid = map(get_network_uuid_from_network, get_networks_response_json) | ||
all_networks_uuid = list(get_networks_response_json_uuid) |
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.
all_networks_uuids ?
print("Done") | ||
# GET NETWORKS SAVED IN NETWORK STORE SERVER | ||
print("Getting networks from network store server") | ||
get_networks_response = requests.get(constant.GET_NETWORKS) |
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.
Add this to deal with errors
if not get_studies_response.ok:
get_studies_response.raise_for_status()
I think we need a logger to log infos in a file to analyze the logs and detect possible bugs |
@@ -0,0 +1,26 @@ | |||
import argparse |
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.
Add new package clean_computation_results
Code duplication: the three functions are almost identical and differ only by the type of elements |
Quality Gate failedFailed conditions |
No description provided.