@@ -21,9 +21,9 @@ def test_read_datasets_data(test_datapath):
2121
2222 def check_testdata (testpath , expected_name , expected_shape ):
2323 testdata = moocore .read_datasets (testpath )
24- assert (
25- testdata . shape == expected_shape
26- ), f"Read data array has incorrect shape, should be { expected_shape } but is { testdata . shape } "
24+ assert testdata . shape == expected_shape , (
25+ f"Read data array has incorrect shape, should be { expected_shape } but is { testdata . shape } "
26+ )
2727 if expected_name != "" :
2828 check_data = np .loadtxt (
2929 test_datapath (f"expected_output/read_datasets/{ expected_name } " )
@@ -98,26 +98,26 @@ def test_hv_output(self, test_datapath):
9898 X = self .input1
9999 dat = X [X [:, 2 ] == 1 , :2 ]
100100 hv = moocore .hypervolume (dat , ref = np .array ([10 , 10 ]))
101- assert math .isclose (
102- hv , 90.46272765
103- ), "input1.dat hypervolume produces wrong output"
101+ assert math .isclose (hv , 90.46272765 ), (
102+ "input1.dat hypervolume produces wrong output"
103+ )
104104
105105 hv_ind = moocore .Hypervolume (ref = [10 , 10 ])
106106 hv = hv_ind (dat )
107- assert math .isclose (
108- hv , 90.46272765
109- ), "input1.dat Hypervolume(ref = [10,10]) produces wrong output"
107+ assert math .isclose (hv , 90.46272765 ), (
108+ "input1.dat Hypervolume(ref = [10,10]) produces wrong output"
109+ )
110110
111111 dat = X [X [:, 2 ] == 2 , :2 ]
112112 hv = moocore .hypervolume (dat , ref = [10 , 10 ])
113- assert math .isclose (
114- hv , 53.969708954
115- ), "input1.dat hypervolume produces wrong output"
113+ assert math .isclose (hv , 53.969708954 ), (
114+ "input1.dat hypervolume produces wrong output"
115+ )
116116
117117 hv = hv_ind (dat )
118- assert math .isclose (
119- hv , 53.969708954
120- ), "input1.dat Hypervolume(ref = [10,10]) produces wrong output"
118+ assert math .isclose (hv , 53.969708954 ), (
119+ "input1.dat Hypervolume(ref = [10,10]) produces wrong output"
120+ )
121121
122122 X = moocore .read_datasets (test_datapath ("duplicated3.inp" ))[:, :- 1 ]
123123 hv = moocore .hypervolume (
@@ -282,9 +282,9 @@ def test_eaf(test_datapath):
282282 expected_eaf_pct_result = np .loadtxt (
283283 test_datapath (f"expected_output/eaf/pct_{ expected_eaf_name } " )
284284 )
285- assert (
286- eaf_test . shape == expected_eaf_result . shape
287- ), f"Shapes of { test_name } and { expected_eaf_name } do not match"
285+ assert eaf_test . shape == expected_eaf_result . shape , (
286+ f"Shapes of { test_name } and { expected_eaf_name } do not match"
287+ )
288288 assert_allclose (
289289 eaf_test ,
290290 expected_eaf_result ,
0 commit comments