[Git][debian-gis-team/rasterio][upstream] New upstream version 1.4.1

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Tue Oct 1 04:31:46 BST 2024



Bas Couwenberg pushed to branch upstream at Debian GIS Project / rasterio


Commits:
477a2024 by Bas Couwenberg at 2024-10-01T05:20:38+02:00
New upstream version 1.4.1
- - - - -


10 changed files:

- CHANGES.txt
- rasterio/__init__.py
- rasterio/_io.pyx
- rasterio/transform.py
- setup.py
- tests/test_pyopener.py
- tests/test_read_boundless.py
- tests/test_rio_info.py
- tests/test_subdatasets.py
- tests/test_transform.py


Changes:

=====================================
CHANGES.txt
=====================================
@@ -1,7 +1,26 @@
 Changes
 =======
 
-1.4.0 (2024-09-25)
+1.4.1 (2024-09-30)
+------------------
+
+Version 1.4.1 fixes two regressions, improves compatibility with GDAL 3.10, and
+specifies a testing dependency that was previously undeclared..
+
+Bug fixes:
+
+- The xy() transform method once again accepts grid coordinates as input
+  (#3198).
+- A dataset's index() method again returns a tuple of ints, not floats (#3195).
+
+Other changes:
+
+- GDAL 3.10 will disable opening "MEM::" datasets by default. Rasterio's
+  internal usage of these datasets is wrapped in special configuration.
+- New color interpretation constants of GDAL 3.10 have been added to the
+  ColorInterp enum (#3194).
+
+1.4.0 (2024-09-23)
 ------------------
 
 This is the final 1.4.0 release. The package version, credits, and citation


=====================================
rasterio/__init__.py
=====================================
@@ -81,7 +81,7 @@ except ImportError:
     have_vsi_plugin = False
 
 __all__ = ['band', 'open', 'pad', 'Band', 'Env', 'CRS']
-__version__ = "1.4.0"
+__version__ = "1.4.1"
 __gdal_version__ = gdal_version()
 __proj_version__ = ".".join([str(version) for version in get_proj_version()])
 __geos_version__ = ".".join([str(version) for version in get_geos_version()])


=====================================
rasterio/_io.pyx
=====================================
@@ -39,7 +39,7 @@ from rasterio.windows import Window, intersection
 from libc.stdio cimport FILE
 
 from rasterio.enums import Resampling
-from rasterio.env import GDALVersion
+from rasterio.env import Env, GDALVersion
 from rasterio.errors import ResamplingAlgorithmError, DatasetIOShapeError
 from rasterio._base cimport get_driver_name, DatasetBase
 from rasterio._err cimport exc_wrap_int, exc_wrap_pointer, exc_wrap_vsilfile, StackChecker
@@ -2253,7 +2253,8 @@ cdef class MemoryDataset(DatasetWriterBase):
 
         with warnings.catch_warnings():
             warnings.simplefilter("ignore")
-            super().__init__(_parse_path(datasetname), "r+")
+            with Env(GDAL_MEM_ENABLE_OPEN=True):
+                super().__init__(_parse_path(datasetname), "r+")
             if crs is not None:
                 self.crs = crs
             if transform is not None:


=====================================
rasterio/transform.py
=====================================
@@ -131,7 +131,7 @@ class TransformMethodsMixin:
             transform = transform[0]
         if not transform:
             raise AttributeError(f"Dataset has no {transform_method}")
-        return rowcol(transform, x, y, zs=z, op=op, **rpc_options)
+        return tuple(int(val) for val in rowcol(transform, x, y, zs=z, op=op, **rpc_options))
 
 
 def get_transformer(transform, **rpc_options):
@@ -339,10 +339,6 @@ class TransformerBase:
 
         try:
             broadcasted = np.broadcast(xs, ys, zs)
-            if broadcasted.ndim != 1:
-                raise TransformError(
-                    "Input coordinates must be broadcastable to a 1d array"
-                )
         except ValueError as error:
             raise TransformError() from error
 


=====================================
setup.py
=====================================
@@ -270,6 +270,7 @@ extra_reqs = {
     "s3": ["boto3>=1.2.4"],
     "test": [
         "boto3>=1.2.4",
+        "fsspec",
         "hypothesis",
         "packaging",
         "pytest-cov>=2.2.0",


=====================================
tests/test_pyopener.py
=====================================
@@ -70,6 +70,7 @@ def test_opener_fsspec_fs():
         assert profile["count"] == 3
 
 
+ at pytest.mark.network
 def test_opener_fsspec_http_fs():
     """Use fsspec http filesystem as opener."""
     fs = fsspec.filesystem("http")
@@ -170,6 +171,7 @@ def test_fsspec_msk_sidecar():
             assert val == [MaskFlags.per_dataset]
 
 
+ at pytest.mark.network
 def test_fsspec_http_msk_sidecar():
     """Use fsspec http filesystem as opener."""
     fs = fsspec.filesystem("http")


=====================================
tests/test_read_boundless.py
=====================================
@@ -146,6 +146,7 @@ def test_msk_read_masks(path_rgb_msk_byte_tif):
         assert msk.mean() > 90
 
 
+ at pytest.mark.network
 def test_issue1982(capfd):
     """See a curl request for overview file"""
     with rasterio.Env(CPL_CURL_VERBOSE=True), rasterio.open(


=====================================
tests/test_rio_info.py
=====================================
@@ -9,7 +9,7 @@ from .conftest import credentials
 
 
 with rasterio.Env() as env:
-    HAVE_NETCDF = 'NetCDF' in env.drivers().keys()
+    HAVE_NETCDF = "netCDF" in env.drivers().keys()
 
 
 def test_env(runner):


=====================================
tests/test_subdatasets.py
=====================================
@@ -3,7 +3,7 @@ import pytest
 import rasterio
 
 with rasterio.Env() as env:
-    HAVE_NETCDF = "NetCDF" in env.drivers().keys()
+    HAVE_NETCDF = "netCDF" in env.drivers().keys()
     HAVE_HDF5 = "HDF5" in env.drivers().keys()
 
 


=====================================
tests/test_transform.py
=====================================
@@ -510,6 +510,7 @@ def test_2421_rpc_height_ignored():
         assert abs(x2 - x1) > 0
         assert abs(y2 - y1) > 0
 
+
 def test_gcp_transformer_tps_option():
     """Use thin plate spline transformation when requested."""
     # TPS ensures that GCPs are (to within some precision) solutions of the transformation.
@@ -522,3 +523,10 @@ def test_gcp_transformer_tps_option():
             row_, col_ = transformer.rowcol(gcp.x, gcp.y, op=lambda arg: arg)
             assert gcp.row == pytest.approx(row_)
             assert gcp.col == pytest.approx(col_)
+
+
+def test_transform_grid():
+    """Accept a grid, see gh-3191."""
+    with rasterio.open('tests/data/RGB.byte.tif') as src:
+        cols, rows = numpy.mgrid[0:3, 0:3]
+        xs, ys = src.xy(cols, rows)



View it on GitLab: https://salsa.debian.org/debian-gis-team/rasterio/-/commit/477a2024a7597460e936fe35c84bc47525f09fb8

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/rasterio/-/commit/477a2024a7597460e936fe35c84bc47525f09fb8
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20241001/adaf1a7d/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list