len() function for COO objects #68
Conversation
Seems fine, however it would be really nice to have docstrings for these, and if possible, tests. |
Added them |
Well, this looks good. Let me know if you're finished working on it, and I'll review and merge (don't want to be too fast this time). |
This is ready to be merged. |
Agreed. |
Thanks @nils-werner ! |
One unexpected sideeffect of this:
now magically works!
|
I'm going to assume it's really slow. Do we have any benchmarks for this? |
Yes, it's very very slow. If I understand it correctly, What if we implement
Before
After
I can't explain where the 2x slowdown (11 vs 23 us) comes from though... |
A pull request would be welcome. Also, your data is too small. Maybe it's just the overhead. |
Quite trivial really, implements the
len()
operation following NumPy's convention of