diff --git a/app/pe/pe_jurype.py b/app/pe/pe_jurype.py index 627dc68a..0d183165 100644 --- a/app/pe/pe_jurype.py +++ b/app/pe/pe_jurype.py @@ -156,7 +156,9 @@ class JuryPE(object): """Génère les aggrégats de semestre (par ex: 1A, 3S, 5S) avec calcul des moyennes pour le jury""" - self.aggregats_taggues = compute_aggregats_tag(self.etudiants, self.semestres_taggues) + self.aggregats_taggues = compute_aggregats_tag( + self.etudiants, self.semestres_taggues + ) if pe_tools.PE_DEBUG: """Intègre le bilan des aggrégats de semestres au zip final""" @@ -170,7 +172,16 @@ class JuryPE(object): ) """Génère les interclassements par (nom d') aggrégat""" - + self.aggregats_taggues_interclasses = compute_interclassements( + self.etudiants, # + self.aggregats_taggues, + ) + # Les interclassements + # -------------------- + if pe_tools.PE_DEBUG: + pe_tools.pe_print( + "*** Création des interclassements au sein de la promo sur différentes combinaisons de semestres" + ) """Synthèse des éléments du jury PE""" if False: @@ -193,15 +204,6 @@ class JuryPE(object): # Pour debug # self.syntheseJury = pe_tools.JURY_SYNTHESE_POUR_DEBUG #Un dictionnaire fictif pour debug - # Les interclassements - # -------------------- - if pe_tools.PE_DEBUG: - pe_tools.pe_print( - "*** Création des interclassements au sein de la promo sur différentes combinaisons de semestres" - ) - if False: - self.get_promotags_in_jury() - def add_file_to_zip(self, filename: str, data, path=""): """Add a file to our zip All files under NOM_EXPORT_ZIP/ @@ -229,42 +231,6 @@ class JuryPE(object): # Traitements des semestres impliqués dans le jury # **************************************************************************************************************** # - # **************************************************************************************************************** # - # Traitements des moyennes sur différentes combinaisons de parcours 1A, 2A, 3S et 4S, - # impliquées dans le jury - # **************************************************************************************************************** # - - def get_promotags_in_jury(self): - """Interclasse les étudiants, (nom d') aggrégat par aggrégat, - pour fournir un classement sur la promo. - """ - - lesEtudids = self.etudiants.get_etudids(self.diplome) - - for i, nom in enumerate(pe_tools.PARCOURS.keys()): - settag = app.pe.pe_settag_interclasse.SetTagInterClasse( - nom, diplome=self.diplome - ) - nbreEtudInscrits = settag.set_Etudiants( - lesEtudids, self.etudiants.cursus, self.etudiants.identites - ) - if nbreEtudInscrits > 0: - if pe_tools.PE_DEBUG: - pe_tools.pe_print( - "%d) %s avec interclassement sur la promo" % (i + 1, nom) - ) - if nom in pe_tools.TOUS_LES_SEMESTRES: - settag.set_SetTagDict(self.semestres_taggues) - else: # cas des aggrégats - settag.set_SetTagDict(self.aggregats_taggues[nom]) - settag.comp_data_settag() - self.promoTagDict[nom] = settag - else: - pe_tools.pe_print( - "%d) Pas d'interclassement %s sur la promo faute de notes" - % (i + 1, nom) - ) - # **************************************************************************************************************** # # Méthodes pour la synthèse du juryPE # ***************************************************************************************************************** @@ -720,9 +686,9 @@ def compute_aggregats_tag(etudiants: EtudiantsJuryPE, semestres_tag: dict[Semest sets_tags[aggregat] = {} """Semestres aggrégés""" - if aggregat in pe_tools.TOUS_LES_SEMESTRES: # par ex. 'S2' - noms_semestres_aggreges = [ aggregat ] - else: # par ex. "5S" + if aggregat in pe_tools.TOUS_LES_SEMESTRES: # par ex. 'S2' + noms_semestres_aggreges = [aggregat] + else: # par ex. "5S" noms_semestres_aggreges = pe_tools.PARCOURS[aggregat]["aggregat"] nom_semestre_terminal = noms_semestres_aggreges[-1] @@ -761,3 +727,34 @@ def compute_aggregats_tag(etudiants: EtudiantsJuryPE, semestres_tag: dict[Semest sets_tags[aggregat][fid] = settag # Mémorise le résultat return sets_tags + + +def compute_interclassements( + etudiants: EtudiantsJuryPE, aggregats_taggues: dict[str, dict] +): + """Interclasse les étudiants, (nom d') aggrégat par aggrégat, + pour fournir un classement sur la promo. Le classement est établit au regard du nombre + d'étudiants ayant participé au même aggrégat. + """ + etudiants_diplomes = etudiants.get_etudiants_diplomes() + + """ + for i, nom in enumerate(pe_tools.PARCOURS.keys()): + settag = app.pe.pe_settag_interclasse.SetTagInterClasse(nom, diplome=diplome) + nbreEtudInscrits = settag.set_Etudiants( + lesEtudids, self.etudiants.cursus, self.etudiants.identites + ) + if nbreEtudInscrits > 0: + pe_tools.pe_print("%d) %s avec interclassement sur la promo" % (i + 1, nom)) + if nom in pe_tools.TOUS_LES_SEMESTRES: + settag.set_SetTagDict(self.semestres_taggues) + else: # cas des aggrégats + settag.set_SetTagDict(self.aggregats_taggues[nom]) + settag.comp_data_settag() + self.promoTagDict[nom] = settag + else: + pe_tools.pe_print( + "%d) Pas d'interclassement %s sur la promo faute de notes" + % (i + 1, nom) + ) + """ \ No newline at end of file diff --git a/app/pe/pe_settag_interclasse.py b/app/pe/pe_settag_interclasse.py index c3e6ad0f..933383c3 100644 --- a/app/pe/pe_settag_interclasse.py +++ b/app/pe/pe_settag_interclasse.py @@ -1,19 +1,22 @@ from app.pe import pe_tagtable from app.pe.pe_tools import PE_DEBUG, pe_print +import app.pe.pe_etudiant as pe_etudiant class SetTagInterClasse(pe_tagtable.TableTag): - """Récupère les moyennes de SetTag aggrégeant un même parcours (par ex un ['S1', 'S2'] - n'ayant pas fini au même S2 - pour fournir un interclassement sur un groupe d'étudiant => seul compte alors la promo - nom_combinaison = 'S1' ou '1A' + """Interclasse les étudiants d'une promo (ceux diplômé) par aggrégat de même nom + (par ex: un "3S"), pour stocker leur moyenne et fournir un classement de "promo". + + Les """ # ------------------------------------------------------------------------------------------------------------------- - def __init__(self, nom_combinaison, diplome): - pe_tagtable.TableTag.__init__(self, nom=f"{nom_combinaison}_{diplome or ''}") - self.combinaison = nom_combinaison - self.parcoursDict = {} + def __init__(self, nom:str, etudiants: EtudiantsJuryPE, aggregats_taggues: dict[str, dict]): + """""" + pe_tagtable.TableTag.__init__(self, nom) + self.etudiants = etudiants + self.aggregats_taggues = aggregats_taggues # Les moyennes par aggrégats + # ------------------------------------------------------------------------------------------- def set_Etudiants(self, etudiants, juryPEDict, etudInfoDict, nom_sem_final=None):