# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/01_grds.ipynb.

# %% auto 0
__all__ = ['isdata', 'isgraph', 'isshaped']

# %% ../nbs/01_grds.ipynb 4
from typing import TypeGuard
from typing import TypeAlias, Callable, Union

# %% ../nbs/01_grds.ipynb 5
from chck import isof, isdf, isds
from hasr import hasr, hasdf, hasshape
from nlit import SHAPE

# %% ../nbs/01_grds.ipynb 6
from itry import pddataframe, ptdataset

# %% ../nbs/01_grds.ipynb 7
from .atyp import DataType, GraphType, Shaped
from .cons import DataTypes, GraphTypes, ShapedTypes

# %% ../nbs/01_grds.ipynb 10
def isdata(x) -> TypeGuard[DataType]:
    "Returns `True` if `x` is a `DataType`"
    return isof(x, DataTypes)

def isgraph(x) -> TypeGuard[GraphType]:
    "Returns `True` if `x` is a `GraphType`"
    return isof(x, GraphTypes)

# %% ../nbs/01_grds.ipynb 11
def isshaped(x: object) -> TypeGuard[Shaped]:
    return isof(x, ShapedTypes) and hasshape(x)
