• full name:

  • parent module:

  • type: function, shape=(None,), dtype=None, allow_incommensurate=False)[source]

Convert a to an numpy array and tile to matching dimension/shape.

This function provides similar functionality as numpys broadcast, but not quite the same: Only scalars are broadcasted to higher dimensions, for a non-scalar, we require the number of dimension to match. If the shape does not match, we repeat periodically, e.g. we tile (3, 4) -> (6, 16), but (4, 4) -> (6, 16) will raise an error.

  • a (scalar | array_like) – The input to be converted to an array. A scalar is reshaped to the desired dimension.

  • shape (tuple of {None | int}) – The desired shape of the array. An entry None indicates arbitrary len >=1. For int entries, tile the array periodically to fit the len.

  • dtype – Optionally specifies the data type.

  • allow_incommensurate (bool) – Whether to raise an Error (False) or still tile to the desired shape and just “crop” in the end.


a_array – A copy of a converted to a numpy ndarray of desired dimension and shape.

Return type: