array_split.split.convert_halo_to_array_form

array_split.split.convert_halo_to_array_form(halo, ndim)[source]

Converts the halo argument to a (ndim, 2) shaped array.

Parameters:
  • halo (None, int, an ndim length sequence of int or (ndim, 2) shaped array of int) – Halo to be converted to (ndim, 2) shaped array form.
  • ndim (int) – Number of dimensions.
Return type:

numpy.ndarray

Returns:

A (ndim, 2) shaped array of numpy.int64 elements.

Examples:

>>> convert_halo_to_array_form(halo=2, ndim=4)
array([[2, 2],
       [2, 2],
       [2, 2],
       [2, 2]])
>>> convert_halo_to_array_form(halo=[0, 1, 2], ndim=3)
array([[0, 0],
       [1, 1],
       [2, 2]])
>>> convert_halo_to_array_form(halo=[[0, 1], [2, 3], [3, 4]], ndim=3)
array([[0, 1],
       [2, 3],
       [3, 4]])