Skip to content

Commit

Permalink
Add namedtuple return types to linalg functions that return tuples
Browse files Browse the repository at this point in the history
That is, eig(), eigh(), qr(), slogdet(), and svd(). For those functions that
return non-tuples with certain keyword arguments, the return type is
unchanged. This change should be completely backwards compatible.

The namedtuple attribute names come from the array API specification (see,
e.g.,
https://data-apis.org/array-api/latest/extensions/generated/signatures.linalg.eigh.html),
with the exception of eig() which is just the same as eigh(). The name of the
namedtuple object itself is not part of the specification or the public API.

I have not used a namedtuple for the tuple output for qr(mode='raw'), which
returns (h, tau).

This updates the docstrings to use the updated namedtuple return names, and
also the examples to use those names more consistently. This also updates the
tests to check each function for the namedtuple attributes at least once.
  • Loading branch information
asmeurer committed Dec 13, 2022
1 parent 4ca8204 commit 18e88b4
Show file tree
Hide file tree
Showing 2 changed files with 179 additions and 133 deletions.

0 comments on commit 18e88b4

Please sign in to comment.