odatse.util.read_matrix module

odatse.util.read_matrix.read_matrix(inp: str | List[List[float]]) ndarray[source]

Converts an input string or list of lists of floats into a numpy array matrix.

Parameters:

inp (Union[str, List[List[float]]]) – Input data, either as a string with rows of space-separated numbers or a list of lists of floats.

Returns:

A numpy array representing the matrix.

Return type:

np.ndarray

Raises:

RuntimeError – If the input is not a matrix.

odatse.util.read_matrix.read_vector(inp: str | List[float]) ndarray[source]

Converts an input string or list of floats into a numpy array vector.

Parameters:

inp (Union[str, List[float]]) – Input data, either as a space-separated string of numbers or a list of floats.

Returns:

A numpy array representing the vector.

Return type:

np.ndarray

Raises:

RuntimeError – If the input is not a vector.