From 1138230a99a31705f5f46ffb7fefc86a18d8ae99 Mon Sep 17 00:00:00 2001 From: caniko Date: Sat, 29 Jul 2023 14:48:01 +0200 Subject: [PATCH] Refactor: 128float->LongDouble,256complex->ComplexLongDouble --- pydantic_numpy/typing/i_dimensional.py | 8 ++--- pydantic_numpy/typing/ii_dimensional.py | 8 ++--- pydantic_numpy/typing/iii_dimensional.py | 8 ++--- pydantic_numpy/typing/n_dimensional.py | 8 ++--- .../typing/strict_data_type/i_dimensional.py | 10 +++--- .../typing/strict_data_type/ii_dimensional.py | 8 ++--- .../strict_data_type/iii_dimensional.py | 8 ++--- .../typing/strict_data_type/n_dimensional.py | 8 ++--- pyproject.toml | 2 +- tests/helper/groups.py | 32 +++++++++---------- 10 files changed, 51 insertions(+), 49 deletions(-) diff --git a/pydantic_numpy/typing/i_dimensional.py b/pydantic_numpy/typing/i_dimensional.py index 21e556d..e28dfee 100644 --- a/pydantic_numpy/typing/i_dimensional.py +++ b/pydantic_numpy/typing/i_dimensional.py @@ -14,12 +14,12 @@ Np1DArrayUint16 = np_array_pydantic_annotated_typing(data_type=np.uint16, dimensions=1) Np1DArrayUint8 = np_array_pydantic_annotated_typing(data_type=np.uint8, dimensions=1) -Np1DArrayFp128 = np_array_pydantic_annotated_typing(data_type=np.longdouble, dimensions=1) +Np1DArrayFpLongDouble = np_array_pydantic_annotated_typing(data_type=np.longdouble, dimensions=1) Np1DArrayFp64 = np_array_pydantic_annotated_typing(data_type=np.float64, dimensions=1) Np1DArrayFp32 = np_array_pydantic_annotated_typing(data_type=np.float32, dimensions=1) Np1DArrayFp16 = np_array_pydantic_annotated_typing(data_type=np.float16, dimensions=1) -Np1DArrayComplex256 = np_array_pydantic_annotated_typing(data_type=np.clongdouble, dimensions=1) +Np1DArrayComplexLongDouble = np_array_pydantic_annotated_typing(data_type=np.clongdouble, dimensions=1) Np1DArrayComplex128 = np_array_pydantic_annotated_typing(data_type=np.complex128, dimensions=1) Np1DArrayComplex64 = np_array_pydantic_annotated_typing(data_type=np.complex64, dimensions=1) @@ -41,11 +41,11 @@ "Np1DArrayUint32", "Np1DArrayUint16", "Np1DArrayUint8", - "Np1DArrayFp128", + "Np1DArrayFpLongDouble", "Np1DArrayFp64", "Np1DArrayFp32", "Np1DArrayFp16", - "Np1DArrayComplex256", + "Np1DArrayComplexLongDouble", "Np1DArrayComplex128", "Np1DArrayComplex64", "Np1DArrayBool", diff --git a/pydantic_numpy/typing/ii_dimensional.py b/pydantic_numpy/typing/ii_dimensional.py index 4172447..8311348 100644 --- a/pydantic_numpy/typing/ii_dimensional.py +++ b/pydantic_numpy/typing/ii_dimensional.py @@ -14,12 +14,12 @@ Np2DArrayUint16 = np_array_pydantic_annotated_typing(data_type=np.uint16, dimensions=2) Np2DArrayUint8 = np_array_pydantic_annotated_typing(data_type=np.uint8, dimensions=2) -Np2DArrayFp128 = np_array_pydantic_annotated_typing(data_type=np.longdouble, dimensions=2) +Np2DArrayFpLongDouble = np_array_pydantic_annotated_typing(data_type=np.longdouble, dimensions=2) Np2DArrayFp64 = np_array_pydantic_annotated_typing(data_type=np.float64, dimensions=2) Np2DArrayFp32 = np_array_pydantic_annotated_typing(data_type=np.float32, dimensions=2) Np2DArrayFp16 = np_array_pydantic_annotated_typing(data_type=np.float16, dimensions=2) -Np2DArrayComplex256 = np_array_pydantic_annotated_typing(data_type=np.clongdouble, dimensions=2) +Np2DArrayComplexLongDouble = np_array_pydantic_annotated_typing(data_type=np.clongdouble, dimensions=2) Np2DArrayComplex128 = np_array_pydantic_annotated_typing(data_type=np.complex128, dimensions=2) Np2DArrayComplex64 = np_array_pydantic_annotated_typing(data_type=np.complex64, dimensions=2) @@ -41,11 +41,11 @@ "Np2DArrayUint32", "Np2DArrayUint16", "Np2DArrayUint8", - "Np2DArrayFp128", + "Np2DArrayFpLongDouble", "Np2DArrayFp64", "Np2DArrayFp32", "Np2DArrayFp16", - "Np2DArrayComplex256", + "Np2DArrayComplexLongDouble", "Np2DArrayComplex128", "Np2DArrayComplex64", "Np2DArrayBool", diff --git a/pydantic_numpy/typing/iii_dimensional.py b/pydantic_numpy/typing/iii_dimensional.py index 9ed1308..2829910 100644 --- a/pydantic_numpy/typing/iii_dimensional.py +++ b/pydantic_numpy/typing/iii_dimensional.py @@ -14,12 +14,12 @@ Np3DArrayUint16 = np_array_pydantic_annotated_typing(data_type=np.uint16, dimensions=3) Np3DArrayUint8 = np_array_pydantic_annotated_typing(data_type=np.uint8, dimensions=3) -Np3DArrayFp128 = np_array_pydantic_annotated_typing(data_type=np.longdouble, dimensions=3) +Np3DArrayFpLongDouble = np_array_pydantic_annotated_typing(data_type=np.longdouble, dimensions=3) Np3DArrayFp64 = np_array_pydantic_annotated_typing(data_type=np.float64, dimensions=3) Np3DArrayFp32 = np_array_pydantic_annotated_typing(data_type=np.float32, dimensions=3) Np3DArrayFp16 = np_array_pydantic_annotated_typing(data_type=np.float16, dimensions=3) -Np3DArrayComplex256 = np_array_pydantic_annotated_typing(data_type=np.clongdouble, dimensions=3) +Np3DArrayComplexLongDouble = np_array_pydantic_annotated_typing(data_type=np.clongdouble, dimensions=3) Np3DArrayComplex128 = np_array_pydantic_annotated_typing(data_type=np.complex128, dimensions=3) Np3DArrayComplex64 = np_array_pydantic_annotated_typing(data_type=np.complex64, dimensions=3) @@ -40,11 +40,11 @@ "Np3DArrayUint32", "Np3DArrayUint16", "Np3DArrayUint8", - "Np3DArrayFp128", + "Np3DArrayFpLongDouble", "Np3DArrayFp64", "Np3DArrayFp32", "Np3DArrayFp16", - "Np3DArrayComplex256", + "Np3DArrayComplexLongDouble", "Np3DArrayComplex128", "Np3DArrayComplex64", "Np3DArrayBool", diff --git a/pydantic_numpy/typing/n_dimensional.py b/pydantic_numpy/typing/n_dimensional.py index 26328cc..2dba294 100644 --- a/pydantic_numpy/typing/n_dimensional.py +++ b/pydantic_numpy/typing/n_dimensional.py @@ -14,12 +14,12 @@ NpNDArrayUint16 = np_array_pydantic_annotated_typing(data_type=np.uint16) NpNDArrayUint8 = np_array_pydantic_annotated_typing(data_type=np.uint8) -NpNDArrayFp128 = np_array_pydantic_annotated_typing(data_type=np.longdouble) +NpNDArrayFpLongDouble = np_array_pydantic_annotated_typing(data_type=np.longdouble) NpNDArrayFp64 = np_array_pydantic_annotated_typing(data_type=np.float64) NpNDArrayFp32 = np_array_pydantic_annotated_typing(data_type=np.float32) NpNDArrayFp16 = np_array_pydantic_annotated_typing(data_type=np.float16) -NpNDArrayComplex256 = np_array_pydantic_annotated_typing(data_type=np.clongdouble) +NpNDArrayComplexLongDouble = np_array_pydantic_annotated_typing(data_type=np.clongdouble) NpNDArrayComplex128 = np_array_pydantic_annotated_typing(data_type=np.complex128) NpNDArrayComplex64 = np_array_pydantic_annotated_typing(data_type=np.complex64) @@ -41,11 +41,11 @@ "NpNDArrayUint32", "NpNDArrayUint16", "NpNDArrayUint8", - "NpNDArrayFp128", + "NpNDArrayFpLongDouble", "NpNDArrayFp64", "NpNDArrayFp32", "NpNDArrayFp16", - "NpNDArrayComplex256", + "NpNDArrayComplexLongDouble", "NpNDArrayComplex128", "NpNDArrayComplex64", "NpNDArrayBool", diff --git a/pydantic_numpy/typing/strict_data_type/i_dimensional.py b/pydantic_numpy/typing/strict_data_type/i_dimensional.py index 140a360..315f50b 100644 --- a/pydantic_numpy/typing/strict_data_type/i_dimensional.py +++ b/pydantic_numpy/typing/strict_data_type/i_dimensional.py @@ -12,12 +12,14 @@ NpStrict1DArrayUint16 = np_array_pydantic_annotated_typing(data_type=np.uint16, dimensions=1, strict_data_typing=True) NpStrict1DArrayUint8 = np_array_pydantic_annotated_typing(data_type=np.uint8, dimensions=1, strict_data_typing=True) -NpStrict1DArrayFp128 = np_array_pydantic_annotated_typing(data_type=np.longdouble, dimensions=1, strict_data_typing=True) +NpStrict1DArrayFpLongDouble = np_array_pydantic_annotated_typing( + data_type=np.longdouble, dimensions=1, strict_data_typing=True +) NpStrict1DArrayFp64 = np_array_pydantic_annotated_typing(data_type=np.float64, dimensions=1, strict_data_typing=True) NpStrict1DArrayFp32 = np_array_pydantic_annotated_typing(data_type=np.float32, dimensions=1, strict_data_typing=True) NpStrict1DArrayFp16 = np_array_pydantic_annotated_typing(data_type=np.float16, dimensions=1, strict_data_typing=True) -NpStrict1DArrayComplex256 = np_array_pydantic_annotated_typing( +NpStrict1DArrayComplexLongDouble = np_array_pydantic_annotated_typing( data_type=np.clongdouble, dimensions=1, strict_data_typing=True ) NpStrict1DArrayComplex128 = np_array_pydantic_annotated_typing( @@ -48,11 +50,11 @@ "NpStrict1DArrayUint32", "NpStrict1DArrayUint16", "NpStrict1DArrayUint8", - "NpStrict1DArrayFp128", + "NpStrict1DArrayFpLongDouble", "NpStrict1DArrayFp64", "NpStrict1DArrayFp32", "NpStrict1DArrayFp16", - "NpStrict1DArrayComplex256", + "NpStrict1DArrayComplexLongDouble", "NpStrict1DArrayComplex128", "NpStrict1DArrayComplex64", "NpStrict1DArrayBool", diff --git a/pydantic_numpy/typing/strict_data_type/ii_dimensional.py b/pydantic_numpy/typing/strict_data_type/ii_dimensional.py index acc0fdd..1ff4bfd 100644 --- a/pydantic_numpy/typing/strict_data_type/ii_dimensional.py +++ b/pydantic_numpy/typing/strict_data_type/ii_dimensional.py @@ -12,14 +12,14 @@ NpStrict2DArrayUint16 = np_array_pydantic_annotated_typing(data_type=np.uint16, dimensions=2, strict_data_typing=True) NpStrict2DArrayUint8 = np_array_pydantic_annotated_typing(data_type=np.uint8, dimensions=2, strict_data_typing=True) -NpStrict2DArrayFp128 = np_array_pydantic_annotated_typing( +NpStrict2DArrayFpLongDouble = np_array_pydantic_annotated_typing( data_type=np.longdouble, dimensions=2, strict_data_typing=True ) NpStrict2DArrayFp64 = np_array_pydantic_annotated_typing(data_type=np.float64, dimensions=2, strict_data_typing=True) NpStrict2DArrayFp32 = np_array_pydantic_annotated_typing(data_type=np.float32, dimensions=2, strict_data_typing=True) NpStrict2DArrayFp16 = np_array_pydantic_annotated_typing(data_type=np.float16, dimensions=2, strict_data_typing=True) -NpStrict2DArrayComplex256 = np_array_pydantic_annotated_typing( +NpStrict2DArrayComplexLongDouble = np_array_pydantic_annotated_typing( data_type=np.clongdouble, dimensions=2, strict_data_typing=True ) NpStrict2DArrayComplex128 = np_array_pydantic_annotated_typing( @@ -50,11 +50,11 @@ "NpStrict2DArrayUint32", "NpStrict2DArrayUint16", "NpStrict2DArrayUint8", - "NpStrict2DArrayFp128", + "NpStrict2DArrayFpLongDouble", "NpStrict2DArrayFp64", "NpStrict2DArrayFp32", "NpStrict2DArrayFp16", - "NpStrict2DArrayComplex256", + "NpStrict2DArrayComplexLongDouble", "NpStrict2DArrayComplex128", "NpStrict2DArrayComplex64", "NpStrict2DArrayBool", diff --git a/pydantic_numpy/typing/strict_data_type/iii_dimensional.py b/pydantic_numpy/typing/strict_data_type/iii_dimensional.py index 0cda526..d373289 100644 --- a/pydantic_numpy/typing/strict_data_type/iii_dimensional.py +++ b/pydantic_numpy/typing/strict_data_type/iii_dimensional.py @@ -12,14 +12,14 @@ NpStrict3DArrayUint16 = np_array_pydantic_annotated_typing(data_type=np.uint16, dimensions=3, strict_data_typing=True) NpStrict3DArrayUint8 = np_array_pydantic_annotated_typing(data_type=np.uint8, dimensions=3, strict_data_typing=True) -NpStrict3DArrayFp128 = np_array_pydantic_annotated_typing( +NpStrict3DArrayFpLongDouble = np_array_pydantic_annotated_typing( data_type=np.longdouble, dimensions=3, strict_data_typing=True ) NpStrict3DArrayFp64 = np_array_pydantic_annotated_typing(data_type=np.float64, dimensions=3, strict_data_typing=True) NpStrict3DArrayFp32 = np_array_pydantic_annotated_typing(data_type=np.float32, dimensions=3, strict_data_typing=True) NpStrict3DArrayFp16 = np_array_pydantic_annotated_typing(data_type=np.float16, dimensions=3, strict_data_typing=True) -NpStrict3DArrayComplex256 = np_array_pydantic_annotated_typing( +NpStrict3DArrayComplexLongDouble = np_array_pydantic_annotated_typing( data_type=np.clongdouble, dimensions=3, strict_data_typing=True ) NpStrict3DArrayComplex128 = np_array_pydantic_annotated_typing( @@ -49,11 +49,11 @@ "NpStrict3DArrayUint32", "NpStrict3DArrayUint16", "NpStrict3DArrayUint8", - "NpStrict3DArrayFp128", + "NpStrict3DArrayFpLongDouble", "NpStrict3DArrayFp64", "NpStrict3DArrayFp32", "NpStrict3DArrayFp16", - "NpStrict3DArrayComplex256", + "NpStrict3DArrayComplexLongDouble", "NpStrict3DArrayComplex128", "NpStrict3DArrayComplex64", "NpStrict3DArrayBool", diff --git a/pydantic_numpy/typing/strict_data_type/n_dimensional.py b/pydantic_numpy/typing/strict_data_type/n_dimensional.py index 3a73353..6679e47 100644 --- a/pydantic_numpy/typing/strict_data_type/n_dimensional.py +++ b/pydantic_numpy/typing/strict_data_type/n_dimensional.py @@ -12,12 +12,12 @@ NpStrictNDArrayUint16 = np_array_pydantic_annotated_typing(data_type=np.uint16, strict_data_typing=True) NpStrictNDArrayUint8 = np_array_pydantic_annotated_typing(data_type=np.uint8, strict_data_typing=True) -NpStrictNDArrayFp128 = np_array_pydantic_annotated_typing(data_type=np.longdouble, strict_data_typing=True) +NpStrictNDArrayFpLongDouble = np_array_pydantic_annotated_typing(data_type=np.longdouble, strict_data_typing=True) NpStrictNDArrayFp64 = np_array_pydantic_annotated_typing(data_type=np.float64, strict_data_typing=True) NpStrictNDArrayFp32 = np_array_pydantic_annotated_typing(data_type=np.float32, strict_data_typing=True) NpStrictNDArrayFp16 = np_array_pydantic_annotated_typing(data_type=np.float16, strict_data_typing=True) -NpStrictNDArrayComplex256 = np_array_pydantic_annotated_typing(data_type=np.clongdouble, strict_data_typing=True) +NpStrictNDArrayComplexLongDouble = np_array_pydantic_annotated_typing(data_type=np.clongdouble, strict_data_typing=True) NpStrictNDArrayComplex128 = np_array_pydantic_annotated_typing(data_type=np.complex128, strict_data_typing=True) NpStrictNDArrayComplex64 = np_array_pydantic_annotated_typing(data_type=np.complex64, strict_data_typing=True) @@ -38,11 +38,11 @@ "NpStrictNDArrayUint32", "NpStrictNDArrayUint16", "NpStrictNDArrayUint8", - "NpStrictNDArrayFp128", + "NpStrictNDArrayFpLongDouble", "NpStrictNDArrayFp64", "NpStrictNDArrayFp32", "NpStrictNDArrayFp16", - "NpStrictNDArrayComplex256", + "NpStrictNDArrayComplexLongDouble", "NpStrictNDArrayComplex128", "NpStrictNDArrayComplex64", "NpStrictNDArrayBool", diff --git a/pyproject.toml b/pyproject.toml index c301046..f908b20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pydantic_numpy" -version = "3.1.3" +version = "3.1.4" description = "Pydantic Model integration of the NumPy array" authors = ["Can H. Tartanoglu", "Christoph Heindl"] maintainers = ["Can H. Tartanoglu "] diff --git a/tests/helper/groups.py b/tests/helper/groups.py index 67d105b..b2185c4 100644 --- a/tests/helper/groups.py +++ b/tests/helper/groups.py @@ -31,11 +31,11 @@ (np.uint32, Np1DArrayUint32, 1), (np.uint16, Np1DArrayUint16, 1), (np.uint8, Np1DArrayUint8, 1), - (np.longdouble, Np1DArrayFp128, 1), + (np.longdouble, Np1DArrayFpLongDouble, 1), (np.float64, Np1DArrayFp64, 1), (np.float32, Np1DArrayFp32, 1), (np.float16, Np1DArrayFp16, 1), - (np.clongdouble, Np1DArrayComplex256, 1), + (np.clongdouble, Np1DArrayComplexLongDouble, 1), (np.complex128, Np1DArrayComplex128, 1), (np.complex64, Np1DArrayComplex64, 1), (bool, Np1DArrayBool, 1), @@ -51,11 +51,11 @@ (np.uint32, Np2DArrayUint32, 2), (np.uint16, Np2DArrayUint16, 2), (np.uint8, Np2DArrayUint8, 2), - (np.longdouble, Np2DArrayFp128, 2), + (np.longdouble, Np2DArrayFpLongDouble, 2), (np.float64, Np2DArrayFp64, 2), (np.float32, Np2DArrayFp32, 2), (np.float16, Np2DArrayFp16, 2), - (np.clongdouble, Np2DArrayComplex256, 2), + (np.clongdouble, Np2DArrayComplexLongDouble, 2), (np.complex128, Np2DArrayComplex128, 2), (np.complex64, Np2DArrayComplex64, 2), (bool, Np2DArrayBool, 2), @@ -71,11 +71,11 @@ (np.uint32, Np3DArrayUint32, 3), (np.uint16, Np3DArrayUint16, 3), (np.uint8, Np3DArrayUint8, 3), - (np.longdouble, Np3DArrayFp128, 3), + (np.longdouble, Np3DArrayFpLongDouble, 3), (np.float64, Np3DArrayFp64, 3), (np.float32, Np3DArrayFp32, 3), (np.float16, Np3DArrayFp16, 3), - (np.clongdouble, Np3DArrayComplex256, 3), + (np.clongdouble, Np3DArrayComplexLongDouble, 3), (np.complex128, Np3DArrayComplex128, 3), (np.complex64, Np3DArrayComplex64, 3), (bool, Np3DArrayBool, 3), @@ -91,11 +91,11 @@ (np.uint32, NpNDArrayUint32, None), (np.uint16, NpNDArrayUint16, None), (np.uint8, NpNDArrayUint8, None), - (np.longdouble, NpNDArrayFp128, None), + (np.longdouble, NpNDArrayFpLongDouble, None), (np.float64, NpNDArrayFp64, None), (np.float32, NpNDArrayFp32, None), (np.float16, NpNDArrayFp16, None), - (np.clongdouble, NpNDArrayComplex256, None), + (np.clongdouble, NpNDArrayComplexLongDouble, None), (np.complex128, NpNDArrayComplex128, None), (np.complex64, NpNDArrayComplex64, None), (bool, NpNDArrayBool, None), @@ -120,11 +120,11 @@ (np.uint32, NpStrict1DArrayUint32, 1), (np.uint16, NpStrict1DArrayUint16, 1), (np.uint8, NpStrict1DArrayUint8, 1), - (np.longdouble, NpStrict1DArrayFp128, 1), + (np.longdouble, NpStrict1DArrayFpLongDouble, 1), (np.float64, NpStrict1DArrayFp64, 1), (np.float32, NpStrict1DArrayFp32, 1), (np.float16, NpStrict1DArrayFp16, 1), - (np.clongdouble, NpStrict1DArrayComplex256, 1), + (np.clongdouble, NpStrict1DArrayComplexLongDouble, 1), (np.complex128, NpStrict1DArrayComplex128, 1), (np.complex64, NpStrict1DArrayComplex64, 1), (bool, NpStrict1DArrayBool, 1), @@ -140,11 +140,11 @@ (np.uint32, NpStrict2DArrayUint32, 2), (np.uint16, NpStrict2DArrayUint16, 2), (np.uint8, NpStrict2DArrayUint8, 2), - (np.longdouble, NpStrict2DArrayFp128, 2), + (np.longdouble, NpStrict2DArrayFpLongDouble, 2), (np.float64, NpStrict2DArrayFp64, 2), (np.float32, NpStrict2DArrayFp32, 2), (np.float16, NpStrict2DArrayFp16, 2), - (np.clongdouble, NpStrict2DArrayComplex256, 2), + (np.clongdouble, NpStrict2DArrayComplexLongDouble, 2), (np.complex128, NpStrict2DArrayComplex128, 2), (np.complex64, NpStrict2DArrayComplex64, 2), (bool, NpStrict2DArrayBool, 2), @@ -160,11 +160,11 @@ (np.uint32, NpStrict3DArrayUint32, 3), (np.uint16, NpStrict3DArrayUint16, 3), (np.uint8, NpStrict3DArrayUint8, 3), - (np.longdouble, NpStrict3DArrayFp128, 3), + (np.longdouble, NpStrict3DArrayFpLongDouble, 3), (np.float64, NpStrict3DArrayFp64, 3), (np.float32, NpStrict3DArrayFp32, 3), (np.float16, NpStrict3DArrayFp16, 3), - (np.clongdouble, NpStrict3DArrayComplex256, 3), + (np.clongdouble, NpStrict3DArrayComplexLongDouble, 3), (np.complex128, NpStrict3DArrayComplex128, 3), (np.complex64, NpStrict3DArrayComplex64, 3), (bool, NpStrict3DArrayBool, 3), @@ -180,11 +180,11 @@ (np.uint32, NpStrictNDArrayUint32, None), (np.uint16, NpStrictNDArrayUint16, None), (np.uint8, NpStrictNDArrayUint8, None), - (np.longdouble, NpStrictNDArrayFp128, None), + (np.longdouble, NpStrictNDArrayFpLongDouble, None), (np.float64, NpStrictNDArrayFp64, None), (np.float32, NpStrictNDArrayFp32, None), (np.float16, NpStrictNDArrayFp16, None), - (np.clongdouble, NpStrictNDArrayComplex256, None), + (np.clongdouble, NpStrictNDArrayComplexLongDouble, None), (np.complex128, NpStrictNDArrayComplex128, None), (np.complex64, NpStrictNDArrayComplex64, None), (bool, NpStrictNDArrayBool, None),