Skip to content

Commit

Permalink
ensure Geometry.save works with strings
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenhaute committed Oct 9, 2024
1 parent dd0a55f commit d78f611
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion psiflow/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def save(self, path_xyz: Union[Path, str]):
Args:
path_xyz (Union[Path, str]): Path to save the XYZ file.
"""
path_xyz = psiflow.resolve_and_check(path_xyz)
path_xyz = psiflow.resolve_and_check(Path(path_xyz))
with open(path_xyz, "w") as f:
f.write(self.to_string())

Expand Down
1 change: 1 addition & 0 deletions tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def test_geometry(tmp_path):
assert state.identifier == state.identifier

state.save(tmp_path / "geo.xyz")
state.save(str(tmp_path / "geo.xyz"))
assert state == Geometry.load(tmp_path / "geo.xyz")


Expand Down

0 comments on commit d78f611

Please sign in to comment.