Feat: add handling ppre

This commit is contained in:
Bertrand Benjamin 2021-04-18 09:57:53 +02:00
parent a0e94f52b1
commit 8f2ae96338
2 changed files with 4 additions and 7 deletions

View File

@ -192,7 +192,7 @@ def update_final_scores(data):
scores = pd.DataFrame.from_records(data) scores = pd.DataFrame.from_records(data)
try: try:
if scores.iloc[0]["Commentaire"] == "commentaire": if scores.iloc[0]["Commentaire"] == "commentaire" or scores.iloc[0].str.contains("PPRE").any():
scores.drop([0], inplace=True) scores.drop([0], inplace=True)
except KeyError: except KeyError:
pass pass
@ -280,7 +280,7 @@ def update_final_scores_hist(data):
def update_competence_fig(data): def update_competence_fig(data):
scores = pd.DataFrame.from_records(data) scores = pd.DataFrame.from_records(data)
try: try:
if scores.iloc[0]["Commentaire"] == "commentaire": if scores.iloc[0]["Commentaire"] == "commentaire" or scores.iloc[0].str.contains("PPRE").any():
scores.drop([0], inplace=True) scores.drop([0], inplace=True)
except KeyError: except KeyError:
pass pass

View File

@ -191,11 +191,8 @@ def update_student_scores(tribe, student, term):
except pd.errors.ParserError: except pd.errors.ParserError:
pass pass
else: else:
try: if scores.iloc[0]["Commentaire"] == "commentaire" or scores.iloc[0].str.contains("PPRE").any():
if scores.iloc[0]["Commentaire"] == "commentaire": scores.drop([0], inplace=True)
scores.drop([0], inplace=True)
except KeyError:
pass
scores = flat_df_students(scores).dropna(subset=["Score"]) scores = flat_df_students(scores).dropna(subset=["Score"])
scores = scores[scores["Eleve"] == student] scores = scores[scores["Eleve"] == student]
scores = scores[scores["Trimestre"] == term] scores = scores[scores["Trimestre"] == term]