[rasterio] 01/02: Fix compatibility with numpy < 1.9

Johan Van de Wauw johanvdw-guest at moszumanska.debian.org
Mon Jun 29 21:45:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

johanvdw-guest pushed a commit to branch master
in repository rasterio.

commit 067bf4edfbfc496ac3a32974b9f31bd1c0ff2140
Author: Johan Van de Wauw <johan.vandewauw at gmail.com>
Date:   Mon Jun 29 23:38:23 2015 +0200

    Fix compatibility with numpy < 1.9
---
 .../0003-Fix-compatibility-with-numpy-1.9.patch    | 22 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 23 insertions(+)

diff --git a/debian/patches/0003-Fix-compatibility-with-numpy-1.9.patch b/debian/patches/0003-Fix-compatibility-with-numpy-1.9.patch
new file mode 100644
index 0000000..950a67e
--- /dev/null
+++ b/debian/patches/0003-Fix-compatibility-with-numpy-1.9.patch
@@ -0,0 +1,22 @@
+From: Johan Van de Wauw <johan.vandewauw at gmail.com>
+Date: Mon, 29 Jun 2015 23:37:23 +0200
+Subject: Fix compatibility with numpy <1.9
+
+---
+ rasterio/rio/calc.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/rasterio/rio/calc.py b/rasterio/rio/calc.py
+index 9a8c4bb..5af4d7c 100644
+--- a/rasterio/rio/calc.py
++++ b/rasterio/rio/calc.py
+@@ -122,6 +122,9 @@ def calc(ctx, command, files, output, name, dtype, masked):
+ 
+             res = snuggs.eval(command, **ctxkwds)
+ 
++            if type(res) is np.ma.core.MaskedArray:
++                res = res.filled(kwargs['nodata'])
++
+             if len(res.shape) == 3:
+                 results = np.ndarray.astype(res, dtype, copy=False)
+             else:
diff --git a/debian/patches/series b/debian/patches/series
index e97ee88..3c98fe7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 0001-Rename-rio-to-rasterio-Closes-788463.patch
 0002-Fix-compatibility-with-Cython-0.22.patch
+0003-Fix-compatibility-with-numpy-1.9.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/rasterio.git



More information about the Pkg-grass-devel mailing list