Skip to content

Commit

Permalink
fix: type td_tag.text to float
Browse files Browse the repository at this point in the history
  • Loading branch information
Wazzabeee committed Apr 26, 2024
1 parent 0439f0e commit db7c75a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions scripts/html_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def writing_results(dir_name: str) -> str:
def get_color_from_similarity(similarity_score: float) -> str:
"""Return css style according to similarity score"""

if float(similarity_score) > 15:
if similarity_score > 15:
return "#990033; font-weight: bold"
if float(similarity_score) > 10:
if similarity_score > 10:
return "#ff6600"
if float(similarity_score) > 5:
if similarity_score > 5:
return "#ffcc00"

return "green"
2 changes: 1 addition & 1 deletion scripts/html_writing.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def add_links_to_html_table(html_path: str) -> None:
"a",
href="file:///" + html_path.replace("_results", str(file_ind)),
target="_blank",
style="color:" + get_color_from_similarity(td_tag.text),
style="color:" + get_color_from_similarity(float(td_tag.text)),
)

td_tag.string.wrap(tmp) # We wrap the td string between the hyperlink
Expand Down

0 comments on commit db7c75a

Please sign in to comment.