def add_dummy_padding(x, depth, boundary):
 for (k, v) in boundary.items():
  if (v == 'none'):
   d = depth[k]
   empty_shape = list(x.shape)
   empty_shape[k] = d
   empty_chunks = list(x.chunks)
   empty_chunks[k] = (d,)
   empty = wrap.empty(empty_shape, chunks=empty_chunks, dtype=x.dtype)
   out_chunks = list(x.chunks)
   ax_chunks = list(out_chunks[k])
   ax_chunks[0] += d
   ax_chunks[(-1)] += d
   out_chunks[k] = ax_chunks
   x = concatenate([empty, x, empty], axis=k)
   x = x.rechunk(out_chunks)
 return x

def add_dummy_padding ( x , depth , boundary ) : for ( k , v ) in boundary . items ( ) : if ( v == 'none' ) : d = depth [ k ] empty_shape = list ( x . shape ) empty_shape [ k ] = d empty_chunks = list ( x . chunks ) empty_chunks [ k ] = ( d , ) empty = wrap . empty ( empty_shape , chunks = empty_chunks , dtype = x . dtype ) out_chunks = list ( x . chunks ) ax_chunks = list ( out_chunks [ k ] ) ax_chunks [ 0 ] += d ax_chunks [ ( - 1 ) ] += d out_chunks [ k ] = ax_chunks x = concatenate ( [ empty , x , empty ] , axis = k ) x = x . rechunk ( out_chunks ) return x
pads an array which has none as the boundary type .