From 053c8c44a063bc60e069b4bd2d7c099399720fa2 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Wed, 9 Apr 2025 20:37:13 +0100 Subject: [PATCH] TYP: fix type signature of eigh --- src/array_api_stubs/_2021_12/linalg.py | 4 ++-- src/array_api_stubs/_2022_12/linalg.py | 4 ++-- src/array_api_stubs/_2023_12/linalg.py | 4 ++-- src/array_api_stubs/_2024_12/linalg.py | 4 ++-- src/array_api_stubs/_draft/linalg.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/array_api_stubs/_2021_12/linalg.py b/src/array_api_stubs/_2021_12/linalg.py index 06aa0accd..20c592fa0 100644 --- a/src/array_api_stubs/_2021_12/linalg.py +++ b/src/array_api_stubs/_2021_12/linalg.py @@ -86,7 +86,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array: """ -def eigh(x: array, /) -> Tuple[array]: +def eigh(x: array, /) -> Tuple[array, array]: """ Returns an eigendecomposition x = QLQᵀ of a symmetric matrix (or a stack of symmetric matrices) ``x``, where ``Q`` is an orthogonal matrix (or a stack of matrices) and ``L`` is a vector (or a stack of vectors). @@ -106,7 +106,7 @@ def eigh(x: array, /) -> Tuple[array]: Returns ------- - out: Tuple[array] + out: Tuple[array, array] a namedtuple (``eigenvalues``, ``eigenvectors``) whose - first element must have the field name ``eigenvalues`` (corresponding to ``L`` above) and must be an array consisting of computed eigenvalues. The array containing the eigenvalues must have shape ``(..., M)``. diff --git a/src/array_api_stubs/_2022_12/linalg.py b/src/array_api_stubs/_2022_12/linalg.py index beec652bc..8e56ad83c 100644 --- a/src/array_api_stubs/_2022_12/linalg.py +++ b/src/array_api_stubs/_2022_12/linalg.py @@ -134,7 +134,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array: """ -def eigh(x: array, /) -> Tuple[array]: +def eigh(x: array, /) -> Tuple[array, array]: r""" Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``. @@ -168,7 +168,7 @@ def eigh(x: array, /) -> Tuple[array]: Returns ------- - out: Tuple[array] + out: Tuple[array, array] a namedtuple (``eigenvalues``, ``eigenvectors``) whose - first element must have the field name ``eigenvalues`` (corresponding to :math:`\operatorname{diag}\Lambda` above) and must be an array consisting of computed eigenvalues. The array containing the eigenvalues must have shape ``(..., M)`` and must have a real-valued floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``complex128``, then ``eigenvalues`` must be ``float64``). diff --git a/src/array_api_stubs/_2023_12/linalg.py b/src/array_api_stubs/_2023_12/linalg.py index a43dc8dcf..b742cdd2e 100644 --- a/src/array_api_stubs/_2023_12/linalg.py +++ b/src/array_api_stubs/_2023_12/linalg.py @@ -163,7 +163,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array: """ -def eigh(x: array, /) -> Tuple[array]: +def eigh(x: array, /) -> Tuple[array, array]: r""" Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``. @@ -197,7 +197,7 @@ def eigh(x: array, /) -> Tuple[array]: Returns ------- - out: Tuple[array] + out: Tuple[array, array] a namedtuple (``eigenvalues``, ``eigenvectors``) whose - first element must have the field name ``eigenvalues`` (corresponding to :math:`\operatorname{diag}\Lambda` above) and must be an array consisting of computed eigenvalues. The array containing the eigenvalues must have shape ``(..., M)`` and must have a real-valued floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``complex128``, then ``eigenvalues`` must be ``float64``). diff --git a/src/array_api_stubs/_2024_12/linalg.py b/src/array_api_stubs/_2024_12/linalg.py index 4086c333e..fa69ef971 100644 --- a/src/array_api_stubs/_2024_12/linalg.py +++ b/src/array_api_stubs/_2024_12/linalg.py @@ -163,7 +163,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array: """ -def eigh(x: array, /) -> Tuple[array]: +def eigh(x: array, /) -> Tuple[array, array]: r""" Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``. @@ -197,7 +197,7 @@ def eigh(x: array, /) -> Tuple[array]: Returns ------- - out: Tuple[array] + out: Tuple[array, array] a namedtuple (``eigenvalues``, ``eigenvectors``) whose - first element must have the field name ``eigenvalues`` (corresponding to :math:`\operatorname{diag}\Lambda` above) and must be an array consisting of computed eigenvalues. The array containing the eigenvalues must have shape ``(..., M)`` and must have a real-valued floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``complex128``, then ``eigenvalues`` must be ``float64``). diff --git a/src/array_api_stubs/_draft/linalg.py b/src/array_api_stubs/_draft/linalg.py index 4086c333e..fa69ef971 100644 --- a/src/array_api_stubs/_draft/linalg.py +++ b/src/array_api_stubs/_draft/linalg.py @@ -163,7 +163,7 @@ def diagonal(x: array, /, *, offset: int = 0) -> array: """ -def eigh(x: array, /) -> Tuple[array]: +def eigh(x: array, /) -> Tuple[array, array]: r""" Returns an eigenvalue decomposition of a complex Hermitian or real symmetric matrix (or a stack of matrices) ``x``. @@ -197,7 +197,7 @@ def eigh(x: array, /) -> Tuple[array]: Returns ------- - out: Tuple[array] + out: Tuple[array, array] a namedtuple (``eigenvalues``, ``eigenvectors``) whose - first element must have the field name ``eigenvalues`` (corresponding to :math:`\operatorname{diag}\Lambda` above) and must be an array consisting of computed eigenvalues. The array containing the eigenvalues must have shape ``(..., M)`` and must have a real-valued floating-point data type whose precision matches the precision of ``x`` (e.g., if ``x`` is ``complex128``, then ``eigenvalues`` must be ``float64``).