check_raise#
- check_raise(obj, mtype: str, scitype: str = None, var_name: str = 'input')[source]#
Check object for compliance with mtype specification, raise errors.
See glossary for explanations of :glossary:`mtype` and :glossary:`scitype`.
- Parameters:
- obj
object to check
- mtype: str or list of str, mtype to check obj as
valid mtype strings are in datatypes.MTYPE_REGISTER (1st column)
- scitype: str, optional; default = inferred from mtype
scitype to check obj against
if inferred from mtype, list elements of mtype need not have same scitype
valid mtype strings are can be found in Data Format Specifications
- var_name: str, optional, default=”input”
name of input in error messages
- Returns:
- valid: bool - True if obj complies with the specification
same as when return argument of check_is_mtype is True otherwise raises an error
- Raises:
- TypeError with informative message if obj does not comply
- TypeError if no checks defined for mtype/scitype combination
- ValueError if mtype input argument is not of expected type