splinepy.utils.data.enforce_contiguous#

splinepy.utils.data.enforce_contiguous(array, dtype=None, asarray=False)[source]#

If input is an instance / subclass of np.ndarray, this will check if they are configuous. If so, returns same object, else turns makes it contiguous and returns.

Parameters:
  • array (array-like) – data to be transformed

  • dtype (type) – base data type (default float)

  • asarray (bool) – also transform list or tuple to np.ndarray

Returns:

contiguous_array

Return type:

array-like