-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update docs for Universal Functions #1863
base: master
Are you sure you want to change the base?
Conversation
View rendered docs @ https://intelpython.github.io/dpnp/pull/1863/index.html |
@@ -98,6 +98,7 @@ repos: | |||
"-sn", # Don't display the score | |||
"--disable=import-error", | |||
"--disable=redefined-builtin", | |||
"--disable=unused-wildcard-import" | |||
"--disable=unused-wildcard-import", | |||
"--class-naming-style=snake_case" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better to update pyproject.toml
:
[tool.pylint.basic]
include-naming-hint = true
class-naming-style = "snake_case"
self.nin_ = nin | ||
_name = "_" + name | ||
|
||
dpt_result_type = getattr(ti, _name + "_result_type") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will it be propose to handle elementwise functions which are not present in dcptl? (like fabs
which we will need to implement separately in dpnp)
return dpnp_array._create_from_usm_ndarray(res_usm) | ||
|
||
@property | ||
def nin(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to add some tests to verify the attributes. Also to enable some relating third party tests.
DPNP provides universal functions (a.k.a. ufuncs) to support various element-wise operations. | ||
DPNP ufunc supports following features of NumPy’s one: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to reuse numpy like description here with a reference to numpy documentation at the end.
|
||
Parameters | ||
---------- | ||
*x : {dpnp.ndarray, usm_ndarray} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the autogenerated page is not properly describes arguments, like
param *x : Input arrays.
type *x : {dpnp.ndarray, usm_ndarray}
while expected a list under Parameters:
Parameters: *x ({dpnp.ndarray, usm_ndarray}) -- ....
i.e. the style of description is different
ufunc() | ||
|
||
Functions that operate element by element on whole arrays. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing a link to numpy.ufunc
Keyword arguments `where` and `subok` are supported with their default values. | ||
Other keyword arguments is currently unsupported. | ||
Otherwise ``NotImplementedError`` exception will be raised. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is about the Attributes
section?
Other keyword arguments is currently unsupported. | ||
Otherwise ``NotImplementedError`` exception will be raised. | ||
|
||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
due to some reason the whole description of dpnp.ufunc.outer
was inserted to dpnp.ufunc
page, but expected to have only summary per each method, like here
Added new class for Universal Functions with full documentation that united unary and binary element-wise functions.
Updated
dpnp.add
anddpnp.abs
functions for prototype for future element-wise functions.All element-wise functions will be updated according to this prototype in the next PR.