extend_scalar#

PySeismoSoil.helper_generic.extend_scalar(scalar: float | int | numpy.number, length: int) ndarray[source]#

“Extend” a scalar (float, int, or numpy.number type) into a 1D numpy array whose length is length and whose elements are all scalar.

Parameters:
  • scalar (float | int | np.number) – A single number.

  • length (int) – The length of the desired output.

Returns:

array – A 1D numpy array with length length and elements of value scalar.

Return type:

np.ndarray

Raises:

TypeError – When scalar is not of a supported type