Skip to content

Commit 07bf71c

Browse files
committed
Fixed docstrings for element-wise functions
1 parent 6ed744a commit 07bf71c

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

doc/conf.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
# full list see the documentation:
77
# http://www.sphinx-doc.org/en/master/config
88

9+
from sphinx.ext.autodoc import FunctionDocumenter
10+
11+
from dpnp.dpnp_algo.dpnp_elementwise_common import DPNPBinaryFunc, DPNPUnaryFunc
12+
913
try:
1014
import comparison_generator
1115
except ImportError:
@@ -188,7 +192,17 @@
188192

189193
# -- Extension configuration -------------------------------------------------
190194

195+
191196
# -- Options for todo extension ----------------------------------------------
197+
def _can_document_member(member, *args, **kwargs):
198+
if isinstance(member, (DPNPBinaryFunc, DPNPUnaryFunc)):
199+
return True
200+
return orig(member, *args, **kwargs)
201+
202+
203+
documenter = FunctionDocumenter
204+
orig = documenter.can_document_member
205+
documenter.can_document_member = _can_document_member
192206

193207
autosummary_generate = True
194208

dpnp/dpnp_iface_mathematical.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,6 @@ def _append_to_diff_array(a, axis, combined, values):
228228

229229

230230
_ADD_DOCSTRING = """
231-
add(x1, x2, /, out=None, *, where=True, order="K", dtype=None, subok=True,
232-
**kwargs)
233-
234231
Calculates the sum for each element `x1_i` of the input array `x1` with
235232
the respective element `x2_i` of the input array `x2`.
236233

0 commit comments

Comments
 (0)