-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathtest_segfault.py
51 lines (37 loc) · 1.23 KB
/
test_segfault.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from __future__ import print_function
import unittest
import pytraj as pt
from utils import fn
from pytraj.trajectory.shared_methods import iterframe_master
from pytraj import dihedral_analysis as da
"""
try not to get segmentation fault error (due to whatever freaking reason)
"""
traj = pt.iterload(fn('Tc5b.x'), fn('Tc5b.top'))
class Test(unittest.TestCase):
def test_0(self):
it = iterframe_master(traj)
for idx, frame in enumerate(it):
pass
# Status: don't need to fix since "it" and "traj" share the same iterator
fa = traj[:]
for idx, frame in enumerate(fa):
fa[idx]
def test_1(self):
pt.search_hbonds(traj)
pt.search_hbonds(traj, 'series')
pt.search_hbonds(traj, 'series, nointramol')
def test_4_trajiter(self):
traj = pt.load_sample_data("tz2")
for idx, (f0, f1) in enumerate(zip(traj, traj)):
f0.rmsd(f1)
def test_indexing_nonrefernce_DSL(self):
# segmentation fault
# new DSL
d0_dummy = pt.search_hbonds(traj)[:][:][:][:][0]
pt.search_hbonds(traj)[0]
# filter
dslist = da.calc_phi(traj)
dslist[0]
if __name__ == "__main__":
unittest.main()