pysdic.core.property_container.PropertyContainer.reshape#

PropertyContainer.reshape(key, new_shape)[source]#

Reshape the attributes of a property, keeping the first dimension \(N\).

For example, a property of shape \((N, 9)\) can be reshaped to \((N, 3, 3)\) with new_shape=(3, 3).

Parameters:
  • key (str) – The name of the property.

  • new_shape (Union[Integral, Tuple[int, ...]]) – The new shape of the attributes (without \(N\)). It must contain the same number of attributes as the current shape.

Raises:

ValueError – If the number of attributes changes, or if the new shape is not 2D while force_2d is enabled.

Return type:

None