Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
init-shell: bash
environment-name: docs
create-args: >-
python=3.12
python=3.13
rasterio
xarray
scipy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.12'
python-version: '3.13'

- name: Install dependencies
run: |
Expand Down
43 changes: 21 additions & 22 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.12'
python-version: '3.13'
- uses: pre-commit/action@v3.0.1

docker_tests:
Expand All @@ -34,43 +34,38 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13', '3.14']
python-version: ['3.13', '3.14', '3.15']
rasterio-version: ['']
xarray-version: ['']
run-with-scipy: ['YES']
gdal-version: ['3.12.1']
gdal-version: ['3.13.2']
include:
- python-version: '3.12'
- python-version: '3.13'
rasterio-version: ''
xarray-version: '==2024.7.0'
xarray-version: '==2026.2.0'
run-with-scipy: 'YES'
gdal-version: '3.8.5'
- python-version: '3.12'
rasterio-version: ''
xarray-version: ''
run-with-scipy: 'YES'
gdal-version: '3.9.3'
- python-version: '3.12'
gdal-version: '3.10.3'
- python-version: '3.13'
rasterio-version: ''
xarray-version: ''
run-with-scipy: 'YES'
gdal-version: '3.10.3'
- python-version: '3.12'
gdal-version: '3.11.5'
- python-version: '3.13'
rasterio-version: ''
xarray-version: ''
run-with-scipy: 'YES'
gdal-version: '3.11.5'
- python-version: '3.12'
gdal-version: '3.12.2'
- python-version: '3.13'
rasterio-version: ''
xarray-version: ''
run-with-scipy: 'NO'
gdal-version: '3.11.5'
gdal-version: '3.12.2'
steps:
- uses: actions/checkout@v7

- name: Update
run: |
rm /etc/apt/sources.list.d/apache-arrow.sources
rm /etc/apt/sources.list.d/apache-arrow.sources || true # GDAL<=3.12 Remove arrow sources to avoid conflicts with libarrow-dev
apt-get update
apt-get -y install software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
Expand Down Expand Up @@ -108,6 +103,10 @@ jobs:
run: |
python -m pytest --cov-report term-missing --cov=rioxarray --cov-report xml

- name: Install curl for codecov
run: |
apt-get install -y --no-install-recommends curl

- uses: codecov/codecov-action@v7


Expand All @@ -119,7 +118,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-15-intel, windows-latest]
python-version: ['3.12', '3.13', '3.14']
python-version: ['3.13', '3.14']
gdal-version: ['*']
rasterio-version: ['*']
xarray-version: ['*']
Expand Down Expand Up @@ -162,14 +161,14 @@ jobs:
micromamba info

- name: pylint
if: matrix.python-version == '3.12'
if: matrix.python-version == '3.13'
shell: bash
run: |
micromamba run -n test pylint rioxarray/

- name: mypy
shell: bash
if: matrix.python-version == '3.12'
if: matrix.python-version == '3.13'
run: |
micromamba run -n test mypy rioxarray/

Expand Down Expand Up @@ -202,7 +201,7 @@ jobs:
init-shell: bash
environment-name: test
create-args: >-
python=3.12
python=3.13
proj
libgdal-core
libgdal-netcdf
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default_language_version:
python: python3.12
python: python3.13

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 3.12-3.14.
3. The pull request should work for Python 3.13-3.15.

Tips
----
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG GDAL=ubuntu-full-3.8.5
FROM ghcr.io/osgeo/gdal:${GDAL}
ARG PYTHON_VERSION="3.12"
ARG PYTHON_VERSION="3.13"
ENV LANG="C.UTF-8"
ENV LC_ALL="C.UTF-8"
ENV PIP_NO_BINARY="rasterio"
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

environment:
matrix:
- PYTHON_VERSION: "3.12"
- PYTHON_VERSION: "3.13"
MINICONDA: "C:\\Miniconda3-x64"

install:
Expand Down
1 change: 1 addition & 0 deletions docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ History

Latest
------
- DEP: Update supported Python (3.13+), GDAL (3.10+), pyproj (3.7+), numpy (2.1+) versions (#948)

0.23.0
------
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: rioxarray
channels:
- conda-forge
dependencies:
- python=3.12 # To align with pre-commit requirements
- python=3.13 # To align with pre-commit requirements
- rasterio
- libgdal-netcdf
- libgdal-hdf4
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[mypy]
python_version = 3.12
python_version = 3.13

[mypy-affine]
ignore_missing_imports = True
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,20 @@ classifiers = [
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: GIS",
"Programming Language :: Python",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
requires-python = ">=3.12"
requires-python = ">=3.13"
dependencies = [
"packaging",
"rasterio>=1.4.3",
# https://github.com/pydata/xarray/issues/11000
"xarray>=2026.2",
"pyproj>=3.3",
"numpy>=2",
"pyproj>=3.7",
"numpy>=2.1",
]

[dependency-groups]
Expand All @@ -54,6 +53,7 @@ test = [
"pytest-timeout",
"dask",
"netcdf4",
"packaging",
]
type = [
"mypy",
Expand Down
12 changes: 0 additions & 12 deletions rioxarray/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

# pylint: disable=too-many-lines
import contextlib
import importlib.metadata
import os
import re
import threading
Expand All @@ -20,7 +19,6 @@
import numpy
import rasterio
from numpy.typing import NDArray
from packaging import version
from rasterio.errors import NotGeoreferencedWarning
from rasterio.vrt import WarpedVRT
from xarray import Dataset, IndexVariable
Expand Down Expand Up @@ -165,14 +163,6 @@ def tags(self, bidx=None, **kwargs): # pylint: disable=unused-argument
]


try:
_DASK_GTE_018 = version.parse(importlib.metadata.version("dask")) >= version.parse(
"0.18.0"
)
except importlib.metadata.PackageNotFoundError:
_DASK_GTE_018 = False


def _get_unsigned_dtype(unsigned, dtype):
"""
Based on: https://github.com/pydata/xarray/blob/abe1e613a96b000ae603c53d135828df532b952e/xarray/coding/variables.py#L306-L334
Expand Down Expand Up @@ -925,8 +915,6 @@ def _prepare_dask(
if chunks in (True, "auto"):
from dask.array.core import normalize_chunks

if not _DASK_GTE_018:
raise NotImplementedError("Automatic chunking requires dask >= 0.18.0")
block_shape = (1,) + riods.block_shapes[0]
chunks = normalize_chunks(
chunks=(1, "auto", "auto"),
Expand Down
11 changes: 1 addition & 10 deletions rioxarray/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

from typing import Any

import rasterio
import rasterio.crs
from packaging import version
from pyproj import CRS
from rasterio.errors import CRSError

Expand All @@ -30,17 +28,10 @@ def crs_from_user_input(crs_input: Any) -> rasterio.crs.CRS:
"""
if isinstance(crs_input, rasterio.crs.CRS):
return crs_input
try:
# old versions of opendatacube CRS
crs_input = crs_input.wkt
except AttributeError:
pass
try:
return rasterio.crs.CRS.from_user_input(crs_input)
except CRSError:
pass
# use pyproj for edge cases
crs = CRS.from_user_input(crs_input)
if version.parse(rasterio.__gdal_version__) > version.parse("3.0.0"):
return rasterio.crs.CRS.from_wkt(crs.to_wkt())
return rasterio.crs.CRS.from_wkt(crs.to_wkt("WKT1_GDAL"))
return rasterio.crs.CRS.from_wkt(crs.to_wkt())
21 changes: 0 additions & 21 deletions test/integration/test_integration_rioxarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -2344,27 +2344,6 @@ def test_reproject_default_nodata(dtype, expected_nodata):
assert test_da.rio.reproject(4326).rio.nodata == expected_nodata


class CustomCRS:
@property
def wkt(self):
return CRS.from_epsg(4326).to_wkt()

def __str__(self):
return self.wkt


def test_crs_get_custom():
test_da = xarray.DataArray(
numpy.zeros((5, 5)),
dims=("y", "x"),
coords={"y": numpy.arange(1, 6), "x": numpy.arange(2, 7)},
attrs={"crs": CustomCRS()},
)
assert test_da.rio.crs.to_epsg() == 4326
test_ds = xarray.Dataset({"test": test_da})
assert test_ds.rio.crs.to_epsg() == 4326


def test_get_crs_dataset():
test_ds = xarray.Dataset()
test_ds = test_ds.rio.write_crs(4326)
Expand Down
Loading