Skip to content

Commit 202c3e6

Browse files
committed
Input array now is not C-contiguous
1 parent 0d102a2 commit 202c3e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pygmt/tests/test_clib_to_numpy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ def test_to_numpy_ndarray_numpy_dtypes_numeric(dtype, expected_dtype):
8686
Test both 1-D and 2-D arrays.
8787
"""
8888
# 1-D array
89-
array = np.array([1, 2, 3], dtype=dtype)
89+
array = np.array([1, 2, 3, 4, 5, 6], dtype=dtype)[::2] # Not C-contiguous
9090
result = _to_numpy(array)
9191
_check_result(result, expected_dtype)
9292
npt.assert_array_equal(result, array, strict=True)
9393

9494
# 2-D array
95-
array = np.array([[1, 2, 3], [4, 5, 6]], dtype=dtype)
95+
array = np.array([[1, 2, 3, 4], [5, 6, 7, 8]], dtype=dtype)[::2, ::2]
9696
result = _to_numpy(array)
9797
_check_result(result, expected_dtype)
9898
npt.assert_array_equal(result, array, strict=True)
@@ -132,7 +132,7 @@ def test_to_numpy_pandas_series_numpy_dtypes_numeric(dtype, expected_dtype):
132132
"""
133133
Test the _to_numpy function with pandas.Series of NumPy numeric dtypes.
134134
"""
135-
series = pd.Series([1, 2, 3], dtype=dtype)
135+
series = pd.Series([1, 2, 3, 4, 5, 6], dtype=dtype)[::2] # Not C-contiguous
136136
result = _to_numpy(series)
137137
_check_result(result, expected_dtype)
138138
npt.assert_array_equal(result, series)

0 commit comments

Comments
 (0)