Commit ·
657a409
1
Parent(s): fd738e7
feat(app): avertir quand les entrées sortent des plages d'entraînement
Browse files- config.py : TRAINING_RANGES (min/max du CSV : température 16-37,8 °C,
humidité 50-95 %, vent 2-20 km/h, conso 400-1400 MW) et
CONSO_RANGE_BY_PEAK (900-1400 MW en pointe, 400-900 MW hors pointe,
sans recouvrement dans le CSV)
- utils_simple.check_training_range() liste les entrées hors plage
- app.py : avertissement « hors plage d'entraînement » dans la barre
latérale, sur la prédiction et sur la carte ; aide des sliders avec
la plage d'entraînement. Les sliders ne sont pas bloqués
- Tests : plages comparées au CSV (couverture et marge < 0,5),
détection hors plage et incohérence conso/heure de pointe
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CHANGELOG.md +3 -0
- CLAUDE.md +2 -0
- src/config.py +16 -0
- streamlit_app/app.py +22 -5
- streamlit_app/utils_simple.py +24 -1
- tests/test_training_range.py +73 -0
CHANGELOG.md
CHANGED
|
@@ -13,6 +13,9 @@ Tous les changements notables de ce projet seront documentés dans ce fichier.
|
|
| 13 |
- **Inférence réalignée sur le CSV d'entraînement** : `saison` binaire (juin-août) et `is_peak_hour` 18h-22h. La « correction » 1.1.0 ci-dessous avait aligné l'app sur `data_generator.py` sans réentraîner, ce qui faussait les prédictions (ex. 22h ≈ 0 % au lieu d'environ 43 %). Tests réécrits pour comparer l'encodage aux valeurs du CSV
|
| 14 |
- **Risque affiché = vraie probabilité** : suppression du « ×2 » et du plancher de 5 % ; coefficient de quartier appliqué avant le plafonnement ; seuils redéfinis à 15 % / 35 % sur la distribution du jeu de test (au lieu de 40 % / 70 %) ; un échec de LightGBM n'affiche plus un 50 % fictif
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
## [1.1.0] - 2026-06-17
|
| 17 |
|
| 18 |
### Corrigé
|
|
|
|
| 13 |
- **Inférence réalignée sur le CSV d'entraînement** : `saison` binaire (juin-août) et `is_peak_hour` 18h-22h. La « correction » 1.1.0 ci-dessous avait aligné l'app sur `data_generator.py` sans réentraîner, ce qui faussait les prédictions (ex. 22h ≈ 0 % au lieu d'environ 43 %). Tests réécrits pour comparer l'encodage aux valeurs du CSV
|
| 14 |
- **Risque affiché = vraie probabilité** : suppression du « ×2 » et du plancher de 5 % ; coefficient de quartier appliqué avant le plafonnement ; seuils redéfinis à 15 % / 35 % sur la distribution du jeu de test (au lieu de 40 % / 70 %) ; un échec de LightGBM n'affiche plus un 50 % fictif
|
| 15 |
|
| 16 |
+
### Ajouté
|
| 17 |
+
- Avertissement « hors plage d'entraînement » (barre latérale, prédiction, carte) quand une entrée sort des plages du CSV, y compris une consommation incohérente avec l'heure de pointe (ex. 800 MW à 19h, valeur par défaut) ; les sliders ne sont pas bloqués
|
| 18 |
+
|
| 19 |
## [1.1.0] - 2026-06-17
|
| 20 |
|
| 21 |
### Corrigé
|
CLAUDE.md
CHANGED
|
@@ -65,6 +65,8 @@ The LSTM expects shape `(1, 1, 9)` — single sample, single timestep, 9 feature
|
|
| 65 |
|
| 66 |
## Key Constraints
|
| 67 |
|
|
|
|
|
|
|
| 68 |
- Models must be loaded from the project root (paths like `'models/lgbm_model.pkl'`). Always run the app from the repo root.
|
| 69 |
- LSTM is loaded with `compile=False` then recompiled manually to avoid Keras serialization compatibility issues.
|
| 70 |
- The app degrades gracefully: if LSTM fails to load, LightGBM prediction is used for both model slots.
|
|
|
|
| 65 |
|
| 66 |
## Key Constraints
|
| 67 |
|
| 68 |
+
- `TRAINING_RANGES` / `CONSO_RANGE_BY_PEAK` in `src/config.py` mirror the CSV min/max (checked by `tests/test_training_range.py`). Sliders stay wider on purpose: out-of-range inputs trigger a warning (`check_training_range()`), not a block.
|
| 69 |
+
|
| 70 |
- Models must be loaded from the project root (paths like `'models/lgbm_model.pkl'`). Always run the app from the repo root.
|
| 71 |
- LSTM is loaded with `compile=False` then recompiled manually to avoid Keras serialization compatibility issues.
|
| 72 |
- The app degrades gracefully: if LSTM fails to load, LightGBM prediction is used for both model slots.
|
src/config.py
CHANGED
|
@@ -79,6 +79,22 @@ SLIDER_CONFIG = {
|
|
| 79 |
'consommation': {'min': 400.0, 'max': 1500.0, 'default': 800.0, 'step': 10.0},
|
| 80 |
}
|
| 81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
# ============================================================================
|
| 83 |
# CONFIGURATION MODÈLES ML
|
| 84 |
# ============================================================================
|
|
|
|
| 79 |
'consommation': {'min': 400.0, 'max': 1500.0, 'default': 800.0, 'step': 10.0},
|
| 80 |
}
|
| 81 |
|
| 82 |
+
# Plages observées dans synthetic_data_v2.csv (min / max arrondis vers l'extérieur).
|
| 83 |
+
# Les sliders restent plus larges ; hors de ces plages, le modèle extrapole et
|
| 84 |
+
# l'app affiche un avertissement « hors plage d'entraînement » (sans bloquer).
|
| 85 |
+
TRAINING_RANGES = {
|
| 86 |
+
'temperature': (16.0, 37.8),
|
| 87 |
+
'humidite': (50.0, 95.0),
|
| 88 |
+
'vitesse_vent': (2.0, 20.0),
|
| 89 |
+
'consommation': (400.0, 1400.0),
|
| 90 |
+
}
|
| 91 |
+
# Dans le CSV, la consommation dépend de l'heure de pointe (18h-22h) :
|
| 92 |
+
# >= 900 MW en pointe, < 900 MW hors pointe, sans aucun recouvrement.
|
| 93 |
+
CONSO_RANGE_BY_PEAK = {
|
| 94 |
+
1: (900.0, 1400.0),
|
| 95 |
+
0: (400.0, 900.0),
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
# ============================================================================
|
| 99 |
# CONFIGURATION MODÈLES ML
|
| 100 |
# ============================================================================
|
streamlit_app/app.py
CHANGED
|
@@ -22,8 +22,9 @@ from streamlit_app.utils_simple import (
|
|
| 22 |
create_bar_chart_quartiers,
|
| 23 |
create_temporal_chart,
|
| 24 |
create_risk_trend_chart,
|
|
|
|
| 25 |
)
|
| 26 |
-
from src.config import QUARTIERS_DAKAR, classify_risk, RISK_THRESHOLDS, SLIDER_CONFIG
|
| 27 |
from src.weather_api import get_current_weather_dakar, get_weather_forecast_7days
|
| 28 |
|
| 29 |
st.set_page_config(page_title="Dakar Power", page_icon="⚡", layout="wide")
|
|
@@ -70,10 +71,13 @@ if 'wx_time' in st.session_state:
|
|
| 70 |
st.sidebar.caption(f"⏱️ Météo Open-Meteo relevée à {st.session_state['wx_time']} (seule donnée réelle de l'app)")
|
| 71 |
|
| 72 |
_sc = SLIDER_CONFIG
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
| 77 |
heure_pred = st.sidebar.slider(
|
| 78 |
"🕐 Heure de prédiction", 0, 23,
|
| 79 |
datetime.now().hour, 1,
|
|
@@ -82,6 +86,15 @@ heure_pred = st.sidebar.slider(
|
|
| 82 |
)
|
| 83 |
quartier = st.sidebar.selectbox("Quartier", QUARTIERS_DAKAR, index=0)
|
| 84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
if st.sidebar.button("🔮 Lancer la Prédiction", type="primary", use_container_width=True):
|
| 86 |
st.session_state['run'] = True
|
| 87 |
st.session_state['params'] = {
|
|
@@ -126,6 +139,8 @@ with tab1:
|
|
| 126 |
if st.session_state.get('run', False):
|
| 127 |
params = st.session_state['params']
|
| 128 |
time_features = create_time_features(params['timestamp'], hour_override=heure_pred)
|
|
|
|
|
|
|
| 129 |
result = make_prediction_single(models, params['quartier'], params['temperature'], params['humidite'], params['vitesse_vent'], params['consommation'], time_features)
|
| 130 |
|
| 131 |
if result:
|
|
@@ -180,6 +195,8 @@ with tab2:
|
|
| 180 |
|
| 181 |
time_features_map = create_time_features(datetime.now(), hour_override=heure_pred)
|
| 182 |
results = compute_map_risks(models, temperature, humidite, vitesse_vent, consommation, time_features_map)
|
|
|
|
|
|
|
| 183 |
if results is None:
|
| 184 |
st.error("Modèles non chargés — impossible de calculer la carte.")
|
| 185 |
else:
|
|
|
|
| 22 |
create_bar_chart_quartiers,
|
| 23 |
create_temporal_chart,
|
| 24 |
create_risk_trend_chart,
|
| 25 |
+
check_training_range,
|
| 26 |
)
|
| 27 |
+
from src.config import QUARTIERS_DAKAR, classify_risk, RISK_THRESHOLDS, SLIDER_CONFIG, TRAINING_RANGES
|
| 28 |
from src.weather_api import get_current_weather_dakar, get_weather_forecast_7days
|
| 29 |
|
| 30 |
st.set_page_config(page_title="Dakar Power", page_icon="⚡", layout="wide")
|
|
|
|
| 71 |
st.sidebar.caption(f"⏱️ Météo Open-Meteo relevée à {st.session_state['wx_time']} (seule donnée réelle de l'app)")
|
| 72 |
|
| 73 |
_sc = SLIDER_CONFIG
|
| 74 |
+
_tr = TRAINING_RANGES
|
| 75 |
+
def _range_help(key, unit):
|
| 76 |
+
return f"Plage vue à l'entraînement : {_tr[key][0]:g}-{_tr[key][1]:g} {unit}. Au-delà, le modèle extrapole."
|
| 77 |
+
temperature = st.sidebar.slider("Température (°C)", _sc['temperature']['min'], _sc['temperature']['max'], _sc['temperature']['default'], _sc['temperature']['step'], key='s_temp', help=_range_help('temperature', '°C'))
|
| 78 |
+
humidite = st.sidebar.slider("Humidité (%)", _sc['humidite']['min'], _sc['humidite']['max'], _sc['humidite']['default'], _sc['humidite']['step'], key='s_hum', help=_range_help('humidite', '%'))
|
| 79 |
+
vitesse_vent = st.sidebar.slider("Vent (km/h)", _sc['vitesse_vent']['min'], _sc['vitesse_vent']['max'], _sc['vitesse_vent']['default'], _sc['vitesse_vent']['step'], key='s_wind', help=_range_help('vitesse_vent', 'km/h'))
|
| 80 |
+
consommation = st.sidebar.slider("Consommation (MW)", _sc['consommation']['min'], _sc['consommation']['max'], _sc['consommation']['default'], _sc['consommation']['step'], help=_range_help('consommation', 'MW') + " En pointe (18h-22h) : 900-1400 MW ; hors pointe : 400-900 MW.")
|
| 81 |
heure_pred = st.sidebar.slider(
|
| 82 |
"🕐 Heure de prédiction", 0, 23,
|
| 83 |
datetime.now().hour, 1,
|
|
|
|
| 86 |
)
|
| 87 |
quartier = st.sidebar.selectbox("Quartier", QUARTIERS_DAKAR, index=0)
|
| 88 |
|
| 89 |
+
def _warn_hors_plage(messages, consequence):
|
| 90 |
+
if messages:
|
| 91 |
+
details = "\n".join(f"- {m}" for m in messages)
|
| 92 |
+
st.warning(f"⚠️ **Hors plage d'entraînement** — {consequence} :\n\n{details}")
|
| 93 |
+
|
| 94 |
+
_is_peak_now = create_time_features(datetime.now(), hour_override=heure_pred)['is_peak_hour']
|
| 95 |
+
for _msg in check_training_range(temperature, humidite, vitesse_vent, consommation, _is_peak_now):
|
| 96 |
+
st.sidebar.warning(f"⚠️ {_msg}")
|
| 97 |
+
|
| 98 |
if st.sidebar.button("🔮 Lancer la Prédiction", type="primary", use_container_width=True):
|
| 99 |
st.session_state['run'] = True
|
| 100 |
st.session_state['params'] = {
|
|
|
|
| 139 |
if st.session_state.get('run', False):
|
| 140 |
params = st.session_state['params']
|
| 141 |
time_features = create_time_features(params['timestamp'], hour_override=heure_pred)
|
| 142 |
+
_hors_plage = check_training_range(params['temperature'], params['humidite'], params['vitesse_vent'], params['consommation'], time_features['is_peak_hour'])
|
| 143 |
+
_warn_hors_plage(_hors_plage, "le modèle extrapole, résultat peu fiable")
|
| 144 |
result = make_prediction_single(models, params['quartier'], params['temperature'], params['humidite'], params['vitesse_vent'], params['consommation'], time_features)
|
| 145 |
|
| 146 |
if result:
|
|
|
|
| 195 |
|
| 196 |
time_features_map = create_time_features(datetime.now(), hour_override=heure_pred)
|
| 197 |
results = compute_map_risks(models, temperature, humidite, vitesse_vent, consommation, time_features_map)
|
| 198 |
+
_hors_plage_map = check_training_range(temperature, humidite, vitesse_vent, consommation, time_features_map['is_peak_hour'])
|
| 199 |
+
_warn_hors_plage(_hors_plage_map, "carte peu fiable")
|
| 200 |
if results is None:
|
| 201 |
st.error("Modèles non chargés — impossible de calculer la carte.")
|
| 202 |
else:
|
streamlit_app/utils_simple.py
CHANGED
|
@@ -22,7 +22,7 @@ warnings.filterwarnings('ignore', category=UserWarning, module='keras')
|
|
| 22 |
warnings.filterwarnings('ignore', category=UserWarning, module='lightgbm')
|
| 23 |
|
| 24 |
from src.config import (QUARTIERS_DAKAR, COORDONNEES_QUARTIERS, QUARTIER_ADJUSTMENT,
|
| 25 |
-
classify_risk, RISK_THRESHOLDS)
|
| 26 |
|
| 27 |
logger = logging.getLogger(__name__)
|
| 28 |
|
|
@@ -73,6 +73,29 @@ def create_time_features(date_time: datetime, hour_override: int = None) -> dict
|
|
| 73 |
'is_peak_hour': is_peak_hour,
|
| 74 |
}
|
| 75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
def _predict_probas_pct(models, X_scaled):
|
| 77 |
"""Probabilités brutes (en %) de LightGBM et du LSTM pour chaque ligne de X_scaled.
|
| 78 |
Si le LSTM est indisponible, LightGBM est utilisé pour les deux colonnes."""
|
|
|
|
| 22 |
warnings.filterwarnings('ignore', category=UserWarning, module='lightgbm')
|
| 23 |
|
| 24 |
from src.config import (QUARTIERS_DAKAR, COORDONNEES_QUARTIERS, QUARTIER_ADJUSTMENT,
|
| 25 |
+
classify_risk, RISK_THRESHOLDS, TRAINING_RANGES, CONSO_RANGE_BY_PEAK)
|
| 26 |
|
| 27 |
logger = logging.getLogger(__name__)
|
| 28 |
|
|
|
|
| 73 |
'is_peak_hour': is_peak_hour,
|
| 74 |
}
|
| 75 |
|
| 76 |
+
def check_training_range(temperature, humidite, vitesse_vent, consommation, is_peak_hour):
|
| 77 |
+
"""Liste des entrées hors de la plage vue à l'entraînement (vide si tout est dans la plage)."""
|
| 78 |
+
labels = {
|
| 79 |
+
'temperature': ('Température', temperature, '°C'),
|
| 80 |
+
'humidite': ('Humidité', humidite, '%'),
|
| 81 |
+
'vitesse_vent': ('Vent', vitesse_vent, 'km/h'),
|
| 82 |
+
'consommation': ('Consommation', consommation, 'MW'),
|
| 83 |
+
}
|
| 84 |
+
warnings_list = []
|
| 85 |
+
for key, (label, value, unit) in labels.items():
|
| 86 |
+
lo, hi = TRAINING_RANGES[key]
|
| 87 |
+
if not lo <= value <= hi:
|
| 88 |
+
warnings_list.append(f"{label} {value:g} {unit} hors plage d'entraînement ({lo:g}-{hi:g} {unit})")
|
| 89 |
+
lo, hi = CONSO_RANGE_BY_PEAK[int(is_peak_hour)]
|
| 90 |
+
in_global = TRAINING_RANGES['consommation'][0] <= consommation <= TRAINING_RANGES['consommation'][1]
|
| 91 |
+
if in_global and not lo <= consommation <= hi:
|
| 92 |
+
moment = "en heure de pointe (18h-22h)" if is_peak_hour else "hors heure de pointe"
|
| 93 |
+
warnings_list.append(
|
| 94 |
+
f"Consommation {consommation:g} MW jamais observée {moment} à l'entraînement ({lo:g}-{hi:g} MW)"
|
| 95 |
+
)
|
| 96 |
+
return warnings_list
|
| 97 |
+
|
| 98 |
+
|
| 99 |
def _predict_probas_pct(models, X_scaled):
|
| 100 |
"""Probabilités brutes (en %) de LightGBM et du LSTM pour chaque ligne de X_scaled.
|
| 101 |
Si le LSTM est indisponible, LightGBM est utilisé pour les deux colonnes."""
|
tests/test_training_range.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Les plages déclarées dans src/config.py doivent correspondre au CSV d'entraînement,
|
| 3 |
+
et check_training_range() doit signaler (sans bloquer) les entrées hors plage.
|
| 4 |
+
"""
|
| 5 |
+
import sys
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
from unittest.mock import MagicMock
|
| 8 |
+
|
| 9 |
+
import pandas as pd
|
| 10 |
+
import pytest
|
| 11 |
+
|
| 12 |
+
sys.modules['streamlit'] = MagicMock()
|
| 13 |
+
ROOT = Path(__file__).parent.parent
|
| 14 |
+
sys.path.insert(0, str(ROOT))
|
| 15 |
+
|
| 16 |
+
from src.config import TRAINING_RANGES, CONSO_RANGE_BY_PEAK, SLIDER_CONFIG
|
| 17 |
+
from streamlit_app.utils_simple import check_training_range
|
| 18 |
+
|
| 19 |
+
CSV_PATH = ROOT / 'data' / 'synthetic' / 'synthetic_data_v2.csv'
|
| 20 |
+
CSV_COLS = {
|
| 21 |
+
'temperature': 'temp_celsius',
|
| 22 |
+
'humidite': 'humidite_percent',
|
| 23 |
+
'vitesse_vent': 'vitesse_vent',
|
| 24 |
+
'consommation': 'conso_megawatt',
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
@pytest.fixture(scope='module')
|
| 29 |
+
def training_csv():
|
| 30 |
+
head = CSV_PATH.read_bytes()[:200] if CSV_PATH.exists() else b''
|
| 31 |
+
if not head or head.startswith(b'version https://git-lfs'):
|
| 32 |
+
pytest.skip("CSV d'entraînement absent ou pointeur Git LFS non téléchargé (git lfs pull)")
|
| 33 |
+
return pd.read_csv(CSV_PATH, usecols=list(CSV_COLS.values()) + ['is_peak_hour'])
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
@pytest.mark.parametrize('key', list(CSV_COLS))
|
| 37 |
+
def test_plages_couvrent_le_csv_au_plus_juste(training_csv, key):
|
| 38 |
+
lo, hi = TRAINING_RANGES[key]
|
| 39 |
+
col = training_csv[CSV_COLS[key]]
|
| 40 |
+
assert lo <= col.min() and col.max() <= hi
|
| 41 |
+
assert col.min() - lo < 0.5 and hi - col.max() < 0.5 # pas de marge excessive
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
@pytest.mark.parametrize('peak', [0, 1])
|
| 45 |
+
def test_conso_par_heure_de_pointe(training_csv, peak):
|
| 46 |
+
lo, hi = CONSO_RANGE_BY_PEAK[peak]
|
| 47 |
+
conso = training_csv.loc[training_csv['is_peak_hour'] == peak, 'conso_megawatt']
|
| 48 |
+
assert lo <= conso.min() and conso.max() <= hi
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
def test_sliders_non_bloques():
|
| 52 |
+
# Les sliders restent plus larges que les plages : on avertit, on ne bloque pas
|
| 53 |
+
for key, (lo, hi) in TRAINING_RANGES.items():
|
| 54 |
+
assert SLIDER_CONFIG[key]['min'] <= lo and hi <= SLIDER_CONFIG[key]['max']
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def test_valeurs_dans_la_plage_sans_avertissement():
|
| 58 |
+
assert check_training_range(25, 80, 10, 1100, is_peak_hour=1) == []
|
| 59 |
+
assert check_training_range(25, 80, 10, 600, is_peak_hour=0) == []
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def test_valeurs_hors_plage_signalees():
|
| 63 |
+
msgs = check_training_range(42, 30, 35, 1450, is_peak_hour=1)
|
| 64 |
+
assert len(msgs) == 4
|
| 65 |
+
assert all("hors plage d'entraînement" in m for m in msgs)
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def test_conso_incoherente_avec_l_heure():
|
| 69 |
+
# 800 MW en pointe : valeur par défaut des sliders, jamais vue à l'entraînement
|
| 70 |
+
msgs = check_training_range(25, 80, 10, 800, is_peak_hour=1)
|
| 71 |
+
assert len(msgs) == 1 and 'pointe' in msgs[0]
|
| 72 |
+
msgs = check_training_range(25, 80, 10, 1200, is_peak_hour=0)
|
| 73 |
+
assert len(msgs) == 1 and 'hors heure de pointe' in msgs[0]
|