If the model file exists on disk but cannot be deserialised (corrupt joblib, version mismatch, etc.). A missing file returns None instead — that’s a legitimate “no model yet” state.
Examples
import tempfilefrom spotforecast2_safe.manager.trainer import load_iterationwith tempfile.TemporaryDirectory() as tmpdir: result = load_iteration("lgbm", 99, model_dir=tmpdir)print(result)assert result isNone
Iteration 99 does not exist at /var/folders/dw/pvtj6mt91znd0hftcztqb0k00000gn/T/tmp8kneavsb/lgbm_forecaster_99.joblib!