Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
148 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
4 angstroem | ||
periodic 8.07007483423 8.9 4.65925987792 | ||
C 0.08333333333 0.5 0.25 | ||
C 0.41666666666 0.5 0.25 | ||
C 0.58333333333 0.5 0.75 | ||
C 0.91666666666 0.5 0.75 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
4 angstroem | ||
surface 8.07007483423 .inf 4.65925987792 | ||
C 0.08333333333 0.5 0.25 | ||
C 0.41666666666 0.5 0.25 | ||
C 0.58333333333 0.5 0.75 | ||
C 0.91666666666 0.5 0.75 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
import pytest | ||
from mlcalcdriver import Posinp | ||
from mlcalcdriver.interfaces import posinp_to_ase_atoms, ase_atoms_to_posinp | ||
|
||
pos_folder = "tests/posinp_files/" | ||
|
||
class TestConversion: | ||
|
||
def test_mol(self): | ||
pos1 = Posinp.from_file(os.path.join(pos_folder, "N2.xyz")) | ||
atoms = posinp_to_ase_atoms(pos1) | ||
pos2 = ase_atoms_to_posinp(atoms) | ||
assert pos1 == pos2 | ||
|
||
def test_surface(self): | ||
pos1 = Posinp.from_file(os.path.join(pos_folder, "surface2.xyz")) | ||
atoms = posinp_to_ase_atoms(pos1) | ||
pos2 = ase_atoms_to_posinp(atoms) | ||
assert pos1 == pos2 | ||
|
||
def test_periodic(self): | ||
pos1 = Posinp.from_file(os.path.join(pos_folder, "periodic.xyz")) | ||
atoms = posinp_to_ase_atoms(pos1) | ||
pos2 = ase_atoms_to_posinp(atoms) | ||
assert pos1 == pos2 |