array_split.ShapeSplitter.__init__

ShapeSplitter.__init__(array_shape, indices_or_sections=None, axis=None, array_start=None, array_itemsize=1, tile_shape=None, max_tile_bytes=None, max_tile_shape=None, sub_tile_shape=None, halo=None, tile_bounds_policy=<property object>)[source]

Initialises parameters which define a split.

Parameters:
  • array_shape (sequence of int) – The shape to be split.
  • indices_or_sections (None, int or sequence of int) – If an integer, indicates the number of elements in the calculated split array. If a sequence, indicates the indices (per axis) at which the splits occur. See Splitting by number of tiles examples.
  • axis (None, int or sequence of int) – If an integer, indicates the axis which is to be split. If a sequence integers, indicates the number of slices per axis, i.e. if axis = [3, 5] then axis 0 is cut into 3 slices and axis 1 is cut into 5 slices for a total of 15 (3*5) rectangular slices in the returned (3, 5) shaped split. See Splitting by number of tiles examples and Splitting by per-axis cut indices examples.
  • array_start (None or sequence of int) – The start index. Defaults to [0,]*len(array_shape). The array indexing extents are assumed to range from array_start to array_start + array_shape. See The array_start parameter examples.
  • array_itemsize (int or sequence of int) – Number of bytes per array element. Only relevant when max_tile_bytes is specified. See Splitting by maximum bytes per tile examples.
  • tile_shape (None or sequence of int) – When not None, specifies explicit shape for tiles. Should be same length as array_shape. See Splitting by tile shape examples.
  • max_tile_bytes (None or int) – The maximum number of bytes for calculated tile_shape. See Splitting by maximum bytes per tile examples.
  • max_tile_shape (None or sequence of int) – Per axis maximum shapes for the calculated tile_shape. Only relevant when max_tile_bytes is specified. Should be same length as array_shape. See Splitting by maximum bytes per tile examples.
  • sub_tile_shape (None or sequence of int) – When not None, the calculated tile_shape will be an even multiple of this sub-tile shape. Only relevant when max_tile_bytes is specified. Should be same length as array_shape. See Splitting by maximum bytes per tile examples.
  • halo (None, int, sequence of int, or (len(array_shape), 2) shaped numpy.ndarray) – How tiles are extended per axis in -ve and +ve directions with halo elements. See The halo parameter examples.
  • tile_bounds_policy (str) – Specifies whether tiles can extend beyond the array boundaries. Only relevant for halo values greater than one. If tile_bounds_policy is ARRAY_BOUNDS then the calculated tiles will not extend beyond the array extents array_start and array_start + array_shape. If tile_bounds_policy is NO_BOUNDS then the returned tiles will extend beyond the array_start and array_start + array_shape extend for positive halo values. See The halo parameter examples.

See also

Examples