@@ -52,36 +52,18 @@ def test_nlist():
52
52
assert pcd .pts [idx ].molID == resCloud .pts [idx ].molID
53
53
54
54
# Calculate the neighborlist by ID
55
- nList = cyoda .neighListO (
56
- rcutoff = 3.5 ,
57
- yCloud = resCloud ,
58
- typeI = 2 , # oxygenAtomType
59
- )
60
55
nl = cyoda .neighListO (
61
56
rcutoff = 3.5 ,
62
57
yCloud = pcd ,
63
58
typeI = 2 , # oxygenAtomType
64
59
)
65
60
66
- # Needs nList and nl for this
67
- for idx in range (len (nList )):
68
- assert nList [idx ] == nl [idx ]
69
-
61
+ # Validate the results
70
62
verify (pprint .pformat (nl ))
71
63
72
64
73
65
def test_hbnlist ():
74
- # Get the frame
75
- resCloud = cyoda .readLammpsTrjreduced (
76
- filename = strTRJ ,
77
- targetFrame = 1 ,
78
- typeI = 2 , # oxygenAtomType
79
- isSlice = False ,
80
- coordLow = [0 , 0 , 0 ],
81
- coordHigh = [0 , 0 , 0 ],
82
- )
83
-
84
- # Construct a pointcloud
66
+ # Get the frame, make a pointcloud
85
67
atms = aseread (strTRJ )
86
68
# TODO(ruhi): How should these be passed
87
69
lammps_to_ase = {1 : "H" , 2 : "O" }
@@ -93,50 +75,27 @@ def test_hbnlist():
93
75
)
94
76
95
77
# Calculate the neighborlist by ID
96
- nList = cyoda .neighListO (
97
- rcutoff = 3.5 ,
98
- yCloud = resCloud ,
99
- typeI = 2 , # oxygenAtomType
100
- )
101
78
nl = cyoda .neighListO (
102
79
rcutoff = 3.5 ,
103
80
yCloud = pcd ,
104
81
typeI = 2 , # oxygenAtomType
105
82
)
106
83
107
84
# Get the hydrogen-bonded network for the current frame
108
- hbnList = cyoda .populateHbonds (
109
- filename = strTRJ ,
110
- yCloud = resCloud ,
111
- nList = nList ,
112
- targetFrame = 1 ,
113
- Htype = 1 , # hydrogen atom type
114
- )
115
85
hl = cyoda .populateHbonds (
116
86
filename = strTRJ ,
117
87
yCloud = pcd ,
118
88
nList = nl ,
119
89
targetFrame = 1 ,
120
90
Htype = 1 , # hydrogen atom type
121
91
)
122
- for idx in range (len (hbnList )):
123
- assert hbnList [idx ] == hl [idx ]
124
92
93
+ # Validate the results
125
94
verify (pprint .pformat (hl ))
126
95
127
96
128
97
def test_hbnlist1 ():
129
- # Get the frame
130
- resCloud = cyoda .readLammpsTrjreduced (
131
- filename = strTRJ ,
132
- targetFrame = 1 ,
133
- typeI = 2 , # oxygenAtomType
134
- isSlice = False ,
135
- coordLow = [0 , 0 , 0 ],
136
- coordHigh = [0 , 0 , 0 ],
137
- )
138
-
139
- # Construct a pointcloud
98
+ # Get the frame, make a pointcloud
140
99
atms = aseread (strTRJ )
141
100
# TODO(ruhi): How should these be passed
142
101
lammps_to_ase = {1 : "H" , 2 : "O" }
@@ -148,25 +107,13 @@ def test_hbnlist1():
148
107
)
149
108
150
109
# Calculate the neighborlist by ID
151
- nList = cyoda .neighListO (
152
- rcutoff = 3.5 ,
153
- yCloud = resCloud ,
154
- typeI = 2 , # oxygenAtomType
155
- )
156
110
nl = cyoda .neighListO (
157
111
rcutoff = 3.5 ,
158
112
yCloud = pcd ,
159
113
typeI = 2 , # oxygenAtomType
160
114
)
161
115
162
116
# Get the hydrogen-bonded network for the current frame
163
- hbnList = cyoda .populateHbonds (
164
- filename = strTRJ ,
165
- yCloud = resCloud ,
166
- nList = nList ,
167
- targetFrame = 1 ,
168
- Htype = 1 , # hydrogen atom type
169
- )
170
117
hl = cyoda .populateHbonds (
171
118
filename = strTRJ ,
172
119
yCloud = pcd ,
@@ -175,32 +122,17 @@ def test_hbnlist1():
175
122
Htype = 1 , # hydrogen atom type
176
123
)
177
124
# Hydrogen-bonded network using indices not IDs
178
- hbnList = cyoda .neighbourListByIndex (
179
- yCloud = resCloud ,
180
- nList = hbnList ,
181
- )
182
125
hL = cyoda .neighbourListByIndex (
183
126
yCloud = pcd ,
184
127
nList = hl ,
185
128
)
186
- for idx in range (len (hbnList )):
187
- assert hbnList [idx ] == hL [idx ]
188
129
130
+ # Validate the results
189
131
verify (pprint .pformat (hL ))
190
132
191
133
192
134
def test_rings ():
193
- # Get the frame
194
- resCloud = cyoda .readLammpsTrjreduced (
195
- filename = strTRJ ,
196
- targetFrame = 1 ,
197
- typeI = 2 , # oxygenAtomType
198
- isSlice = False ,
199
- coordLow = [0 , 0 , 0 ],
200
- coordHigh = [0 , 0 , 0 ],
201
- )
202
-
203
- # Construct a pointcloud
135
+ # Get the frame, make a pointcloud
204
136
atms = aseread (strTRJ )
205
137
# TODO(ruhi): How should these be passed
206
138
lammps_to_ase = {1 : "H" , 2 : "O" }
@@ -212,25 +144,13 @@ def test_rings():
212
144
)
213
145
214
146
# Calculate the neighborlist by ID
215
- nList = cyoda .neighListO (
216
- rcutoff = 3.5 ,
217
- yCloud = resCloud ,
218
- typeI = 2 , # oxygenAtomType
219
- )
220
147
nl = cyoda .neighListO (
221
148
rcutoff = 3.5 ,
222
149
yCloud = pcd ,
223
150
typeI = 2 , # oxygenAtomType
224
151
)
225
152
226
153
# Get the hydrogen-bonded network for the current frame
227
- hbnList = cyoda .populateHbonds (
228
- filename = strTRJ ,
229
- yCloud = resCloud ,
230
- nList = nList ,
231
- targetFrame = 1 ,
232
- Htype = 1 , # hydrogen atom type
233
- )
234
154
hl = cyoda .populateHbonds (
235
155
filename = strTRJ ,
236
156
yCloud = pcd ,
@@ -239,26 +159,17 @@ def test_rings():
239
159
Htype = 1 , # hydrogen atom type
240
160
)
241
161
# Hydrogen-bonded network using indices not IDs
242
- hbnList = cyoda .neighbourListByIndex (
243
- yCloud = resCloud ,
244
- nList = hbnList ,
245
- )
246
162
hL = cyoda .neighbourListByIndex (
247
163
yCloud = pcd ,
248
164
nList = hl ,
249
165
)
250
166
# Gets every ring (non-primitives included)
251
- rings = cyoda .ringNetwork (
252
- nList = hbnList ,
253
- maxDepth = 6 ,
254
- )
255
167
Rgs = cyoda .ringNetwork (
256
168
nList = hL ,
257
169
maxDepth = 6 ,
258
170
)
259
- for idx in range (len (rings )):
260
- assert rings [idx ] == Rgs [idx ]
261
171
172
+ # Validate the results
262
173
verify (pprint .pformat (Rgs ))
263
174
264
175
0 commit comments