diff --git a/docs/ndarray.md b/docs/ndarray.md index 5559ada..7ebba29 100644 --- a/docs/ndarray.md +++ b/docs/ndarray.md @@ -21,7 +21,8 @@ so any array syntax is valid there. (see [TODO](todo) for caveats) ```python from typing import Union from pydantic import BaseModel -from numpydantic import NDArray, Shape, UInt8, Float, Int +from src.numpydantic import NDArray, Shape, UInt8, Float, Int + class Image(BaseModel): """ diff --git a/numpydantic/__init__.py b/numpydantic/__init__.py deleted file mode 100644 index d0cd680..0000000 --- a/numpydantic/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# ruff: noqa: E402 -# ruff: noqa: F401 -# ruff: noqa: I001 -from numpydantic.monkeypatch import apply_patches - -apply_patches() - -from numpydantic.ndarray import NDArray - -# convenience imports for typing - finish this! -from typing import Any - -from nptyping import Float, Int, Number, Shape, UInt8 diff --git a/src/numpydantic/__init__.py b/src/numpydantic/__init__.py index e69de29..9abd141 100644 --- a/src/numpydantic/__init__.py +++ b/src/numpydantic/__init__.py @@ -0,0 +1,11 @@ +# ruff: noqa: E402 +# ruff: noqa: F401 +# ruff: noqa: I001 +from numpydantic.monkeypatch import apply_patches +apply_patches() + +from numpydantic.ndarray import NDArray + +__all__ = [ + "NDArray" +] \ No newline at end of file diff --git a/numpydantic/maps.py b/src/numpydantic/maps.py similarity index 100% rename from numpydantic/maps.py rename to src/numpydantic/maps.py diff --git a/numpydantic/monkeypatch.py b/src/numpydantic/monkeypatch.py similarity index 100% rename from numpydantic/monkeypatch.py rename to src/numpydantic/monkeypatch.py diff --git a/numpydantic/ndarray.py b/src/numpydantic/ndarray.py similarity index 99% rename from numpydantic/ndarray.py rename to src/numpydantic/ndarray.py index ffd3733..57cc46b 100644 --- a/numpydantic/ndarray.py +++ b/src/numpydantic/ndarray.py @@ -3,11 +3,12 @@ Extension of nptyping NDArray for pydantic that allows for JSON-Schema serializa * Order to store data in (row first) """ + import base64 import sys from collections.abc import Callable from copy import copy -from typing import TYPE_CHECKING, Any, Union +from typing import Any import blosc2 import nptyping.structure diff --git a/numpydantic/proxy.py b/src/numpydantic/proxy.py similarity index 100% rename from numpydantic/proxy.py rename to src/numpydantic/proxy.py diff --git a/tests/test_ndarray.py b/tests/test_ndarray.py index 6deb547..8baa118 100644 --- a/tests/test_ndarray.py +++ b/tests/test_ndarray.py @@ -7,7 +7,7 @@ import numpy as np from pydantic import BaseModel, ValidationError, Field from nptyping import Shape, Number -from numpydantic.ndarray import NDArray +from numpydantic import NDArray from numpydantic.proxy import NDArrayProxy