diff --git a/app/comp/moy_ue.py b/app/comp/moy_ue.py index 5d6e27b4ec..30d8466b4d 100644 --- a/app/comp/moy_ue.py +++ b/app/comp/moy_ue.py @@ -30,6 +30,7 @@ import numpy as np import pandas as pd +import app from app import db from app import models from app.models import ( @@ -167,8 +168,14 @@ def notes_sem_assemble_cube(modimpls_notes: list[pd.DataFrame]) -> np.ndarray: """ assert len(modimpls_notes) modimpls_notes_arr = [df.values for df in modimpls_notes] - modimpls_notes = np.stack(modimpls_notes_arr) - # passe de (mod x etud x ue) à (etud x mod x ue) + try: + modimpls_notes = np.stack(modimpls_notes_arr) + # passe de (mod x etud x ue) à (etud x mod x ue) + except ValueError: + app.critical_error( + f"""notes_sem_assemble_cube: shapes { + ", ".join([x.shape for x in modimpls_notes_arr])}""" + ) return modimpls_notes.swapaxes(0, 1)