WrightTools.kit.valid_index

WrightTools.kit.valid_index(index, shape) → tuple[source]

Get a valid index for a broadcastable shape.

Parameters
  • index (tuple) – Given index.

  • shape (tuple of int) – Shape.

Returns

Valid index.

Return type

tuple