Skip to content

v1.8.0 - `NDArraySchema` Annotated type specification

Latest

Choose a tag to compare

@sneakers-the-rat sneakers-the-rat released this 27 Feb 02:02
d213a8c

Version Support

  • #63 -
    Drop support for python 3.9, add (testing) support for 3.14

Added

  • #41
    #62
    #64 -
    Add a {func}.NDArraySchema Annotated style specification to support static type checkers:
from numpydantic import NDArraySchema

class MyModel(BaseModel):
  array: Annotated[np.ndarray, NDArraySchema((1, 2, 3), np.uint8)]
  • Allow shape to be used as a callable rather than a [] generic
  • Allow shape to accept shape arguments as *args rather than a single string

Testing

  • Added pyright testing