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

# %% auto 0
__all__ = ['isnpnan', 'isrecarray', 'isnprecarray', 'isnprarr', 'isnpmatrix', 'isndmatrix', 'ismatrix', 'isnpmtx', 'ismtx',
           'isndarray', 'isnparray', 'isnparr', 'isarr', 'isarray']

# %% ../nbs/60_isnp.ipynb 4
from typing import TypeGuard
from typing import Union

# %% ../nbs/60_isnp.ipynb 5
from .atyp import (npnan, npNaN, npNAN, npmatrix, npndarray, nprecarray)
from .atyp import (nan, NaN, NAN, matrix, ndarray, recarray)

# %% ../nbs/60_isnp.ipynb 7
def isnpnan(x) -> TypeGuard[Union[npnan, npNaN, npNAN]]:
    "Check if `x` is any of  `np.nan`, `np.NaN`, or `np.NAN`."
    return x is nan or x is NaN or x is NAN

# %% ../nbs/60_isnp.ipynb 9
def isrecarray(x) -> TypeGuard[nprecarray]:
    '''Check if `x` is an `np.recarray`.
    
    See Also
    --------
    isrecarray : Alias for `isrecarray`.
    isnprecarray : Alias for `isrecarray`.
    '''
    return isinstance(x, recarray)

def isnprecarray(x) -> TypeGuard[nprecarray]:
    '''Check if `x` is an `np.recarray`.
    
    See Also
    --------
    isrecarray : Alias for `isnprecarray`.
    isnprecarray : Alias for `isnprecarray`.
    '''
    return isinstance(x, recarray)

def isnprarr(x) -> TypeGuard[nprecarray]:
    '''Check if `x` is an `np.recarray`.
    
    See Also
    --------
    isrecarray : Alias for `isnprarr`.
    isnprecarray : Alias for `isnprarr`.
    '''
    return isinstance(x, recarray)

# %% ../nbs/60_isnp.ipynb 11
def isnpmatrix(x) -> TypeGuard[npmatrix]:
    '''Check if `x` is an `np.matrix`.
    
    See Also
    --------
    ismtx : Alias for `isnpmatrix`.
    isnpmtx : Alias for `isnpmatrix`.
    ismatrix : Alias for `isnpmatrix`.
    isndmatrix : Alias for `isnpmatrix`.
    '''
    return isinstance(x, matrix)


def isndmatrix(x) -> TypeGuard[npmatrix]:
    '''Check if `x` is an `np.matrix`.
    
    See Also
    --------
    ismtx : Alias for `isndmatrix`.
    isnpmtx : Alias for `isndmatrix`.
    ismatrix : Alias for `isndmatrix`.
    isnpmatrix : Alias for `isndmatrix`.
    '''
    return isnpmatrix(x)

def ismatrix(x) -> TypeGuard[npmatrix]:
    '''Check if `x` is an `np.matrix`.
    
    See Also
    --------
    ismtx : Alias for `ismatrix`.
    isnpmtx : Alias for `ismatrix`.
    isndmatrix : Alias for `ismatrix`.
    isnpmatrix : Alias for `ismatrix`.
    '''
    return isnpmatrix(x)

def isnpmtx(x) -> TypeGuard[npmatrix]:    
    '''Check if `x` is an `np.matrix`.

    See Also
    --------
    ismtx : Alias for `isnpmtx`.
    ismatrix : Alias for `isnpmtx`.
    isndmatrix : Alias for `isnpmtx`.
    isnpmatrix : Alias for `isnpmtx`.
    '''
    return isnpmatrix(x)

def ismtx(x) -> TypeGuard[npmatrix]:
    '''Check if `x` is an `np.matrix`.
    
    See Also
    --------
    isnpmtx : Alias for `ismtx`.
    ismatrix : Alias for `ismtx`.
    isndmatrix : Alias for `ismtx`.
    isnpmatrix : Alias for `ismtx`.
    '''    
    return isnpmatrix(x)

# %% ../nbs/60_isnp.ipynb 13
def isndarray(x) -> TypeGuard[npndarray]:
    '''Check if `x` is an `np.ndarray` (and not an `np.matrix`).
    
    Notes
    -----
    `np.matrix` is a subclass of `np.ndarray`, so `isinstance(x, np.ndarray)` 
    will return `True` for `np.matrix` objects.

    See Also
    --------
    isarr : Alias for `isndarray`.
    isnparr : Alias for `isndarray`.
    isarray : Alias for `isndarray`.
    isnparray : Alias for `isndarray`.
    '''
    return isinstance(x, ndarray) and not isnpmatrix(x)


def isnparray(x) -> TypeGuard[npndarray]:
    '''Check if `x` is an `np.ndarray` (and not an `np.matrix`).
    
    Notes
    -----
    `np.matrix` is a subclass of `np.ndarray`, so `isinstance(x, np.ndarray)` 
    will return `True` for `np.matrix` objects.

    See Also
    --------
    isarr : Alias for `isnparray`.
    isnparr : Alias for `isnparray`.
    isarray : Alias for `isnparray`.
    isndarray : Alias for `isnparray`.
    '''
    return isndarray(x)


def isnparr(x) -> TypeGuard[npndarray]:
    '''Check if `x` is an `np.ndarray` (and not an `np.matrix`).
    
    Notes
    -----
    `np.matrix` is a subclass of `np.ndarray`, so `isinstance(x, np.ndarray)` 
    will return `True` for `np.matrix` objects.
    
    See Also
    --------
    isarr : Alias for `isnparr`.
    isarray : Alias for `isnparr`.
    isnparray : Alias for `isnparr`.
    isndarray : Alias for `isnparr`.
    '''
    return isnparray(x)


def isarr(x) -> TypeGuard[npndarray]:
    '''Check if `x` is an `np.ndarray` (and not an `np.matrix`).
    
    Notes
    -----
    `np.matrix` is a subclass of `np.ndarray`, so `isinstance(x, np.ndarray)` 
    will return `True` for `np.matrix` objects.
    
    See Also
    --------
    isnparr : Alias for `isarr`.
    isarray : Alias for `isarr`.
    isnparray : Alias for `isarr`.
    isndarray : Alias for `isarr`.
    '''
    return isnparray(x)


def isarray(x) -> TypeGuard[npndarray]:
    '''Check if `x` is an `np.ndarray` (and not an `np.matrix`).
    
    Notes
    -----
    `np.matrix` is a subclass of `np.ndarray`, so `isinstance(x, np.ndarray)` 
    will return `True` for `np.matrix` objects.
    
    See Also
    --------
    isarr : Alias for `isarray`.
    isnparr : Alias for `isarray`.
    isnparray : Alias for `isarray`.
    isndarray : Alias for `isarray`.
    '''
    return isnparray(x)
