Skip to content

Commit

Permalink
Show warning when score < 90
Browse files Browse the repository at this point in the history
  • Loading branch information
frafra committed Mar 6, 2024
1 parent eef982d commit e5db4fe
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
put_progressbar,
put_success,
put_table,
put_warning,
set_progressbar,
use_scope,
)
Expand Down Expand Up @@ -92,7 +93,7 @@ def get_species_data(species):
specie_ids = []
for index, specie in enumerate(species):
result = response[str(index)]["result"][0]
specie_ids.append((result["id"], "%d %%" % result["score"]))
specie_ids.append((result["id"], result["score"]))
data = {
"extend": json.dumps(
{
Expand Down Expand Up @@ -156,6 +157,16 @@ def generate_table(text):
"Mer enn %d ligner: tabellen er for stor til å vises." % PREVIEW_SIZE,
]
put_success(*message)
worse_score = min(row["Score"] for row in table)
if worse_score < 90:
put_warning(
(
"Linjer med lav Score har blitt oppdaget. "
"Kontroller verdien i Score-kolonnen. "
"Verdiene går fra 0 til 100, der 100 er en perfekt match. "
"Det anbefales å sjekke linjer med poengsum under 90."
)
)
if table_preview:
put_table(
table,
Expand Down

0 comments on commit e5db4fe

Please sign in to comment.