Exemplo n.º 1
0
 def _test_process(cls, arrayshape, nproc=2):
     arrin = numpy.zeros(arrayshape)
     # test adding one
     mp = MultiTool(lambda x: numpy.sqrt(x) + 1,
                    nbandsout=arrin.shape[0],
                    nchunks=cls.nchunks,
                    nproc=nproc)
     arrout = mp.process_array(arrin)
     nt.assert_array_equal(numpy.sqrt(arrin) + 1, arrout)
Exemplo n.º 2
0
 def _test_passthrough(cls, arrayshape, nproc=2):
     """ Test passthrough function """
     arrin = numpy.zeros(arrayshape)
     mp = MultiTool(lambda x: x,
                    nbandsout=arrin.shape[0],
                    nchunks=cls.nchunks,
                    nproc=nproc)
     arrout = mp.process_array(arrin)
     nt.assert_array_equal(arrin, arrout)
Exemplo n.º 3
0
 def _test_process(cls, arrayshape, nproc=2):
     arrin = numpy.zeros(arrayshape)
     # test adding one
     mp = MultiTool(lambda x: numpy.sqrt(x) + 1, nbandsout=arrin.shape[0], nchunks=cls.nchunks, nproc=nproc)
     arrout = mp.process_array(arrin)
     nt.assert_array_equal(numpy.sqrt(arrin) + 1, arrout)
Exemplo n.º 4
0
 def _test_passthrough(cls, arrayshape, nproc=2):
     """ Test passthrough function """
     arrin = numpy.zeros(arrayshape)
     mp = MultiTool(lambda x: x, nbandsout=arrin.shape[0], nchunks=cls.nchunks, nproc=nproc)
     arrout = mp.process_array(arrin)
     nt.assert_array_equal(arrin, arrout)