From 09af326b03d0f6d45be0419841ed97884fbbb06b Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 21 Aug 2021 17:37:38 +0200 Subject: [PATCH] Fix sur fonctions statistiques --- app/scodoc/notes_table.py | 11 +++++++---- app/scodoc/sco_report.py | 5 ++++- app/scodoc/sco_synchro_etuds.py | 2 -- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/scodoc/notes_table.py b/app/scodoc/notes_table.py index 99b4d778..3f015524 100644 --- a/app/scodoc/notes_table.py +++ b/app/scodoc/notes_table.py @@ -27,9 +27,10 @@ """Calculs sur les notes et cache des resultats """ -import time -import pdb import inspect +import os +import pdb +import time from operator import itemgetter from flask import g, url_for @@ -172,7 +173,7 @@ class NotesTable(object): """ def __init__(self, formsemestre_id): - log("NotesTable( formsemestre_id=%s )" % formsemestre_id) + log(f"[pid={os.getpid()}] NotesTable( formsemestre_id={formsemestre_id} )") if not formsemestre_id: raise ValueError("invalid formsemestre_id (%s)" % formsemestre_id) self.formsemestre_id = formsemestre_id @@ -356,7 +357,9 @@ class NotesTable(object): # self.compute_moy_moy() # - log("NotesTable( formsemestre_id=%s ) done." % formsemestre_id) + log( + f"[pid={os.getpid()}] NotesTable( formsemestre_id={formsemestre_id} ) done." + ) def get_etudids(self, sorted=False): if sorted: diff --git a/app/scodoc/sco_report.py b/app/scodoc/sco_report.py index f386a608..b0a02ab7 100644 --- a/app/scodoc/sco_report.py +++ b/app/scodoc/sco_report.py @@ -696,6 +696,7 @@ def formsemestre_suivi_cohorte( REQUEST=None, ): """Affiche suivi cohortes par numero de semestre""" + annee_bac = str(annee_bac) percent = int(percent) ( tab, @@ -798,7 +799,8 @@ def _gen_form_selectetuds( bacs.sort() bacspecialites = list(bacspecialites) bacspecialites.sort() - annee_bacs = list(annee_bacs) + # on peut avoir un mix de chaines vides et d'entiers: + annee_bacs = [int(x) if x else 0 for x in annee_bacs] annee_bacs.sort() civilites = list(civilites) civilites.sort() @@ -1467,6 +1469,7 @@ def formsemestre_graph_parcours( REQUEST=None, ): """Graphe suivi cohortes""" + annee_bac = str(annee_bac) # log("formsemestre_graph_parcours") sem = sco_formsemestre.get_formsemestre(formsemestre_id) if format == "pdf": diff --git a/app/scodoc/sco_synchro_etuds.py b/app/scodoc/sco_synchro_etuds.py index c9d0bb4a..ee84ec57 100644 --- a/app/scodoc/sco_synchro_etuds.py +++ b/app/scodoc/sco_synchro_etuds.py @@ -133,7 +133,6 @@ def formsemestre_synchro_etuds( inscrits_without_key_all, etudsapo_ident, ) = list_synch(sem, anneeapogee=anneeapogee) - breakpoint() if export_cat_xls: filename = export_cat_xls xls = build_page( @@ -156,7 +155,6 @@ def formsemestre_synchro_etuds( read_only=read_only, ) else: - breakpoint() etuds_set = set(etuds) a_importer = a_importer.intersection(etuds_set) a_desinscrire = inscrits_set - etuds_set