Commits

mattip committed df376da

test, fix creating empty axis iterator

Comments (0)

Files changed (2)

pypy/module/micronumpy/iter.py

             self.backstrides = backstrides[:dim] + [0] + backstrides[dim:]
         self.first_line = True
         self.indices = [0] * len(shape)
-        self._done = False
+        self._done = array.get_size() == 0
         self.offset = array.start
         self.dim = dim
         self.array = array

pypy/module/micronumpy/test/test_numarray.py

         # b = tile(a, (3, 2, 5))
         reps = (3, 4, 5)
         c = array(a, copy=False, subok=True, ndmin=len(reps))
-        print '1',c,c.shape
         d = c.reshape(3, 4, 0)
-        print '2',c,c.shape
         e = d.repeat(3, 0)
-        print '3',c,c.shape,e.shape
         assert e.shape == (9, 4, 0)
 
     def test_type(self):
         a = array(range(100) + range(100) + range(100))
         b = a.argsort()
         assert (b[:3] == [0, 100, 200]).all()
+        a = array([[[]]]).reshape(3,4,0)
+        b = a.argsort()
+        assert b.size == 0
 
     def test_argsort_random(self):
         from numpypy import array
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.