"""Types for numpydanticNote that these are types as in python typing types, not classes."""# ruff: noqa: D102fromtypingimportAny,Protocol,Tuple,Union,runtime_checkablefromnptypingimportDTypeShapeType=Union[Tuple[int,...],Any]DtypeType=Union[str,type,Any,DType]
[docs]@runtime_checkableclassNDArrayType(Protocol):"""A protocol for describing types that should be considered ndarrays"""@propertydefdtype(self)->DtypeType:...@propertydefshape(self)->ShapeType:...def__getitem__(self,key:Union[int,slice])->"NDArrayType":...def__setitem__(self,key:Union[int,slice],value:"NDArrayType"):...