Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
caic99 committed Dec 2, 2024
1 parent fd59449 commit 89a3882
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions deepmd/utils/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def __init__(
) -> None:
"""Constructor."""
root = DPPath(sys_path)
if not root.is_dir():
raise FileNotFoundError(f"System {sys_path} is not found!")

Check warning on line 64 in deepmd/utils/data.py

View check run for this annotation

Codecov / codecov/patch

deepmd/utils/data.py#L64

Added line #L64 was not covered by tests
self.dirs = root.glob(set_prefix + ".*")
if not len(self.dirs):
raise FileNotFoundError(f"No {set_prefix}.* is found in {sys_path}")
Expand Down
2 changes: 0 additions & 2 deletions deepmd/utils/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ def __init__(self, path: Union[str, Path], mode: str = "r") -> None:
super().__init__()
self.mode = mode
self.path = Path(path)
if not self.path.exists():
raise FileNotFoundError(f"{self.path} not found")

def load_numpy(self) -> np.ndarray:
"""Load NumPy array.
Expand Down

0 comments on commit 89a3882

Please sign in to comment.