Skip to content
Open
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
1 change: 0 additions & 1 deletion stubs/rasterio/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Stubs-only helper modules with no runtime counterpart.
rasterio\._typing
rasterio\._affine_types

# Stubs-only type aliases referenced in signatures only.
rasterio\.merge\.MethodFunction
Expand Down
7 changes: 5 additions & 2 deletions stubs/rasterio/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
version = "1.5.0"
version = "1.5.1"
upstream-repository = "https://github.com/rasterio/rasterio"
requires-python = ">=3.12"
dependencies = ["numpy>=2", "click>=8"]
dependencies = ["numpy>=2", "click>=8", "affine>=3"]

[tool.stubtest]
stubtest-dependencies = ["affine"]
4 changes: 0 additions & 4 deletions stubs/rasterio/rasterio/_affine_types.pyi

This file was deleted.

2 changes: 1 addition & 1 deletion stubs/rasterio/rasterio/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ from types import TracebackType
from typing import Any, Final
from typing_extensions import Self, deprecated

from rasterio._affine_types import Affine
from affine import Affine as Affine
from rasterio._path import _ParsedPath, _UnparsedPath
from rasterio._typing import Colormap, CRSInput, _OpenOption
from rasterio.control import GroundControlPoint
Expand Down
2 changes: 1 addition & 1 deletion stubs/rasterio/rasterio/_io.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ from typing import Any, BinaryIO, Final
from typing_extensions import Self, deprecated

import numpy as np
from affine import Affine as Affine
from numpy.typing import DTypeLike, NDArray
from rasterio._affine_types import Affine
from rasterio._base import DatasetBase
from rasterio._path import _ParsedPath, _UnparsedPath
from rasterio._typing import Colormap, CRSInput, Indexes, NumType, ShapeND, WindowInput, _GDALOption, _OpenOption
Expand Down
4 changes: 3 additions & 1 deletion stubs/rasterio/rasterio/_warp.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from collections.abc import Sequence
from typing import Any, Final

from affine import Affine as Affine
from numpy.typing import DTypeLike, NDArray
from rasterio._affine_types import Affine
from rasterio._io import DatasetReaderBase
from rasterio._typing import CRSInput, Geometry, Indexes, ShapeND, WindowInput, _GDALOption, _NestedScalar
from rasterio.control import GroundControlPoint
Expand All @@ -14,6 +14,8 @@ from rasterio.rpc import RPC
SUPPORTED_RESAMPLING: Final[list[Resampling]]
DEFAULT_NODATA_FLAG: Final[object]

dtype_ranges: dict[str, tuple[float, float]]

def recursive_round(val: _NestedScalar, precision: int) -> _NestedScalar: ...
def _transform_geom(
src_crs: CRSInput, dst_crs: CRSInput, geom: Geometry | Sequence[Geometry], precision: int
Expand Down
1 change: 1 addition & 0 deletions stubs/rasterio/rasterio/errors.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class NodataShadowWarning(UserWarning): ...
class NotGeoreferencedWarning(UserWarning): ...
class TransformWarning(UserWarning): ...
class RPCError(ValueError): ...
class InvalidShapeError(RasterioError, ValueError): ...
class ShapeSkipWarning(UserWarning): ...
class GDALBehaviorChangeException(RuntimeError): ...
class GDALOptionNotImplementedError(RasterioError): ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/rasterio/rasterio/features.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ from typing import Any, Final, overload
from typing_extensions import deprecated

import numpy as np
from affine import Affine as Affine
from numpy.typing import DTypeLike, NDArray
from rasterio._affine_types import Affine
from rasterio._typing import Geometry as Geometry
from rasterio.enums import MergeAlg as MergeAlg
from rasterio.io import DatasetReaderBase
Expand Down
2 changes: 1 addition & 1 deletion stubs/rasterio/rasterio/io.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ from types import TracebackType
from typing import Any, Final
from typing_extensions import Self, deprecated

from affine import Affine as Affine
from numpy.typing import DTypeLike
from rasterio._affine_types import Affine
from rasterio._filepath import FilePathBase as FilePathBase
from rasterio._io import (
BufferedDatasetWriterBase as BufferedDatasetWriterBase,
Expand Down
2 changes: 1 addition & 1 deletion stubs/rasterio/rasterio/mask.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import logging
from collections.abc import Iterable
from typing import Any, Final

from affine import Affine as Affine
from numpy.typing import NDArray
from rasterio._affine_types import Affine
from rasterio._typing import Geometry
from rasterio.errors import WindowError as WindowError
from rasterio.features import geometry_mask as geometry_mask, geometry_window as geometry_window
Expand Down
2 changes: 1 addition & 1 deletion stubs/rasterio/rasterio/merge.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ from collections.abc import Callable, Sequence
from typing import Any, Final, Literal, TypeAlias, overload
from typing_extensions import deprecated

from affine import Affine as Affine
from numpy.typing import DTypeLike, NDArray
from rasterio._affine_types import Affine
from rasterio.enums import Resampling
from rasterio.io import DatasetReaderBase

Expand Down
4 changes: 2 additions & 2 deletions stubs/rasterio/rasterio/plot.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import logging
from collections.abc import Mapping, Sequence
from typing import Any, Final, Literal

from affine import Affine as Affine
from numpy.typing import NDArray
from rasterio._affine_types import Affine
from rasterio.io import DatasetReader as DatasetReader
from rasterio.transform import guard_transform as guard_transform

Expand All @@ -25,7 +25,7 @@ def show(
title: str | None = None,
transform: Affine | None = None,
percent_range: tuple[float, float] | None = None,
adjust: bool = True,
adjust: bool = False,
**kwargs: Any,
) -> Any: ...
def plotting_extent(
Expand Down
4 changes: 4 additions & 0 deletions stubs/rasterio/rasterio/serde.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from functools import singledispatch

@singledispatch
def to_json(obj: object) -> object: ...
2 changes: 1 addition & 1 deletion stubs/rasterio/rasterio/stack.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import os
from collections.abc import Sequence
from typing import Any, Final

from affine import Affine as Affine
from numpy.typing import DTypeLike, NDArray
from rasterio._affine_types import Affine
from rasterio.enums import Resampling
from rasterio.io import DatasetReaderBase

Expand Down
2 changes: 1 addition & 1 deletion stubs/rasterio/rasterio/transform.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ from collections.abc import Callable, Sequence
from typing import Final, Literal, TypeAlias, overload
from typing_extensions import Self, deprecated

from rasterio._affine_types import Affine as Affine
from affine import Affine as Affine
from rasterio._transform import GCPTransformerBase, RPCTransformerBase
from rasterio._typing import _GDALOption
from rasterio.control import GroundControlPoint
Expand Down
3 changes: 2 additions & 1 deletion stubs/rasterio/rasterio/warp.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ from collections.abc import Mapping, Sequence
from typing import Any, Final, TypeAlias, overload
from typing_extensions import deprecated

from affine import Affine as Affine
from numpy.typing import ArrayLike, NDArray
from rasterio._affine_types import Affine
from rasterio._typing import CRSInput, Geometry, _GDALOption
from rasterio.control import GroundControlPoint
from rasterio.enums import Resampling
Expand Down Expand Up @@ -60,6 +60,7 @@ def reproject(
resampling: Resampling = ...,
num_threads: int = 1,
init_dest_nodata: bool = True,
tolerance: float = 0.125,
warp_mem_limit: int = 0,
src_geoloc_array: NDArray[Any] | None = None,
**kwargs: _GDALOption,
Expand Down
2 changes: 1 addition & 1 deletion stubs/rasterio/rasterio/windows.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ from collections.abc import Callable, Sequence
from typing import Any, TypeAlias, overload
from typing_extensions import Self, deprecated

from affine import Affine as Affine
from numpy.typing import NDArray
from rasterio._affine_types import Affine
from rasterio.errors import RasterioDeprecationWarning as RasterioDeprecationWarning, WindowError as WindowError

_Bounds: TypeAlias = tuple[float, float, float, float]
Expand Down