This is done by adding sym.util.check_matrix_size_and_numpify and calling it on the matrix inputs (when use_numba=False and reshape_vectors=True). This function converts list arguments to ndarrays and checks that the shape is what is expected.
Note, numpy only raises a deprecation warning if a ragged nested list is passed in.
If use_numba=True, just performs an inline check on the shape of the input, raising an IndexError if it is not what was expected. It never performs a reshape on matrix arguments.
Also adds the type alias sym.util.MatrixType and sym.util.VectorType. This is to make the type annotations less verbose.
This is done by adding
sym.util.check_matrix_size_and_numpify
and calling it on the matrix inputs (whenuse_numba=False
andreshape_vectors=True
). This function converts list arguments to ndarrays and checks that the shape is what is expected.Note, numpy only raises a deprecation warning if a ragged nested list is passed in.
If
use_numba=True
, just performs an inline check on the shape of the input, raising anIndexError
if it is not what was expected. It never performs a reshape on matrix arguments.Also adds the type alias
sym.util.MatrixType
andsym.util.VectorType
. This is to make the type annotations less verbose.