Skip to content

Commit

Permalink
fix(wrapper): Allow arbitrary model file names
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaziarz committed Jun 9, 2022
1 parent d240e8f commit 0373a19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions molecule_generation/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def _get_model_file(cls, dir: Pathlike) -> pathlib.Path:
Raises:
ValueError, if the model pickle is not found or is not unique.
"""
# All candidate files must end with "_best.pkl"
candidates = list(pathlib.Path(dir).glob("*_best.pkl"))
# Candidate files must end with ".pkl"
candidates = list(pathlib.Path(dir).glob("*.pkl"))
if len(candidates) != 1:
raise ValueError(
f"There must be exactly one file matching the pattern. Found the following: {candidates}."
f"There must be exactly one *.pkl file. Found the following: {candidates}."
)
else:
return candidates[0]
Expand Down

0 comments on commit 0373a19

Please sign in to comment.