Skip to content

Commit

Permalink
check for empty paths, fixed mps testing
Browse files Browse the repository at this point in the history
mps used only if not in github actions
  • Loading branch information
wolearyc committed Sep 26, 2024
1 parent 76278e7 commit 10ce3ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"timestep",
"timesteps",
"toctree",
"tqdm",
"undoc",
"Unitless",
"varray",
Expand Down
2 changes: 2 additions & 0 deletions ramannoodle/io/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def pathify_as_list(filepaths: str | Path | list[str] | list[Path]) -> list[Path
"""
if isinstance(filepaths, list):
paths = []
if len(filepaths) == 0:
raise ValueError("filepaths is empty")
for item in filepaths:
paths.append(pathify(item))
return paths
Expand Down
2 changes: 1 addition & 1 deletion test/tests/test_gnn.py → test/tests/torch/test_gnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_gpu(poscar_ref_structure_fixture: ReferenceStructure) -> None:
device = "cuda"
# mps backend doesn't work with github runners
# https://github.com/actions/runner-images/issues/9918
elif torch.backends.mps.is_available() and os.getenv("GITHUB_ACTIONS") == "true":
elif torch.backends.mps.is_available() and os.getenv("GITHUB_ACTIONS") != "true":
device = "mps"
else:
return
Expand Down

0 comments on commit 10ce3ed

Please sign in to comment.