@@ -42,11 +42,7 @@ def test_simple_cubic(self):
4242 self .assertTrue (np .allclose (rotated_coords , cubic_coords ))
4343
4444 def test_triclinic_cell (self ):
45- triclinic_cell = np .array ([
46- [4.0 , 0.0 , 0.0 ],
47- [1.0 , 3.0 , 0.0 ],
48- [0.5 , 0.5 , 2.5 ]
49- ])
45+ triclinic_cell = np .array ([[4.0 , 0.0 , 0.0 ], [1.0 , 3.0 , 0.0 ], [0.5 , 0.5 , 2.5 ]])
5046
5147 triclinic_coords = np .array ([[0.5 , 0.5 , 0.5 ], [3.0 , 2.0 , 1.0 ]])
5248 rotated_cell , rotated_coords = rotate_to_lower_triangle (
@@ -62,32 +58,36 @@ def test_triclinic_cell(self):
6258 self .assertTrue (rotated_cell [2 , 2 ] > 0 )
6359
6460 # check the distance between two atoms
65- self .assertTrue (np .isclose (
66- np .linalg .norm (rotated_coords [0 ] - rotated_coords [1 ]),
67- np .linalg .norm (triclinic_coords [0 ] - triclinic_coords [1 ]),
68- atol = 1e-10 ,
69- ))
61+ self .assertTrue (
62+ np .isclose (
63+ np .linalg .norm (rotated_coords [0 ] - rotated_coords [1 ]),
64+ np .linalg .norm (triclinic_coords [0 ] - triclinic_coords [1 ]),
65+ atol = 1e-10 ,
66+ )
67+ )
7068
7169 def test_negative_diagonal (self ):
72- negative_cell = np .array ([
73- [- 3.0 , 1.0 , 0.5 ],
74- [0.0 , - 2.0 , 0.3 ],
75- [0.0 , 0.0 , - 4.0 ]
76- ])
70+ negative_cell = np .array ([[- 3.0 , 1.0 , 0.5 ], [0.0 , - 2.0 , 0.3 ], [0.0 , 0.0 , - 4.0 ]])
7771 negative_coords = np .array ([[1.0 , 0.5 , - 1.0 ], [0.5 , 1.0 , - 2.0 ]])
78- rotated_cell , rotated_coords = rotate_to_lower_triangle (negative_cell .copy (), negative_coords .copy ())
72+ rotated_cell , rotated_coords = rotate_to_lower_triangle (
73+ negative_cell .copy (), negative_coords .copy ()
74+ )
7975
8076 self .assertTrue (np .isclose (rotated_cell [0 , 1 ], 0 , atol = 1e-10 ))
8177 self .assertTrue (np .isclose (rotated_cell [0 , 2 ], 0 , atol = 1e-10 ))
8278 self .assertTrue (np .isclose (rotated_cell [1 , 2 ], 0 , atol = 1e-10 ))
83-
79+
8480 self .assertTrue (rotated_cell [0 , 0 ] > 0 )
8581 self .assertTrue (rotated_cell [1 , 1 ] > 0 )
8682 self .assertTrue (rotated_cell [2 , 2 ] > 0 )
8783
88- self .assertTrue (np .isclose (np .linalg .norm (negative_coords [0 ] - negative_coords [1 ]),
89- np .linalg .norm (rotated_coords [0 ] - rotated_coords [1 ]),
90- atol = 1e-6 ))
84+ self .assertTrue (
85+ np .isclose (
86+ np .linalg .norm (negative_coords [0 ] - negative_coords [1 ]),
87+ np .linalg .norm (rotated_coords [0 ] - rotated_coords [1 ]),
88+ atol = 1e-6 ,
89+ )
90+ )
9191
9292
9393if __name__ == "__main__" :
0 commit comments