check_moduleimpl_conformity: modif exc incohérence

This commit is contained in:
Emmanuel Viennet 2022-01-04 19:46:35 +01:00
parent e1adf93bf0
commit e3535aa4da

View File

@ -36,6 +36,7 @@ import pandas as pd
from pandas.core.frame import DataFrame
from app import db
from app import log
from app import models
from app.models import ModuleImpl, Evaluation, EvaluationUEPoids
from app.scodoc import sco_utils as scu
@ -79,7 +80,11 @@ def check_moduleimpl_conformity(
if nb_ues == 0:
return False # situation absurde (pas d'UE)
if len(modules_coefficients) != nb_ues:
raise ValueError("check_moduleimpl_conformity: nb ue incoherent")
# bug ?
log(
"check_moduleimpl_conformity: nb ue incoherent (moduleimpl.id={moduleimpl.id})"
)
return False
module_evals_poids = evals_poids.transpose().sum(axis=1).to_numpy() != 0
check = all(
(modules_coefficients[moduleimpl.module.id].to_numpy() != 0)