Skip to content

Commit 747461d

Browse files
committed
flake8 corrections
1 parent 7ce2082 commit 747461d

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

bvh.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ def __getitem__(self, key):
2727
for child in self.children:
2828
for index, item in enumerate(child.value):
2929
if item == key:
30-
if index+1 >= len(child.value):
30+
if index + 1 >= len(child.value):
3131
return None
3232
else:
33-
return child.value[index+1:]
34-
raise IndexError('key {0} not found'.format(key))
33+
return child.value[index + 1:]
34+
raise IndexError('key {} not found'.format(key))
3535

3636
def __repr__(self):
3737
return str(' '.join(self.value))

tests/test_bvh.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def test_bones(self):
3232
bones = []
3333
with open('tests/test_freebvh.bvh') as f:
3434
mocap = Bvh(f.read())
35+
3536
def iterate_joints(joint):
3637
bones.append(str(joint))
3738
for child in joint.filter('JOINT'):
@@ -118,7 +119,7 @@ def test_frame_channel(self):
118119
self.assertEqual(mocap.frame_joint_channel(22, 'Neck', 'Xrotation'), -6.77)
119120
self.assertEqual(mocap.frame_joint_channel(22, 'Head', 'Yrotation'), 8.47)
120121

121-
def test_frame_channel(self):
122+
def test_frame_channel2(self):
122123
with open('tests/test_freebvh.bvh') as f:
123124
mocap = Bvh(f.read())
124125
self.assertEqual(mocap.frame_joint_channel(22, 'mixamorig:Hips', 'Xposition'), 4.3314)
@@ -128,7 +129,7 @@ def test_frame_iteration(self):
128129
mocap = Bvh(f.read())
129130
x_accumulator = 0.0
130131
for i in range(0, mocap.nframes):
131-
x_accumulator += mocap.frame_joint_channel(i, 'Hips', 'Xposition')
132+
x_accumulator += mocap.frame_joint_channel(i, 'Hips', 'Xposition')
132133
self.assertTrue(abs(-19735.902699999995 - x_accumulator) < 0.0001)
133134

134135
def test_joints_names(self):
@@ -151,16 +152,15 @@ def test_joint_parent(self):
151152
def test_frame_joint_multi_channels(self):
152153
with open('tests/test_mocapbank.bvh') as f:
153154
mocap = Bvh(f.read())
154-
rotation = mocap.frame_joint_channels(30, 'Head', ['Xrotation', 'Yrotation', 'Zrotation'])
155+
rotation = mocap.frame_joint_channels(30, 'Head', ['Xrotation', 'Yrotation', 'Zrotation'])
155156
self.assertEqual(rotation, [1.77, 13.94, -7.42])
156157

157158
def test_frames_multi_channels(self):
158159
with open('tests/test_mocapbank.bvh') as f:
159160
mocap = Bvh(f.read())
160-
rotations = mocap.frames_joint_channels('Head', ['Xrotation', 'Yrotation', 'Zrotation'])
161+
rotations = mocap.frames_joint_channels('Head', ['Xrotation', 'Yrotation', 'Zrotation'])
161162
self.assertEqual(len(rotations), mocap.nframes)
162163

163164

164165
if __name__ == '__main__':
165166
unittest.main()
166-

0 commit comments

Comments
 (0)