Skip to content

Commit aa7e1cc

Browse files
committed
Add doctrings to the LinAlgError exception
1 parent 00d1d33 commit aa7e1cc

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

dpnp/linalg/dpnp_iface_linalg.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,29 @@
104104
"vector_norm",
105105
]
106106

107-
# Need to set the module explicitly, since exposed by LAPACK pybind11 extension
107+
# Need to set the module explicitly, because it's initially exposed by LAPACK
108+
# pybind11 extension and to add the docstrings
108109
LinAlgError.__module__ = "dpnp.linalg"
110+
LinAlgError.__doc__ = """
111+
Generic Python-exception-derived object raised by LinAlg functions.
112+
113+
General purpose exception class, derived from Python's ``ValueError`` class,
114+
programmatically raised in LinAlg functions when a Linear Algebra-related
115+
condition would prevent further correct execution of the function.
116+
117+
Parameters
118+
----------
119+
None
120+
121+
Examples
122+
--------
123+
>>> import dpnp as np
124+
>>> np.linalg.inv(np.zeros((2, 2)))
125+
Traceback (most recent call last):
126+
...
127+
dpnp.linalg.LinAlgError: The input coefficient matrix is singular.
128+
129+
"""
109130

110131

111132
# pylint:disable=missing-class-docstring

0 commit comments

Comments
 (0)