# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/05_isnp.ipynb.

# %% auto 0
__all__ = ['npmatrix', 'npndarray', 'ismtx', 'isarr']

# %% ../nbs/05_isnp.ipynb 4
from typing import TypeGuard, ForwardRef, TypeAlias
try: from numpy import matrix, ndarray
except ImportError: matrix, ndarray = list, list
npmatrix: TypeAlias   = ForwardRef('np.matrix',  module='numpy', is_class=True)
npndarray: TypeAlias  = ForwardRef('np.ndarray', module='numpy', is_class=True)

# %% ../nbs/05_isnp.ipynb 6
def ismtx(x) -> TypeGuard[npmatrix]:
    '''Check if `x` is an `np.matrix`.'''
    return isinstance(x, matrix)

def isarr(x) -> TypeGuard[npndarray]:
    '''Check if `x` is an `np.ndarray`.'''
    return isinstance(x, ndarray)
