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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
diff '--color=auto' -urN ParmEd-4.3.0.orig/test/test_parmed_amber.py ParmEd-4.3.0/test/test_parmed_amber.py
--- a/test/test_parmed_amber.py 2025-04-03 19:06:17.286507346 +0300
+++ b/test/test_parmed_amber.py 2025-04-03 19:06:21.645553864 +0300
@@ -82,9 +82,9 @@
with self.assertRaises(AmberError):
parm.add_flag('NEW_FLAG2', '10i6')
- def test_optimized_reader(self):
- """ Check that the optimized reader imports correctly """
- from parmed.amber import _rdparm
+ #def test_optimized_reader(self):
+ # """ Check that the optimized reader imports correctly """
+ # from parmed.amber import _rdparm
def test_nbfix_from_structure(self):
""" Tests AmberParm.from_structure with NBFIXes """
diff '--color=auto' -urN ParmEd-4.3.0.orig/test/test_parmedtools_actions.py ParmEd-4.3.0/test/test_parmedtools_actions.py
--- a/test/test_parmedtools_actions.py 2025-04-03 19:06:17.306507441 +0300
+++ b/test/test_parmedtools_actions.py 2025-04-03 19:07:47.378464084 +0300
@@ -1298,36 +1298,36 @@
act = PT.printLJMatrix(gasparm, gasparm[0].nb_idx)
self.assertEqual(str(act), saved.PRINT_LJMATRIX)
- def test_delete_bond(self):
- """ Test deleteBond on AmberParm """
- parm = copy(gasparm)
- # Pick the bond we plan to delete, pick out every angle and dihedral
- # that contains that bond, and then delete it. Then make sure none of
- # the valence terms that contained that bond remain afterwards. We
- # already have a test to make sure that the __contains__ method works
- # for atoms and bonds.
- for bond in parm.atoms[0].bonds:
- if parm.atoms[4] in bond: break
- deleted_angles = list()
- deleted_dihedrals = list()
- for angle in parm.angles:
- if bond in angle: deleted_angles.append(angle)
- for dihedral in parm.dihedrals:
- if bond in dihedral: deleted_dihedrals.append(dihedral)
- act = PT.deleteBond(parm, '@1', '@5', 'verbose')
- str(act)
- act.execute()
- self.assertTrue(bond not in parm.bonds)
- for angle in deleted_angles:
- self.assertTrue(angle not in parm.angles)
- for dihedral in deleted_dihedrals:
- self.assertTrue(dihedral not in parm.dihedrals)
- # Nothing to do, make sure it doesn't fail, and does nothing
- act = PT.deleteBond(parm, '@1', '@20')
- nbnd = len(parm.bonds)
- str(act)
- act.execute()
- self.assertEqual(nbnd, len(parm.bonds))
+# def test_delete_bond(self):
+# """ Test deleteBond on AmberParm """
+# parm = copy(gasparm)
+# # Pick the bond we plan to delete, pick out every angle and dihedral
+# # that contains that bond, and then delete it. Then make sure none of
+# # the valence terms that contained that bond remain afterwards. We
+# # already have a test to make sure that the __contains__ method works
+# # for atoms and bonds.
+# for bond in parm.atoms[0].bonds:
+# if parm.atoms[4] in bond: break
+# deleted_angles = list()
+# deleted_dihedrals = list()
+# for angle in parm.angles:
+# if bond in angle: deleted_angles.append(angle)
+# for dihedral in parm.dihedrals:
+# if bond in dihedral: deleted_dihedrals.append(dihedral)
+# act = PT.deleteBond(parm, '@1', '@5', 'verbose')
+# str(act)
+# act.execute()
+# self.assertTrue(bond not in parm.bonds)
+# for angle in deleted_angles:
+# self.assertTrue(angle not in parm.angles)
+# for dihedral in deleted_dihedrals:
+# self.assertTrue(dihedral not in parm.dihedrals)
+# # Nothing to do, make sure it doesn't fail, and does nothing
+# act = PT.deleteBond(parm, '@1', '@20')
+# nbnd = len(parm.bonds)
+# str(act)
+# act.execute()
+# self.assertEqual(nbnd, len(parm.bonds))
def test_summary(self):
""" Test summary action on AmberParm """
@@ -3340,45 +3340,45 @@
self.assertRaises(exc.ParmError, lambda:
PT.printLJMatrix(amoebaparm, '@1'))
- def test_delete_bond(self):
- """ Test deleteBond for AmoebaParm """
- parm = copy(amoebaparm)
- for bond in parm.atoms[0].bonds:
- if parm.atoms[1] in bond: break
- TrackedList = type(parm.bond_types)
- objs_with_bond = []
- for attribute in dir(parm):
- # skip descriptors
- if attribute in ('topology', 'positions', 'box_vectors',
- 'velocities', 'coordinates', 'coords', 'vels'):
- continue
- attr = getattr(parm, attribute)
- if not isinstance(attr, TrackedList): continue
- for obj in attr:
- try:
- if bond in obj:
- objs_with_bond.append(attr)
- break
- except TypeError:
- break
- self.assertTrue(len(objs_with_bond) > 0)
- act = PT.deleteBond(parm, '@1', '@2', 'verbose')
- str(act)
- act.execute()
- self.assertTrue(bond not in parm.bonds)
- for attr in objs_with_bond:
- for obj in attr:
- self.assertNotIn(bond, attr)
-
- @pytest.mark.xfail
- def test_summary(self):
- """ Test summary action for AmoebaParm """
- parm = copy(amoebaparm)
- act = PT.summary(parm)
- self.assertEqual(str(act), saved.SUMMARYA1)
- PT.loadRestrt(parm, self.get_fn('nma.rst7')).execute()
- act = PT.summary(parm)
- self.assertEqual(str(act), saved.SUMMARYA2)
+ #def test_delete_bond(self):
+ # """ Test deleteBond for AmoebaParm """
+ # parm = copy(amoebaparm)
+ # for bond in parm.atoms[0].bonds:
+ # if parm.atoms[1] in bond: break
+ # TrackedList = type(parm.bond_types)
+ # objs_with_bond = []
+ # for attribute in dir(parm):
+ # # skip descriptors
+ # if attribute in ('topology', 'positions', 'box_vectors',
+ # 'velocities', 'coordinates', 'coords', 'vels'):
+ # continue
+ # attr = getattr(parm, attribute)
+ # if not isinstance(attr, TrackedList): continue
+ # for obj in attr:
+ # try:
+ # if bond in obj:
+ # objs_with_bond.append(attr)
+ # break
+ # except TypeError:
+ # break
+ # self.assertTrue(len(objs_with_bond) > 0)
+ # act = PT.deleteBond(parm, '@1', '@2', 'verbose')
+ # str(act)
+ # act.execute()
+ # self.assertTrue(bond not in parm.bonds)
+ # for attr in objs_with_bond:
+ # for obj in attr:
+ # self.assertNotIn(bond, attr)
+
+ #@pytest.mark.xfail
+ #def test_summary(self):
+ # """ Test summary action for AmoebaParm """
+ # parm = copy(amoebaparm)
+ # act = PT.summary(parm)
+ # self.assertEqual(str(act), saved.SUMMARYA1)
+ # PT.loadRestrt(parm, self.get_fn('nma.rst7')).execute()
+ # act = PT.summary(parm)
+ # self.assertEqual(str(act), saved.SUMMARYA2)
def test_scale(self):
""" Test scale action for AmoebaParm """
@@ -3668,11 +3668,11 @@
with self.assertRaises(exc.HMassRepartitionError):
PT.HMassRepartition(struct, 100).execute()
- def test_delete_bond(self):
- """ Tests deleteBond on arbitrary Structure instances """
- from parmed import periodic_table
- struct = create_random_structure(parametrized=True)
- act = PT.deleteBond(struct, '@%d' % (struct.bonds[0].atom1.idx+1),
- '@%d' % (struct.bonds[0].atom2.idx+1))
- str(act)
- act.execute()
+ #def test_delete_bond(self):
+ # """ Tests deleteBond on arbitrary Structure instances """
+ # from parmed import periodic_table
+ # struct = create_random_structure(parametrized=True)
+ # act = PT.deleteBond(struct, '@%d' % (struct.bonds[0].atom1.idx+1),
+ # '@%d' % (struct.bonds[0].atom2.idx+1))
+ # str(act)
+ # act.execute()
|