Skip to content

Commit 846d4e0

Browse files
committed
MAINT: Cleanup test by relying solely on approvals
1 parent e75bcf6 commit 846d4e0

File tree

1 file changed

+7
-96
lines changed

1 file changed

+7
-96
lines changed

tests/test_ase_topo1d.py

Lines changed: 7 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -52,36 +52,18 @@ def test_nlist():
5252
assert pcd.pts[idx].molID == resCloud.pts[idx].molID
5353

5454
# Calculate the neighborlist by ID
55-
nList = cyoda.neighListO(
56-
rcutoff=3.5,
57-
yCloud=resCloud,
58-
typeI=2, # oxygenAtomType
59-
)
6055
nl = cyoda.neighListO(
6156
rcutoff=3.5,
6257
yCloud=pcd,
6358
typeI=2, # oxygenAtomType
6459
)
6560

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
7062
verify(pprint.pformat(nl))
7163

7264

7365
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
8567
atms = aseread(strTRJ)
8668
# TODO(ruhi): How should these be passed
8769
lammps_to_ase = {1: "H", 2: "O"}
@@ -93,50 +75,27 @@ def test_hbnlist():
9375
)
9476

9577
# Calculate the neighborlist by ID
96-
nList = cyoda.neighListO(
97-
rcutoff=3.5,
98-
yCloud=resCloud,
99-
typeI=2, # oxygenAtomType
100-
)
10178
nl = cyoda.neighListO(
10279
rcutoff=3.5,
10380
yCloud=pcd,
10481
typeI=2, # oxygenAtomType
10582
)
10683

10784
# 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-
)
11585
hl = cyoda.populateHbonds(
11686
filename=strTRJ,
11787
yCloud=pcd,
11888
nList=nl,
11989
targetFrame=1,
12090
Htype=1, # hydrogen atom type
12191
)
122-
for idx in range(len(hbnList)):
123-
assert hbnList[idx] == hl[idx]
12492

93+
# Validate the results
12594
verify(pprint.pformat(hl))
12695

12796

12897
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
14099
atms = aseread(strTRJ)
141100
# TODO(ruhi): How should these be passed
142101
lammps_to_ase = {1: "H", 2: "O"}
@@ -148,25 +107,13 @@ def test_hbnlist1():
148107
)
149108

150109
# Calculate the neighborlist by ID
151-
nList = cyoda.neighListO(
152-
rcutoff=3.5,
153-
yCloud=resCloud,
154-
typeI=2, # oxygenAtomType
155-
)
156110
nl = cyoda.neighListO(
157111
rcutoff=3.5,
158112
yCloud=pcd,
159113
typeI=2, # oxygenAtomType
160114
)
161115

162116
# 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-
)
170117
hl = cyoda.populateHbonds(
171118
filename=strTRJ,
172119
yCloud=pcd,
@@ -175,32 +122,17 @@ def test_hbnlist1():
175122
Htype=1, # hydrogen atom type
176123
)
177124
# Hydrogen-bonded network using indices not IDs
178-
hbnList = cyoda.neighbourListByIndex(
179-
yCloud=resCloud,
180-
nList=hbnList,
181-
)
182125
hL = cyoda.neighbourListByIndex(
183126
yCloud=pcd,
184127
nList=hl,
185128
)
186-
for idx in range(len(hbnList)):
187-
assert hbnList[idx] == hL[idx]
188129

130+
# Validate the results
189131
verify(pprint.pformat(hL))
190132

191133

192134
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
204136
atms = aseread(strTRJ)
205137
# TODO(ruhi): How should these be passed
206138
lammps_to_ase = {1: "H", 2: "O"}
@@ -212,25 +144,13 @@ def test_rings():
212144
)
213145

214146
# Calculate the neighborlist by ID
215-
nList = cyoda.neighListO(
216-
rcutoff=3.5,
217-
yCloud=resCloud,
218-
typeI=2, # oxygenAtomType
219-
)
220147
nl = cyoda.neighListO(
221148
rcutoff=3.5,
222149
yCloud=pcd,
223150
typeI=2, # oxygenAtomType
224151
)
225152

226153
# 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-
)
234154
hl = cyoda.populateHbonds(
235155
filename=strTRJ,
236156
yCloud=pcd,
@@ -239,26 +159,17 @@ def test_rings():
239159
Htype=1, # hydrogen atom type
240160
)
241161
# Hydrogen-bonded network using indices not IDs
242-
hbnList = cyoda.neighbourListByIndex(
243-
yCloud=resCloud,
244-
nList=hbnList,
245-
)
246162
hL = cyoda.neighbourListByIndex(
247163
yCloud=pcd,
248164
nList=hl,
249165
)
250166
# Gets every ring (non-primitives included)
251-
rings = cyoda.ringNetwork(
252-
nList=hbnList,
253-
maxDepth=6,
254-
)
255167
Rgs = cyoda.ringNetwork(
256168
nList=hL,
257169
maxDepth=6,
258170
)
259-
for idx in range(len(rings)):
260-
assert rings[idx] == Rgs[idx]
261171

172+
# Validate the results
262173
verify(pprint.pformat(Rgs))
263174

264175

0 commit comments

Comments
 (0)