Skip to content

rio info --stats uses deprecated .statistics method #3379

@scottstanie

Description

@scottstanie

Expected behavior and actual behavior.

For example: I expected to use the rio info --stats CLI tool without warnings or errors.

Steps to reproduce the problem.

For any gdal-readable file, running rio info --stats produces a RasterioDeprecationWarning

$ uvx --from rasterio rio info --stats a.tif
Installed 9 packages in 111ms
/Users/staniewi/.cache/uv/archive-v0/ZmwDk50t3pj1msm4FDTbO/lib/python3.13/site-packages/rasterio/rio/info.py:118: RasterioDeprecationWarning: statistics() will be removed in 2.0.0. Please switch to stats().
  st = src.statistics(bidx)
0.0 127.0 123.80087779610803 19.901108939425338

Environment Information

  • Output from: rio --show-versions or python -c "import rasterio; rasterio.show_versions()"
$ uvx --from rasterio rio --show-versions
rasterio info:
  rasterio: 1.4.3
      GDAL: 3.9.3
      PROJ: 9.4.1
      GEOS: 0.0.0
 PROJ DATA: /Users/staniewi/.cache/uv/archive-v0/ZmwDk50t3pj1msm4FDTbO/lib/python3.13/site-packages/rasterio/proj_data
 GDAL DATA: /Users/staniewi/.cache/uv/archive-v0/ZmwDk50t3pj1msm4FDTbO/lib/python3.13/site-packages/rasterio/gdal_data

System:
    python: 3.13.1 (main, Jan 14 2025, 23:31:50) [Clang 19.1.6 ]
executable: /Users/staniewi/.cache/uv/archive-v0/ZmwDk50t3pj1msm4FDTbO/bin/python
   machine: macOS-15.6-arm64-arm-64bit-Mach-O

Python deps:
    affine: 2.4.0
     attrs: 25.3.0
   certifi: 2025.08.03
     click: 8.2.1
     cligj: 0.7.2
    cython: None
     numpy: 2.3.2
click-plugins: None
setuptools: None

Installation Method

uv (PyPI)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions