diff --git a/pypesto/store/read_from_hdf5.py b/pypesto/store/read_from_hdf5.py index 6f555466f..a34cadf64 100644 --- a/pypesto/store/read_from_hdf5.py +++ b/pypesto/store/read_from_hdf5.py @@ -2,6 +2,7 @@ import ast import logging +import warnings from pathlib import Path from typing import Union @@ -120,10 +121,9 @@ def read(self, objective: ObjectiveBase = None) -> Problem: if objective is None: objective = Objective() # raise warning that objective is not loaded. - logger.info( - 'WARNING: You are loading a problem.\nThis problem' - ' is not to be used without a separately created' - ' objective.' + warnings.warn( + 'You are loading a problem. This problem is not to be used ' + 'without a separately created objective.' ) problem = Problem(objective, [], [])