Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ jobs:
include:
# Python 3.11 + core packages (minimum supported versions) + optional packages (minimum supported versions if any)
- python-version: '3.11'
numpy-version: '1.26'
numpy-version: '2.0'
pandas-version: '=2.2'
xarray-version: '=2023.10'
xarray-version: '=2024.5'
optional-packages: ' contextily geopandas ipython pyarrow-core rioxarray netCDF4 sphinx-gallery'
# Python 3.13 + core packages (latest versions) + optional packages
- python-version: '3.13'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_tests_legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ jobs:
python=3.11
gmt=${{ matrix.gmt_version }}
ghostscript
numpy=1.26
numpy=2.0
pandas=2.2
xarray=2023.10
xarray=2024.5
packaging=24.2
contextily=1.5
geopandas=1.0
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ dependencies:
# Required dependencies
- gmt=6.6.0
- ghostscript=10.06.0
- numpy>=1.26
- numpy>=2.0
- pandas>=2.2
- xarray>=2023.10
- xarray>=2024.5
- packaging>=24.2
# Optional dependencies
- contextily>=1.5
Expand Down
11 changes: 0 additions & 11 deletions pygmt/conftest.py

This file was deleted.

9 changes: 5 additions & 4 deletions pygmt/datatypes/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class _GMT_IMAGE(ctp.Structure): # noqa: N801
>>> data.shape
(180, 360, 3)
>>> data.min(), data.max()
(10, 255)
(np.uint8(10), np.uint8(255))
"""

_fields_: ClassVar = [
Expand Down Expand Up @@ -139,17 +139,18 @@ def to_xarray(self) -> xr.DataArray:
...,
[177, 179, 179, ..., 178, 177, 177],
[185, 187, 187, ..., 187, 186, 185],
[189, 191, 191, ..., 191, 191, 189]]], dtype=uint8)
[189, 191, 191, ..., 191, 191, 189]]],
shape=(3, 180, 360), dtype=uint8)
Coordinates:
* y (y) float64... 89.5 88.5 87.5 86.5 ... -86.5 -87.5 -88.5 -89.5
* x (x) float64... -179.5 -178.5 -177.5 -176.5 ... 177.5 178.5 179.5
* band (band) uint8... 1 2 3
Attributes:
long_name: z
long_name: z

>>> da.coords["x"] # doctest: +NORMALIZE_WHITESPACE, +ELLIPSIS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The # doctest: +NORMALIZE_WHITESPACE, +ELLIPSIS can be removed here

Suggested change
>>> da.coords["x"] # doctest: +NORMALIZE_WHITESPACE, +ELLIPSIS
>>> da.coords["x"]

Also can remove it at L118 above, and at

>>> raster.coords # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE

Then you'll need to update the repr to include the Size: ?kB. Could maybe use https://github.com/max-sixty/pytest-accept to help automate this a little bit.

<xarray.DataArray 'x' (x: 360)>...
array([-179.5, -178.5, -177.5, ..., 177.5, 178.5, 179.5])
array([-179.5, -178.5, -177.5, ..., 177.5, 178.5, 179.5], shape=(360,))
Coordinates:
* x (x) float64... -179.5 -178.5 -177.5 -176.5 ... 177.5 178.5 179.5
Attributes:
Expand Down
10 changes: 1 addition & 9 deletions pygmt/tests/test_clib_to_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""

import datetime
import sys

import numpy as np
import numpy.testing as npt
Expand Down Expand Up @@ -52,14 +51,7 @@ def _check_result(result, expected_dtype):
@pytest.mark.parametrize(
("data", "expected_dtype"),
[
# TODO(NumPy>=2.0): Remove the if-else statement after NumPy>=2.0.
pytest.param(
[1, 2, 3],
np.int32
if sys.platform == "win32" and Version(np.__version__) < Version("2.0")
else np.int64,
id="int",
),
pytest.param([1, 2, 3], np.int64, id="int"),
pytest.param([1.0, 2.0, 3.0], np.float64, id="float"),
pytest.param(
[complex(+1), complex(-2j), complex("-Infinity+NaNj")],
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ classifiers = [
"Programming Language :: Python :: 3.13",
]
dependencies = [
"numpy>=1.26",
"numpy>=2.0",
"pandas>=2.2",
"xarray>=2023.10",
"xarray>=2024.5",
"packaging>=24.2",
]
dynamic = ["version"]
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Required packages
numpy>=1.26
numpy>=2.0
pandas>=2.2
xarray>=2023.10
xarray>=2024.5
packaging>=24.2
Loading