Skip to content

Commit 7db84f7

Browse files
authored
clib.conversion._to_numpy: Shorten test names (#3657)
1 parent 519720e commit 7db84f7

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

pygmt/tests/test_clib_to_numpy.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ def test_to_numpy_python_types(data, expected_dtype):
115115

116116

117117
@pytest.mark.parametrize(("dtype", "expected_dtype"), np_dtype_params)
118-
def test_to_numpy_ndarray_numpy_dtypes_numeric(dtype, expected_dtype):
118+
def test_to_numpy_numpy_numeric(dtype, expected_dtype):
119119
"""
120-
Test the _to_numpy function with NumPy arrays of NumPy numeric dtypes.
120+
Test the _to_numpy function with NumPy arrays of numeric dtypes.
121121
122122
Test both 1-D and 2-D arrays which are not C-contiguous.
123123
"""
@@ -137,9 +137,9 @@ def test_to_numpy_ndarray_numpy_dtypes_numeric(dtype, expected_dtype):
137137

138138

139139
@pytest.mark.parametrize("dtype", [None, np.str_, "U10"])
140-
def test_to_numpy_ndarray_numpy_dtypes_string(dtype):
140+
def test_to_numpy_numpy_string(dtype):
141141
"""
142-
Test the _to_numpy function with NumPy arrays of string types.
142+
Test the _to_numpy function with NumPy arrays of string dtypes.
143143
"""
144144
array = np.array(["abc", "defg", "12345"], dtype=dtype)
145145
result = _to_numpy(array)
@@ -177,9 +177,9 @@ def test_to_numpy_ndarray_numpy_dtypes_string(dtype):
177177
# 3. https://pandas.pydata.org/docs/user_guide/pyarrow.html
178178
########################################################################################
179179
@pytest.mark.parametrize(("dtype", "expected_dtype"), np_dtype_params)
180-
def test_to_numpy_pandas_series_numpy_dtypes_numeric(dtype, expected_dtype):
180+
def test_to_numpy_pandas_numeric(dtype, expected_dtype):
181181
"""
182-
Test the _to_numpy function with pandas.Series of NumPy numeric dtypes.
182+
Test the _to_numpy function with pandas.Series of numeric dtypes.
183183
"""
184184
series = pd.Series([1, 2, 3, 4, 5, 6], dtype=dtype)[::2] # Not C-contiguous
185185
result = _to_numpy(series)
@@ -207,9 +207,9 @@ def test_to_numpy_pandas_series_numpy_dtypes_numeric(dtype, expected_dtype):
207207
),
208208
],
209209
)
210-
def test_to_numpy_pandas_series_pandas_dtypes_string(dtype):
210+
def test_to_numpy_pandas_string(dtype):
211211
"""
212-
Test the _to_numpy function with pandas.Series of pandas string types.
212+
Test the _to_numpy function with pandas.Series of string dtypes.
213213
214214
In pandas, string arrays can be specified in multiple ways.
215215
@@ -229,7 +229,7 @@ def test_to_numpy_pandas_series_pandas_dtypes_string(dtype):
229229
pytest.param("date64[ms][pyarrow]", "datetime64[ms]", id="date64[ms]"),
230230
],
231231
)
232-
def test_to_numpy_pandas_series_pyarrow_dtypes_date(dtype, expected_dtype):
232+
def test_to_numpy_pandas_date(dtype, expected_dtype):
233233
"""
234234
Test the _to_numpy function with pandas.Series of PyArrow date32/date64 types.
235235
"""
@@ -282,9 +282,9 @@ def test_to_numpy_pandas_series_pyarrow_dtypes_date(dtype, expected_dtype):
282282
pytest.param("float64", np.float64, id="float64"),
283283
],
284284
)
285-
def test_to_numpy_pyarrow_array_pyarrow_dtypes_numeric(dtype, expected_dtype):
285+
def test_to_numpy_pyarrow_numeric(dtype, expected_dtype):
286286
"""
287-
Test the _to_numpy function with PyArrow arrays of PyArrow numeric types.
287+
Test the _to_numpy function with PyArrow arrays of numeric types.
288288
"""
289289
data = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
290290
if dtype == "float16": # float16 needs special handling
@@ -313,9 +313,9 @@ def test_to_numpy_pyarrow_array_pyarrow_dtypes_numeric(dtype, expected_dtype):
313313
pytest.param("float64", np.float64, id="float64"),
314314
],
315315
)
316-
def test_to_numpy_pyarrow_array_pyarrow_dtypes_numeric_with_na(dtype, expected_dtype):
316+
def test_to_numpy_pyarrow_numeric_with_na(dtype, expected_dtype):
317317
"""
318-
Test the _to_numpy function with PyArrow arrays of PyArrow numeric types and NA.
318+
Test the _to_numpy function with PyArrow arrays of numeric types and NA.
319319
"""
320320
data = [1.0, 2.0, None, 4.0, 5.0, 6.0]
321321
if dtype == "float16": # float16 needs special handling
@@ -339,9 +339,9 @@ def test_to_numpy_pyarrow_array_pyarrow_dtypes_numeric_with_na(dtype, expected_d
339339
"string_view",
340340
],
341341
)
342-
def test_to_numpy_pyarrow_array_pyarrow_dtypes_string(dtype):
342+
def test_to_numpy_pyarrow_string(dtype):
343343
"""
344-
Test the _to_numpy function with PyArrow arrays of PyArrow string types.
344+
Test the _to_numpy function with PyArrow arrays of string types.
345345
"""
346346
array = pa.array(["abc", "defg", "12345"], type=dtype)
347347
result = _to_numpy(array)
@@ -357,9 +357,9 @@ def test_to_numpy_pyarrow_array_pyarrow_dtypes_string(dtype):
357357
pytest.param("date64[ms]", "datetime64[ms]", id="date64[ms]"),
358358
],
359359
)
360-
def test_to_numpy_pyarrow_array_pyarrow_dtypes_date(dtype, expected_dtype):
360+
def test_to_numpy_pyarrow_date(dtype, expected_dtype):
361361
"""
362-
Test the _to_numpy function with PyArrow arrays of PyArrow date types.
362+
Test the _to_numpy function with PyArrow arrays of date32/date64 types.
363363
364364
date32[day] and date64[ms] are stored as 32-bit and 64-bit integers, respectively,
365365
representing the number of days and milliseconds since the UNIX epoch (1970-01-01).

0 commit comments

Comments
 (0)