-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Document elementwise functions for DOK arrays #451
Conversation
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'd be nice to note all standard ufuncs and operators are now supported on DOK minus reduce.
Codecov Report
@@ Coverage Diff @@
## master #451 +/- ##
=======================================
Coverage 95.15% 95.15%
=======================================
Files 20 20
Lines 2975 2975
=======================================
Hits 2831 2831
Misses 144 144 |
docs/construct.rst
Outdated
y = sparse.random((10, 10), 0.5, format="dok") | ||
sparse.elemwise(np.add, x, y) | ||
|
||
:obj:`DOK` arrays also support standard `__ufunc__` operations and operators, including comparison operators, |
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.
I don't think __ufunc__
is a thing.
docs/construct.rst
Outdated
y = np.random.random((10, 10)) | ||
x == y | ||
|
||
:obj:`DOK` arrays are returned from elemwise functions and standard `__ufunc__` operations if and only if all |
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.
Same here.
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.
I changed it to just say universal... I'm not sure if there's a better technical term to refer to it by
I think the technical term would be operators and ufuncs, without the double-underscore. |
@hameerabbasi I've made that change. Is there anything else you'd like documented? |
Thanks, @DragaDoncila! |
@hameerabbasi I've updated the docs to include elementwise operations for DOK arrays.
At this point I'm not sure whether you want to keep the DOK documentation in Construct Sparse Arrays, or whether you'd like to pull it out as its own section, but please let me know if that's the case, and whether you want more detail on the elementwise operations e.g. more detail on comparisons, etc. As it is, I tried to follow the convention already used for the COO arrays.