Skip to content

Commit

Permalink
add number of unique "no parent" link to dashboard (#337)
Browse files Browse the repository at this point in the history
Co-authored-by: Anita Caron <[email protected]>
  • Loading branch information
Anita Caron and anitacaron authored Sep 3, 2024
1 parent 3a7a0b0 commit 2747819
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dashboard_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def add_color(report, report_type):
report.at[row.Index, "percent_invalid_CT-CT_relationship"] = check_number_n_get_color(row._5)
report.at[row.Index, "percent_invalid_CT-AS_relationship"] = check_number_n_get_color(row._7)
report.at[row.Index, "number_of_no_parent_relationships"] = check_number_n_get_color(row.number_of_no_parent_relationships)
report.at[row.Index, "unique_no_parent_relationships"] = check_number_n_get_color(int(row.unique_no_parent_relationships))

return report

Expand Down Expand Up @@ -92,7 +93,8 @@ def get_reports(date):
"percent_invalid_CT-CT_relationship": "% INVALID CT-CT RELATIONS",
"number_of_CT-AS_relationships": "# CT-AS RELATIONS",
"percent_invalid_CT-AS_relationship": "% INVALID CT-AS RELATIONS",
"number_of_no_parent_relationships": "# CASES NO PARENT LINK TO CL"
"number_of_no_parent_relationships": "# CASES NO PARENT LINK TO CL",
"unique_no_parent_relationships": "# UNIQUE NO PARENT LINK TO CL"
}, inplace=True)
rel_report = add_link(rel_report)
rel_report_md = tsv2md(rel_report)
Expand Down
2 changes: 2 additions & 0 deletions src/template_generation_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def generate_class_graph_template(ccf_tools_df :pd.DataFrame, log_dict: dict):
'number_of_CT-AS_relationships': [0],
'percent_invalid_CT-AS_relationship': [0],
'number_of_no_parent_relationships': [len(log_dict["no_parent"])],
'unique_no_parent_relationships': [len(set([elem["user_label"] for elem in log_dict["no_parent"]]))],
}
seed = {'ID': 'ID', 'Label': 'LABEL', 'User_label': 'A skos:prefLabel',
'isa': 'SC %',
Expand Down Expand Up @@ -385,6 +386,7 @@ def generate_class_graph_template(ccf_tools_df :pd.DataFrame, log_dict: dict):
'number_of_CT-AS_relationships': [terms_ct_as_start],
'percent_invalid_CT-AS_relationship': [perc_inv_ct_as],
'number_of_no_parent_relationships': [len(log_dict["no_parent"])],
'unique_no_parent_relationships': [len(set([elem["user_label"] for elem in log_dict["no_parent"]]))],
}

# ANNOTATION
Expand Down

0 comments on commit 2747819

Please sign in to comment.