[python-dtcwt] 129/497: testxfm3: replace np.meshgrid with np.mgrid

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:05:57 UTC 2015


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

ghisvail-guest pushed a commit to branch debian/sid
in repository python-dtcwt.

commit c1278e0c9b988c509174de11ff81c44cfab980ab
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date:   Thu Nov 7 12:14:27 2013 +0000

    testxfm3: replace np.meshgrid with np.mgrid
    
    Replace the usage of meshgrid with an analogous mgrid indexing solution.
    This is a little more ugly but it is compatible with older numpys.
    
    Closes #20.
---
 tests/testxfm3.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/testxfm3.py b/tests/testxfm3.py
index 5a90256..08569ab 100644
--- a/tests/testxfm3.py
+++ b/tests/testxfm3.py
@@ -12,8 +12,8 @@ TOLERANCE = 1e-12
 def setup():
     global ellipsoid
 
-    grid = np.arange(-(GRID_SIZE>>1), (GRID_SIZE>>1))
-    X, Y, Z = np.meshgrid(grid, grid, grid)
+    grid = slice(-(GRID_SIZE>>1), (GRID_SIZE>>1))
+    X, Y, Z = np.mgrid[grid,grid,grid]
 
     Y *= 1.2
     Z *= 1.4

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-dtcwt.git



More information about the debian-science-commits mailing list