@@ -21,9 +21,9 @@ def test_read_datasets_data(test_datapath):
21
21
22
22
def check_testdata (testpath , expected_name , expected_shape ):
23
23
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
+ )
27
27
if expected_name != "" :
28
28
check_data = np .loadtxt (
29
29
test_datapath (f"expected_output/read_datasets/{ expected_name } " )
@@ -98,26 +98,26 @@ def test_hv_output(self, test_datapath):
98
98
X = self .input1
99
99
dat = X [X [:, 2 ] == 1 , :2 ]
100
100
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
+ )
104
104
105
105
hv_ind = moocore .Hypervolume (ref = [10 , 10 ])
106
106
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
+ )
110
110
111
111
dat = X [X [:, 2 ] == 2 , :2 ]
112
112
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
+ )
116
116
117
117
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
+ )
121
121
122
122
X = moocore .read_datasets (test_datapath ("duplicated3.inp" ))[:, :- 1 ]
123
123
hv = moocore .hypervolume (
@@ -282,9 +282,9 @@ def test_eaf(test_datapath):
282
282
expected_eaf_pct_result = np .loadtxt (
283
283
test_datapath (f"expected_output/eaf/pct_{ expected_eaf_name } " )
284
284
)
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
+ )
288
288
assert_allclose (
289
289
eaf_test ,
290
290
expected_eaf_result ,
0 commit comments