@@ -131,7 +131,7 @@ def test_distances(self):
131131 assert_allclose (
132132 d ,
133133 self .ref_distances ["endtoend" ],
134- atol = 10 ** (- self .prec ),
134+ atol = 10 ** (- self .prec ),
135135 rtol = 0 ,
136136 err_msg = "distance between M1:N and G214:C" ,
137137 )
@@ -322,21 +322,26 @@ def test_get_writer_2(self, ref, reader, tmpdir):
322322 assert_equal (W .n_atoms , 100 )
323323
324324 def test_dt (self , ref , reader ):
325- assert_allclose (reader .dt , ref .dt , atol = 10 ** (- ref .prec ), rtol = 0 )
325+ assert_allclose (reader .dt , ref .dt , atol = 10 ** (- ref .prec ), rtol = 0 )
326326
327327 def test_ts_dt_matches_reader (self , reader ):
328328 assert_equal (reader .ts .dt , reader .dt )
329329
330330 def test_total_time (self , ref , reader ):
331- assert_allclose (reader .totaltime , ref .totaltime , atol = 10 ** (- ref .prec ), rtol = 0 )
331+ assert_allclose (
332+ reader .totaltime , ref .totaltime , atol = 10 ** (- ref .prec ), rtol = 0
333+ )
332334
333335 def test_first_dimensions (self , ref , reader ):
334336 reader .rewind ()
335337 if ref .dimensions is None :
336338 assert reader .ts .dimensions is None
337339 else :
338340 assert_allclose (
339- reader .ts .dimensions , ref .dimensions , atol = 10 ** (- ref .prec ), rtol = 0
341+ reader .ts .dimensions ,
342+ ref .dimensions ,
343+ atol = 10 ** (- ref .prec ),
344+ rtol = 0 ,
340345 )
341346
342347 def test_changing_dimensions (self , ref , reader ):
@@ -346,7 +351,10 @@ def test_changing_dimensions(self, ref, reader):
346351 assert reader .ts .dimensions is None
347352 else :
348353 assert_allclose (
349- reader .ts .dimensions , ref .dimensions , atol = 10 ** (- ref .prec ), rtol = 0
354+ reader .ts .dimensions ,
355+ ref .dimensions ,
356+ atol = 10 ** (- ref .prec ),
357+ rtol = 0 ,
350358 )
351359 reader [1 ]
352360 if ref .dimensions_second_frame is None :
@@ -355,8 +363,8 @@ def test_changing_dimensions(self, ref, reader):
355363 assert_allclose (
356364 reader .ts .dimensions ,
357365 ref .dimensions_second_frame ,
358- atol = 10 ** (- ref .prec ),
359- rtol = 0
366+ atol = 10 ** (- ref .prec ),
367+ rtol = 0 ,
360368 )
361369
362370 def test_volume (self , ref , reader ):
@@ -392,7 +400,7 @@ def test_iter_auxiliary(self, ref, reader):
392400 auxstep .data ,
393401 ref .aux_highf_all_data [i ],
394402 atol = 1e-7 ,
395- rtol = 0 ,
403+ rtol = 0 ,
396404 err_msg = "Auxiliary data does not match for "
397405 "step {}" .format (i ),
398406 )
@@ -457,7 +465,7 @@ def test_transformations_iter(self, ref, transformed):
457465 for i , ts in enumerate (transformed ):
458466 idealcoords = ref .iter_ts (i ).positions + v1 + v2
459467 assert_allclose (
460- ts .positions , idealcoords , atol = 10 ** (- ref .prec ), rtol = 0
468+ ts .positions , idealcoords , atol = 10 ** (- ref .prec ), rtol = 0
461469 )
462470
463471 def test_transformations_2iter (self , ref , transformed ):
@@ -469,11 +477,13 @@ def test_transformations_2iter(self, ref, transformed):
469477 for i , ts in enumerate (transformed ):
470478 idealcoords .append (ref .iter_ts (i ).positions + v1 + v2 )
471479 assert_allclose (
472- ts .positions , idealcoords [i ], atol = 10 ** (- ref .prec ), rtol = 0
480+ ts .positions , idealcoords [i ], atol = 10 ** (- ref .prec ), rtol = 0
473481 )
474482
475483 for i , ts in enumerate (transformed ):
476- assert_allclose (ts .positions , idealcoords [i ], atol = 10 ** (- ref .prec ), rtol = 0 )
484+ assert_allclose (
485+ ts .positions , idealcoords [i ], atol = 10 ** (- ref .prec ), rtol = 0
486+ )
477487
478488 def test_transformations_slice (self , ref , transformed ):
479489 # Are the transformations applied when iterating over a slice of the trajectory?
@@ -482,7 +492,7 @@ def test_transformations_slice(self, ref, transformed):
482492 for i , ts in enumerate (transformed [2 :3 :1 ]):
483493 idealcoords = ref .iter_ts (ts .frame ).positions + v1 + v2
484494 assert_allclose (
485- ts .positions , idealcoords , atol = 10 ** (- ref .prec ), rtol = 0
495+ ts .positions , idealcoords , atol = 10 ** (- ref .prec ), rtol = 0
486496 )
487497
488498 def test_transformations_switch_frame (self , ref , transformed ):
@@ -494,25 +504,40 @@ def test_transformations_switch_frame(self, ref, transformed):
494504 first_ideal = ref .iter_ts (0 ).positions + v1 + v2
495505 if len (transformed ) > 1 :
496506 assert_allclose (
497- transformed [0 ].positions , first_ideal , atol = 10 ** (- ref .prec ), rtol = 0
507+ transformed [0 ].positions ,
508+ first_ideal ,
509+ atol = 10 ** (- ref .prec ),
510+ rtol = 0 ,
498511 )
499512 second_ideal = ref .iter_ts (1 ).positions + v1 + v2
500513 assert_allclose (
501- transformed [1 ].positions , second_ideal , atol = 10 ** (- ref .prec ), rtol = 0
514+ transformed [1 ].positions ,
515+ second_ideal ,
516+ atol = 10 ** (- ref .prec ),
517+ rtol = 0 ,
502518 )
503519
504520 # What if we comeback to the previous frame?
505521 assert_allclose (
506- transformed [0 ].positions , first_ideal , atol = 10 ** (- ref .prec ), rtol = 0
522+ transformed [0 ].positions ,
523+ first_ideal ,
524+ atol = 10 ** (- ref .prec ),
525+ rtol = 0 ,
507526 )
508527
509528 # How about we switch the frame to itself?
510529 assert_allclose (
511- transformed [0 ].positions , first_ideal , atol = 10 ** (- ref .prec ), rtol = 0
530+ transformed [0 ].positions ,
531+ first_ideal ,
532+ atol = 10 ** (- ref .prec ),
533+ rtol = 0 ,
512534 )
513535 else :
514536 assert_allclose (
515- transformed [0 ].positions , first_ideal , atol = 10 ** (- ref .prec ), rtol = 0
537+ transformed [0 ].positions ,
538+ first_ideal ,
539+ atol = 10 ** (- ref .prec ),
540+ rtol = 0 ,
516541 )
517542
518543 def test_transformation_rewind (self , ref , transformed ):
@@ -523,7 +548,10 @@ def test_transformation_rewind(self, ref, transformed):
523548 ideal_coords = ref .iter_ts (0 ).positions + v1 + v2
524549 transformed .rewind ()
525550 assert_allclose (
526- transformed [0 ].positions , ideal_coords , atol = 10 ** (- ref .prec ), rtol = 0
551+ transformed [0 ].positions ,
552+ ideal_coords ,
553+ atol = 10 ** (- ref .prec ),
554+ rtol = 0 ,
527555 )
528556
529557 def test_transformations_copy (self , ref , transformed ):
@@ -540,7 +568,7 @@ def test_transformations_copy(self, ref, transformed):
540568 for i , ts in enumerate (new ):
541569 ideal_coords = ref .iter_ts (i ).positions + v1 + v2
542570 assert_allclose (
543- ts .positions , ideal_coords , atol = 10 ** (- ref .prec ), rtol = 0
571+ ts .positions , ideal_coords , atol = 10 ** (- ref .prec ), rtol = 0
544572 )
545573
546574 def test_add_another_transformations_raises_ValueError (self , transformed ):
@@ -816,7 +844,10 @@ def test_write_different_box(self, ref, universe, tmpdir):
816844 for ts_ref , ts_w in zip (universe .trajectory , written ):
817845 universe .dimensions [:3 ] += 1
818846 assert_allclose (
819- universe .dimensions , ts_w .dimensions , atol = 10 ** (- ref .prec ), rtol = 0
847+ universe .dimensions ,
848+ ts_w .dimensions ,
849+ atol = 10 ** (- ref .prec ),
850+ rtol = 0 ,
820851 )
821852
822853 def test_write_trajectory_atomgroup (self , ref , reader , universe , tmpdir ):
@@ -859,7 +890,7 @@ def test_write_selection(
859890 assert_allclose (
860891 copy_ts ._pos ,
861892 sel .atoms .positions ,
862- atol = 10 ** (- ref .prec ),
893+ atol = 10 ** (- ref .prec ),
863894 rtol = 0 ,
864895 err_msg = "coordinate mismatch between original and written "
865896 "trajectory at frame {} (orig) vs {} (copy)" .format (
@@ -940,7 +971,7 @@ def assert_timestep_almost_equal(A, B, decimal=6, verbose=True):
940971 assert_allclose (
941972 A .positions ,
942973 B .positions ,
943- atol = 10 ** (- decimal ),
974+ atol = 10 ** (- decimal ),
944975 rtol = 0 ,
945976 err_msg = "Timestep positions" ,
946977 verbose = verbose ,
@@ -957,7 +988,7 @@ def assert_timestep_almost_equal(A, B, decimal=6, verbose=True):
957988 assert_allclose (
958989 A .velocities ,
959990 B .velocities ,
960- atol = 10 ** (- decimal ),
991+ atol = 10 ** (- decimal ),
961992 rtol = 0 ,
962993 err_msg = "Timestep velocities" ,
963994 verbose = verbose ,
@@ -974,7 +1005,7 @@ def assert_timestep_almost_equal(A, B, decimal=6, verbose=True):
9741005 assert_allclose (
9751006 A .forces ,
9761007 B .forces ,
977- atol = 10 ** (- decimal ),
1008+ atol = 10 ** (- decimal ),
9781009 rtol = 0 ,
9791010 err_msg = "Timestep forces" ,
9801011 verbose = verbose ,
0 commit comments