Skip to content

Commit 240b14f

Browse files
npolina4antonwolfy
andauthored
Implemented nin and nout property for elementwise functions (#1712)
* Implemented nin and nout property for elementwise functions * address comments * Apply pylint * fix tests * Deleted debugging print * Added TypeError for functions that do not support bool dtype * fix typo * Fixed docstrings for element-wise functions * Remove call_origin for element-wise functions * address comments * Update dpnp_elementwise_common.py * Fix linalg tests. Fix element-wise docs * address comments * Fix tests for Iris Xe * Improve code coverage * Update dpnp/dpnp_algo/dpnp_elementwise_common.py Co-authored-by: Anton <[email protected]> * fix pre-commit * fix typo * Added missing call to _mkl_round_to_call --------- Co-authored-by: Anton <[email protected]>
1 parent 9705a51 commit 240b14f

File tree

12 files changed

+4772
-7693
lines changed

12 files changed

+4772
-7693
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ repos:
9494
"--disable=redefined-builtin",
9595
"--disable=unused-wildcard-import"
9696
]
97-
files: '^dpnp/dpnp_iface(|_arraycreation|_counting|_indexing|_libmath|_linearalgebra|_manipulation|_nanfunctions|_searching|_sorting|_statistics|_types).py$'
97+
files: '^dpnp/dpnp_iface.*'

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

0 commit comments

Comments
 (0)