Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoTrizio committed Dec 13, 2024
1 parent 285db63 commit a834b9e
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 52 deletions.
54 changes: 2 additions & 52 deletions mlcolvar/tests/test_utils_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import urllib
from mlcolvar.utils.io import load_dataframe
from mlcolvar.utils.io import test_datasetFromFile
from mlcolvar.utils.io import test_datasesetFromTrajectories, test_create_dataset_from_trajectories
from mlcolvar.utils.io import test_datasesetFromTrajectories

example_files = {
"str": "mlcolvar/tests/data/state_A.dat",
Expand All @@ -26,54 +26,4 @@ def test_loadDataframe(file_type):

if __name__ == "__main__":
test_datasetFromFile()
test_datasesetFromTrajectories()
text = """
CRYST1 2.000 2.000 2.000 90.00 90.00 90.00 P 1 1
ATOM 1 OH2 TIP3W 1 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 2 H1 TIP3W 1 0.700 0.700 0.000 1.00 0.00 WT1 H
ATOM 3 H2 TIP3W 1 0.700 -0.700 0.000 1.00 0.00 WT1 H
ENDMODEL
ATOM 1 OH2 TIP3W 1 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 2 H1 TIP3W 1 0.700 0.700 0.000 1.00 0.00 WT1 H
ATOM 3 H2 TIP3W 1 0.700 -0.700 0.000 1.00 0.00 WT1 H
END
"""
test_create_dataset_from_trajectories(text, None)

text = """
CRYST1 2.000 2.000 2.000 90.00 90.00 90.00 P 1 1
ATOM 1 OH2 TIP3W 1 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 2 H1 TIP3W 1 0.700 0.700 0.000 1.00 0.00 WT1 H
ATOM 3 H2 TIP3W 1 0.700 -0.700 0.000 1.00 0.00 WT1 H
ATOM 4 OH2 XXXXW 2 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 5 H1 XXXXW 2 0.300 0.300 0.000 1.00 0.00 WT1 H
ATOM 6 H2 XXXXW 2 0.300 -0.300 0.000 1.00 0.00 WT1 H
ENDMODEL
ATOM 1 OH2 TIP3W 1 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 2 H1 TIP3W 1 0.700 0.700 0.000 1.00 0.00 WT1 H
ATOM 3 H2 TIP3W 1 0.700 -0.700 0.000 1.00 0.00 WT1 H
ATOM 4 OH2 XXXXW 2 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 5 H1 XXXXW 2 0.300 0.300 0.000 1.00 0.00 WT1 H
ATOM 6 H2 XXXXW 2 0.300 -0.300 0.000 1.00 0.00 WT1 H
END
"""
test_create_dataset_from_trajectories(text, 'not resname XXXX')

text = """
CRYST1 2.000 2.000 2.000 90.00 90.00 90.00 P 1 1
ATOM 1 OH2 XXXXW 1 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 2 OH2 TIP3W 2 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 3 H1 XXXXW 1 0.300 0.300 0.000 1.00 0.00 WT1 H
ATOM 4 H1 TIP3W 2 0.700 0.700 0.000 1.00 0.00 WT1 H
ATOM 5 H2 XXXXW 1 0.300 -0.300 0.000 1.00 0.00 WT1 H
ATOM 6 H2 TIP3W 2 0.700 -0.700 0.000 1.00 0.00 WT1 H
ENDMODEL
ATOM 1 OH2 XXXXW 1 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 2 OH2 TIP3W 2 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 3 H1 XXXXW 1 0.300 0.300 0.000 1.00 0.00 WT1 H
ATOM 4 H1 TIP3W 2 0.700 0.700 0.000 1.00 0.00 WT1 H
ATOM 5 H2 XXXXW 1 0.300 -0.300 0.000 1.00 0.00 WT1 H
ATOM 6 H2 TIP3W 2 0.700 -0.700 0.000 1.00 0.00 WT1 H
END
"""
test_create_dataset_from_trajectories(text, 'not resname XXXX')
test_datasesetFromTrajectories()
53 changes: 53 additions & 0 deletions mlcolvar/tests/test_utils_io_graph.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from mlcolvar.utils.io import test_create_dataset_from_trajectories

if __name__ == "__main__":
text = """
CRYST1 2.000 2.000 2.000 90.00 90.00 90.00 P 1 1
ATOM 1 OH2 TIP3W 1 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 2 H1 TIP3W 1 0.700 0.700 0.000 1.00 0.00 WT1 H
ATOM 3 H2 TIP3W 1 0.700 -0.700 0.000 1.00 0.00 WT1 H
ENDMODEL
ATOM 1 OH2 TIP3W 1 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 2 H1 TIP3W 1 0.700 0.700 0.000 1.00 0.00 WT1 H
ATOM 3 H2 TIP3W 1 0.700 -0.700 0.000 1.00 0.00 WT1 H
END
"""
test_create_dataset_from_trajectories(text, None)

text = """
CRYST1 2.000 2.000 2.000 90.00 90.00 90.00 P 1 1
ATOM 1 OH2 TIP3W 1 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 2 H1 TIP3W 1 0.700 0.700 0.000 1.00 0.00 WT1 H
ATOM 3 H2 TIP3W 1 0.700 -0.700 0.000 1.00 0.00 WT1 H
ATOM 4 OH2 XXXXW 2 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 5 H1 XXXXW 2 0.300 0.300 0.000 1.00 0.00 WT1 H
ATOM 6 H2 XXXXW 2 0.300 -0.300 0.000 1.00 0.00 WT1 H
ENDMODEL
ATOM 1 OH2 TIP3W 1 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 2 H1 TIP3W 1 0.700 0.700 0.000 1.00 0.00 WT1 H
ATOM 3 H2 TIP3W 1 0.700 -0.700 0.000 1.00 0.00 WT1 H
ATOM 4 OH2 XXXXW 2 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 5 H1 XXXXW 2 0.300 0.300 0.000 1.00 0.00 WT1 H
ATOM 6 H2 XXXXW 2 0.300 -0.300 0.000 1.00 0.00 WT1 H
END
"""
test_create_dataset_from_trajectories(text, 'not resname XXXX')

text = """
CRYST1 2.000 2.000 2.000 90.00 90.00 90.00 P 1 1
ATOM 1 OH2 XXXXW 1 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 2 OH2 TIP3W 2 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 3 H1 XXXXW 1 0.300 0.300 0.000 1.00 0.00 WT1 H
ATOM 4 H1 TIP3W 2 0.700 0.700 0.000 1.00 0.00 WT1 H
ATOM 5 H2 XXXXW 1 0.300 -0.300 0.000 1.00 0.00 WT1 H
ATOM 6 H2 TIP3W 2 0.700 -0.700 0.000 1.00 0.00 WT1 H
ENDMODEL
ATOM 1 OH2 XXXXW 1 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 2 OH2 TIP3W 2 0.000 0.000 0.000 1.00 0.00 WT1 O
ATOM 3 H1 XXXXW 1 0.300 0.300 0.000 1.00 0.00 WT1 H
ATOM 4 H1 TIP3W 2 0.700 0.700 0.000 1.00 0.00 WT1 H
ATOM 5 H2 XXXXW 1 0.300 -0.300 0.000 1.00 0.00 WT1 H
ATOM 6 H2 TIP3W 2 0.700 -0.700 0.000 1.00 0.00 WT1 H
END
"""
test_create_dataset_from_trajectories(text, 'not resname XXXX')

0 comments on commit a834b9e

Please sign in to comment.