1
0
forked from ScoDoc/ScoDoc

Fix: calcul moyenne classiques sur vides

This commit is contained in:
Emmanuel Viennet 2023-09-14 14:34:18 +02:00
parent 80c03f022b
commit 20d2e644bc

View File

@ -344,8 +344,12 @@ def compute_ue_moys_classic(
pd.Series(
[val] * len(modimpl_inscr_df.index), index=modimpl_inscr_df.index
),
pd.DataFrame(columns=[ue.id for ue in ues], index=modimpl_inscr_df.index),
pd.DataFrame(columns=[ue.id for ue in ues], index=modimpl_inscr_df.index),
pd.DataFrame(
columns=[ue.id for ue in ues], index=modimpl_inscr_df.index, dtype=float
),
pd.DataFrame(
columns=[ue.id for ue in ues], index=modimpl_inscr_df.index, dtype=float
),
)
# Restreint aux modules sélectionnés:
sem_matrix = sem_matrix[:, modimpl_mask]
@ -400,6 +404,7 @@ def compute_ue_moys_classic(
},
index=modimpl_inscr_df.index,
columns=[ue.id for ue in ues],
dtype=float,
)
# remplace NaN par zéros dans les moyennes d'UE
etud_moy_ue_df_no_nan = etud_moy_ue_df.fillna(0.0, inplace=False)
@ -415,6 +420,7 @@ def compute_ue_moys_classic(
coefs.sum(axis=2).T,
index=modimpl_inscr_df.index, # etudids
columns=[ue.id for ue in ues],
dtype=float,
)
with np.errstate(invalid="ignore"): # ignore les 0/0 (-> NaN)
etud_moy_gen = np.sum(