Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions dpgen/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def expand_sys_str(root_dir: Union[str, Path]) -> list[str]:
-------
List[str]
list of string pointing to system directories
Raises
------
RuntimeError
No system was found in the directory
"""
root_dir = Path(root_dir)
if root_dir.is_dir():
Expand All @@ -66,6 +71,8 @@ def expand_sys_str(root_dir: Union[str, Path]) -> list[str]:
]
else:
raise OSError(f"{root_dir} does not exist.")
if len(matches) == 0:
raise RuntimeError("%s does not contain any systems!" % root_dir)
return matches


Expand Down