1
0
forked from ScoDoc/ScoDoc

Calcul moyenne générale indicative

This commit is contained in:
Emmanuel Viennet 2021-12-11 12:10:05 +01:00
parent 46d9316984
commit 5c2c97cfb3

View File

@ -11,7 +11,7 @@ import pandas as pd
from app import db
from app.comp import df_cache, moy_ue, moy_mod, inscr_mod
from app.comp import df_cache, moy_ue, moy_sem, inscr_mod
from app.scodoc import sco_utils as scu
from app.scodoc.sco_cache import ResultatsSemestreBUTCache
from app.scodoc.sco_exceptions import ScoFormatError
@ -90,6 +90,9 @@ class ResultatsSemestreBUT:
self.modimpl_inscr_df,
self.modimpl_coefs_df,
)
self.etud_moy_gen = moy_sem.compute_sem_moys(
self.etud_moy_ue, self.modimpl_coefs_df
)
def etud_ue_mod_results(self, etud, ue, modimpls) -> dict:
"dict synthèse résultats dans l'UE pour les modules indiqués"
@ -212,10 +215,10 @@ class ResultatsSemestreBUT:
"ues": {ue.acronyme: self.etud_ue_results(etud, ue) for ue in self.ues},
"semestre": {
"notes": { # moyenne des moyennes générales du semestre
"value": fmt_note("xxx"), # XXX TODO
"min": fmt_note("0."),
"moy": fmt_note("10.0"),
"max": fmt_note("20.00"),
"value": fmt_note(self.etud_moy_gen[etud.id]),
"min": fmt_note(self.etud_moy_gen.min()),
"moy": fmt_note(self.etud_moy_gen.mean()),
"max": fmt_note(self.etud_moy_gen.max()),
},
"rang": { # classement wrt moyenne général, indicatif
"value": None, # XXX TODO