check_two_column_format#

PySeismoSoil.helper_generic.check_two_column_format(something: Any, name: str | None = None, ensure_non_negative: bool = False, at_least_two_columns: bool = False) None[source]#

Check that something is a 2D numpy array with two columns. Raises an error if something is the wrong format.

Parameters:
  • something (Any) – Any Python object.

  • name (str | None) – The name of something to be displayed in the potential error message.

  • ensure_non_negative (bool) – Whether to ensure that all values in something >= 0.

  • at_least_two_columns (bool) – Whether to relax the constraints to from “exactly 2 columns” to “at least two columns”.

Raises:
  • TypeError – When the input has unexpected type

  • ValueError – When the input has unexpected value