Skip to content

Commit 97c9ef8

Browse files
committed
Convert tests from np.array_equiv to np.array_equal
1 parent bba3bde commit 97c9ef8

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

test/test_stancsv.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_csv_bytes_to_numpy_no_header():
2626
dtype=np.float32,
2727
)
2828
arr_out = stancsv.csv_bytes_list_to_numpy(lines, includes_header=False)
29-
assert np.array_equiv(arr_out, expected)
29+
assert np.array_equal(arr_out, expected)
3030
assert arr_out[0].dtype == np.float32
3131

3232

@@ -48,7 +48,7 @@ def test_csv_bytes_to_numpy_no_header_no_polars():
4848
)
4949
with mock.patch.dict("sys.modules", {"polars": None}):
5050
arr_out = stancsv.csv_bytes_list_to_numpy(lines, includes_header=False)
51-
assert np.array_equiv(arr_out, expected)
51+
assert np.array_equal(arr_out, expected)
5252
assert arr_out[0].dtype == np.float32
5353

5454

@@ -73,7 +73,7 @@ def test_csv_bytes_to_numpy_with_header():
7373
dtype=np.float32,
7474
)
7575
arr_out = stancsv.csv_bytes_list_to_numpy(lines, includes_header=True)
76-
assert np.array_equiv(arr_out, expected)
76+
assert np.array_equal(arr_out, expected)
7777

7878

7979
def test_csv_bytes_to_numpy_single_element():
@@ -87,7 +87,7 @@ def test_csv_bytes_to_numpy_single_element():
8787
dtype=np.float32,
8888
)
8989
arr_out = stancsv.csv_bytes_list_to_numpy(lines, includes_header=False)
90-
assert np.array_equiv(arr_out, expected)
90+
assert np.array_equal(arr_out, expected)
9191

9292

9393
def test_csv_bytes_to_numpy_single_element_no_polars():
@@ -102,7 +102,7 @@ def test_csv_bytes_to_numpy_single_element_no_polars():
102102
)
103103
with mock.patch.dict("sys.modules", {"polars": None}):
104104
arr_out = stancsv.csv_bytes_list_to_numpy(lines, includes_header=False)
105-
assert np.array_equiv(arr_out, expected)
105+
assert np.array_equal(arr_out, expected)
106106

107107

108108
def test_csv_bytes_to_numpy_with_header_no_polars():
@@ -127,7 +127,7 @@ def test_csv_bytes_to_numpy_with_header_no_polars():
127127
)
128128
with mock.patch.dict("sys.modules", {"polars": None}):
129129
arr_out = stancsv.csv_bytes_list_to_numpy(lines, includes_header=True)
130-
assert np.array_equiv(arr_out, expected)
130+
assert np.array_equal(arr_out, expected)
131131

132132

133133
def test_csv_bytes_to_numpy_empty():
@@ -214,7 +214,7 @@ def test_parsing_adaptation_lines_diagonal():
214214
step_size, mass_matrix = stancsv.parse_hmc_adaptation_lines(lines)
215215
assert step_size == 0.787025
216216
assert mass_matrix is not None
217-
assert np.array_equiv(mass_matrix, np.array([1, 2, 3]))
217+
assert np.array_equal(mass_matrix, np.array([[1, 2, 3]]))
218218

219219

220220
def test_parsing_adaptation_lines_dense():
@@ -237,7 +237,7 @@ def test_parsing_adaptation_lines_dense():
237237
)
238238
assert step_size == 0.775147
239239
assert mass_matrix is not None
240-
assert np.array_equiv(mass_matrix, expected)
240+
assert np.array_equal(mass_matrix, expected)
241241

242242

243243
def test_parsing_adaptation_lines_missing_step_size():
@@ -276,7 +276,7 @@ def test_csv_polars_and_numpy_equiv():
276276
arr_out_numpy = stancsv.csv_bytes_list_to_numpy(
277277
lines, includes_header=False
278278
)
279-
assert np.array_equiv(arr_out_polars, arr_out_numpy)
279+
assert np.array_equal(arr_out_polars, arr_out_numpy)
280280

281281

282282
def test_csv_polars_and_numpy_equiv_one_line():
@@ -290,7 +290,7 @@ def test_csv_polars_and_numpy_equiv_one_line():
290290
arr_out_numpy = stancsv.csv_bytes_list_to_numpy(
291291
lines, includes_header=False
292292
)
293-
assert np.array_equiv(arr_out_polars, arr_out_numpy)
293+
assert np.array_equal(arr_out_polars, arr_out_numpy)
294294

295295

296296
def test_csv_polars_and_numpy_equiv_one_element():
@@ -304,4 +304,4 @@ def test_csv_polars_and_numpy_equiv_one_element():
304304
arr_out_numpy = stancsv.csv_bytes_list_to_numpy(
305305
lines, includes_header=False
306306
)
307-
assert np.array_equiv(arr_out_polars, arr_out_numpy)
307+
assert np.array_equal(arr_out_polars, arr_out_numpy)

0 commit comments

Comments
 (0)