Support loading results from a specific hyperopt history file

This commit is contained in:
Matthias
2020-09-27 17:00:23 +02:00
parent c42a924df8
commit 3cb1a9a5a9
6 changed files with 31 additions and 5 deletions

View File

@@ -81,7 +81,7 @@ def get_latest_hyperopt_filename(directory: Union[Path, str]) -> str:
return 'hyperopt_results.pickle'
def get_latest_hyperopt_file(directory: Union[Path, str]) -> Path:
def get_latest_hyperopt_file(directory: Union[Path, str], predef_filename: str = None) -> Path:
"""
Get latest hyperopt export based on '.last_result.json'.
:param directory: Directory to search for last result
@@ -91,6 +91,9 @@ def get_latest_hyperopt_file(directory: Union[Path, str]) -> Path:
* `directory/.last_result.json` does not exist
* `directory/.last_result.json` has the wrong content
"""
if predef_filename:
return directory / predef_filename
return directory / get_latest_hyperopt_filename(directory)