Skip to content

Commit fddb53a

Browse files
committed
Windows default integer dtype is np.int32 for NumPy 1.x
xref: https://numpy.org/devdocs/numpy_2_0_migration_guide.html#windows-default-integer
1 parent b8f6d12 commit fddb53a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pygmt/tests/test_clib_to_numpy.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
Tests for the _to_numpy function in the clib.conversion module.
33
"""
44

5+
import sys
6+
57
import numpy as np
68
import numpy.testing as npt
79
import pandas as pd
810
import pytest
11+
from packaging.version import Version
912
from pygmt.clib.conversion import _to_numpy
1013

1114

@@ -25,7 +28,13 @@ def _check_result(result, expected_dtype):
2528
@pytest.mark.parametrize(
2629
("data", "expected_dtype"),
2730
[
28-
pytest.param([1, 2, 3], np.int64, id="int"),
31+
pytest.param(
32+
[1, 2, 3],
33+
np.int32
34+
if sys.platform == "win32" and Version(np.__version__) < Version("2.0")
35+
else np.int64,
36+
id="int",
37+
),
2938
pytest.param([1.0, 2.0, 3.0], np.float64, id="float"),
3039
pytest.param(
3140
[complex(+1), complex(-2j), complex("-Infinity+NaNj")],

0 commit comments

Comments
 (0)