def eval_in_mem(arr, iter_dims, chunk=1, dump_result=False): logging.info("starting in-mem with dims=%s chunk=%d", str(iter_dims), chunk) t = time.time() res = blaze.zeros(arr.dshape) simple_execute_write(arr._data, res._data, iter_dims=iter_dims, chunk=chunk) logging.info("took %f secs.\n", time.time()-t); if dump_result: logging.debug(res) return res
res_dd = NumPyDataDescriptor(np.empty(shape, dtype=dtype)) ex.run_write(res_dd) res = blaze.Array(res_dd) print (res) #for i in xrange(len(dims)-1): # test_dims(d,i) src_dd = d._data sh, dt = to_numpy(src_dd.dshape) banner('Executive interface (write interface)') dst_dd = NumPyDataDescriptor(np.empty(sh, dtype=dt)) simple_execute_write(src_dd, dst_dd) print(blaze.Array(dst_dd)) del dst_dd banner('Executive interface (append interface)') dst_dd = BLZDataDescriptor(blz.zeros((0,)+sh[1:], dtype=dt, rootdir='exec_test.blz')) simple_execute_append(src_dd,dst_dd) print(blaze.Array(dst_dd)) blaze.drop(blaze.Persist('exec_test.blz')) del(dst_dd)