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: |
@@ -344,6 +344,18 b' class TestView(ClusterTestCase, ParametricTestCase):' | |||
|
344 | 344 | it = iter(arr) |
|
345 | 345 | r = view.map_sync(lambda x:x, arr) |
|
346 | 346 | self.assertEqual(r, list(arr)) |
|
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) | |
|
347 | 359 | |
|
348 | 360 | def test_scatter_gather_nonblocking(self): |
|
349 | 361 | data = range(16) |
General Comments 0
You need to be logged in to leave comments.
Login now