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

Bas Couwenberg gitlab at salsa.debian.org
Sat Dec 15 08:54:48 GMT 2018


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


Commits:
76464852 by Bas Couwenberg at 2018-12-15T08:33:44Z
New upstream version 1.0.13
- - - - -


5 changed files:

- CHANGES.txt
- rasterio/__init__.py
- rasterio/_io.pyx
- rasterio/io.py
- tests/test_memoryfile.py


Changes:

=====================================
CHANGES.txt
=====================================
@@ -1,6 +1,11 @@
 Changes
 =======
 
+1.0.13 (2018-12-14)
+-------------------
+
+- Fix a buffer dttype mismatch on Windows introduced in 1.0.12 (#1579).
+
 1.0.12 (2018-12-10)
 -------------------
 


=====================================
rasterio/__init__.py
=====================================
@@ -42,7 +42,7 @@ import rasterio.path
 
 
 __all__ = ['band', 'open', 'pad', 'Env']
-__version__ = "1.0.12"
+__version__ = "1.0.13"
 __gdal_version__ = gdal_version()
 
 # Rasterio attaches NullHandler to the 'rasterio' logger and its


=====================================
rasterio/_io.pyx
=====================================
@@ -121,7 +121,7 @@ cdef int io_auto(data, GDALRasterBandH band, bint write, int resampling=0) excep
         return io_band(band, write, 0.0, 0.0, width, height, data,
                        resampling=resampling)
     elif ndims == 3:
-        indexes = np.arange(1, data.shape[0] + 1).astype('int')
+        indexes = np.arange(1, data.shape[0] + 1, dtype='intp')
         return io_multi_band(band, write, 0.0, 0.0, width, height, data,
                              indexes, resampling=resampling)
     else:
@@ -670,7 +670,7 @@ cdef class DatasetReaderBase(DatasetBase):
 
         # Call io_multi* functions with C type args so that they
         # can release the GIL.
-        indexes_arr = np.array(indexes).astype('int')
+        indexes_arr = np.array(indexes, dtype='intp')
         indexes_count = <int>indexes_arr.shape[0]
 
         if masks:
@@ -1400,7 +1400,7 @@ cdef class DatasetWriterBase(DatasetReaderBase):
             width = <int>self.width
             height = <int>self.height
 
-        indexes_arr = np.array(indexes, dtype=int)
+        indexes_arr = np.array(indexes, dtype='intp')
         indexes_count = <int>indexes_arr.shape[0]
         retval = io_multi_band(self._hds, 1, xoff, yoff, width, height,
                                src, indexes_arr)


=====================================
rasterio/io.py
=====================================
@@ -127,7 +127,7 @@ class MemoryFile(MemoryFileBase):
             raise IOError("I/O operation on closed file.")
         if self.exists():
             log.debug("VSI path: {}".format(vsi_path.path))
-            return DatasetReader(vsi_path, mode='r+', driver=driver, **kwargs)
+            return DatasetReader(vsi_path, driver=driver, **kwargs)
         else:
             writer = get_writer_for_driver(driver)
             return writer(vsi_path, 'w+', driver=driver, width=width,


=====================================
tests/test_memoryfile.py
=====================================
@@ -220,7 +220,6 @@ def test_zip_file_object_read(path_zip_file):
                 assert src.read().shape == (3, 768, 1024)
 
 
- at pytest.mark.xfail(reason="Unknown bug in MemoryFile implementation")
 def test_vrt_memfile():
     """Successfully read an in-memory VRT"""
     with open('tests/data/white-gemini-iv.vrt') as vrtfile:
@@ -248,7 +247,7 @@ def test_write_plus_mode():
 
 
 def test_write_plus_model_jpeg():
-    with MemoryFile() as memfile:
+    with rasterio.Env(), MemoryFile() as memfile:
         with memfile.open(driver='JPEG', dtype='uint8', count=3, height=32, width=32, crs='epsg:3226', transform=Affine.identity() * Affine.scale(0.5, -0.5)) as dst:
             dst.write(numpy.full((32, 32), 255, dtype='uint8'), 1)
             dst.write(numpy.full((32, 32), 204, dtype='uint8'), 2)



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

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/rasterio/commit/764648523b16f20bcbb78ae6c672a737640d3157
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/20181215/163553a1/attachment-0001.html>


More information about the Pkg-grass-devel mailing list