Improve message when no hyperopt fie is found

closes #6266
This commit is contained in:
Matthias
2022-01-21 15:23:06 +01:00
parent 730d2e3574
commit bb1d8fb54f
4 changed files with 12 additions and 1 deletions

View File

@@ -100,6 +100,9 @@ def get_latest_hyperopt_file(directory: Union[Path, str], predef_filename: str =
if isinstance(directory, str):
directory = Path(directory)
if predef_filename:
if Path(predef_filename).is_absolute():
raise OperationalException(
"--hyperopt-filename expects only the filename, not an absolute path.")
return directory / predef_filename
return directory / get_latest_hyperopt_filename(directory)