Show More
@@ -232,7 +232,8 b' class ParallelFunction(RemoteFunction):' | |||
|
232 | 232 | for seq in sequences: |
|
233 | 233 | part = self.mapObject.getPartition(seq, index, nparts, maxlen) |
|
234 | 234 | args.append(part) |
|
235 | if not any(args): | |
|
235 | ||
|
236 | if sum([len(arg) for arg in args]) == 0: | |
|
236 | 237 | continue |
|
237 | 238 | |
|
238 | 239 | if self._mapping: |
@@ -342,9 +342,21 b' class TestView(ClusterTestCase, ParametricTestCase):' | |||
|
342 | 342 | arr = range(101) |
|
343 | 343 | # ensure it will be an iterator, even in Python 3 |
|
344 | 344 | it = iter(arr) |
|
345 |
r = view.map_sync(lambda x:x, |
|
|
345 | r = view.map_sync(lambda x: x, it) | |
|
346 | 346 | self.assertEqual(r, list(arr)) |
|
347 | 347 | |
|
348 | @skip_without('numpy') | |
|
349 | def test_map_numpy(self): | |
|
350 | """test map on numpy arrays (direct)""" | |
|
351 | import numpy | |
|
352 | from numpy.testing.utils import assert_array_equal | |
|
353 | ||
|
354 | view = self.client[:] | |
|
355 | # 101 is prime, so it won't be evenly distributed | |
|
356 | arr = numpy.arange(101) | |
|
357 | r = view.map_sync(lambda x: x, arr) | |
|
358 | assert_array_equal(r, arr) | |
|
359 | ||
|
348 | 360 | def test_scatter_gather_nonblocking(self): |
|
349 | 361 | data = range(16) |
|
350 | 362 | view = self.client[:] |
General Comments 0
You need to be logged in to leave comments.
Login now