Skip to content

Commit 29deccc

Browse files
authored
fmt tests (#4857)
1 parent 9312fa6 commit 29deccc

File tree

9 files changed

+485
-303
lines changed

9 files changed

+485
-303
lines changed

package/MDAnalysis/tests/datafiles.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
2-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
2+
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
33
#
44
# MDAnalysis --- https://www.mdanalysis.org
55
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors

package/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ tables\.py
137137
| MDAnalysis/transformations/.*\.py
138138
| MDAnalysis/guesser/.*\.py
139139
| MDAnalysis/converters/.*\.py
140+
| MDAnalysis/tests/.*\.py
140141
| MDAnalysis/selections/.*\.py
141142
)
142143
'''

testsuite/MDAnalysisTests/data/coordinates/create_data.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def create_test_trj(uni, fname):
1212
print(uni.trajectory.ts.__class__)
1313
with mda.Writer(fname, n_atoms) as w:
1414
for i in range(5):
15-
uni.atoms.positions = 2 ** i * pos
15+
uni.atoms.positions = 2**i * pos
1616
uni.trajectory.ts.time = i
1717
uni.trajectory.ts.velocities = uni.atoms.positions / 10
1818
uni.trajectory.ts.forces = uni.atoms.positions / 100
@@ -24,14 +24,15 @@ def create_test_trj(uni, fname):
2424

2525

2626
def main():
27-
pdb = 'test_topology.pdb'
27+
pdb = "test_topology.pdb"
2828
u = mda.Universe(pdb)
2929

30-
create_test_trj(u, 'test.xyz')
31-
create_test_trj(u, 'test.xtc')
32-
create_test_trj(u, 'test.trr')
33-
create_test_trj(u, 'test.gro')
34-
create_test_trj(u, 'test.dcd')
30+
create_test_trj(u, "test.xyz")
31+
create_test_trj(u, "test.xtc")
32+
create_test_trj(u, "test.trr")
33+
create_test_trj(u, "test.gro")
34+
create_test_trj(u, "test.dcd")
3535

36-
if __name__ == '__main__':
36+
37+
if __name__ == "__main__":
3738
main()

testsuite/MDAnalysisTests/data/coordinates/create_h5md_data.py

+19-13
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,24 @@ def create_test_trj(uni, fname):
88
uni.trajectory.ts.dt = 1
99
orig_box = np.array([81.1, 82.2, 83.3, 75, 80, 85], dtype=np.float32)
1010
uni.trajectory.ts.dimensions = orig_box
11-
uni.trajectory.units = {'time': 'ps',
12-
'length': 'Angstrom',
13-
'velocity': 'Angstrom/ps',
14-
'force': 'kJ/(mol*Angstrom)'}
11+
uni.trajectory.units = {
12+
"time": "ps",
13+
"length": "Angstrom",
14+
"velocity": "Angstrom/ps",
15+
"force": "kJ/(mol*Angstrom)",
16+
}
1517
print(uni.trajectory)
1618
print(uni.trajectory.ts.__class__)
17-
with mda.Writer(fname, n_atoms,
18-
positions=True,
19-
velocities=True,
20-
forces=True,
21-
convert_units=False) as w:
19+
with mda.Writer(
20+
fname,
21+
n_atoms,
22+
positions=True,
23+
velocities=True,
24+
forces=True,
25+
convert_units=False,
26+
) as w:
2227
for i in range(5):
23-
uni.atoms.positions = 2 ** i * pos
28+
uni.atoms.positions = 2**i * pos
2429
uni.trajectory.ts.time = i
2530
uni.trajectory.ts.velocities = uni.atoms.positions / 10
2631
uni.trajectory.ts.forces = uni.atoms.positions / 100
@@ -32,10 +37,11 @@ def create_test_trj(uni, fname):
3237

3338

3439
def main():
35-
pdb = 'test_topology.pdb'
40+
pdb = "test_topology.pdb"
3641
u = mda.Universe(pdb)
3742

38-
create_test_trj(u, 'test.h5md')
43+
create_test_trj(u, "test.h5md")
3944

40-
if __name__ == '__main__':
45+
46+
if __name__ == "__main__":
4147
main()

0 commit comments

Comments
 (0)