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
Add order parameter to COO.reshape
#193
Conversation
Adds support for `np.reshape` to dispatch to `COO.reshape` properly.
Codecov Report
@@ Coverage Diff @@
## master #193 +/- ##
==========================================
+ Coverage 97.52% 97.52% +<.01%
==========================================
Files 11 11
Lines 1416 1417 +1
==========================================
+ Hits 1381 1382 +1
Misses 35 35
Continue to review full report at Codecov.
|
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.
One minor change.
sparse/tests/test_coo.py
Outdated
|
||
# order parameter not actually supported | ||
with pytest.raises(NotImplementedError): | ||
np.reshape(s, shape, order='F') |
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 might want to remove these two lines from the test, if we add this functionality later it'll crap out.
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.
An exception from coverage is already in place.
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.
Done.
I personally prefer to check these errors - in the past I've seen code that was supposed to raise a DeprecationWarning
or NotImplementedError
fail to actually raise due to a bug. I don't think of the tests as the-one-uneditable-source-of-truth, I think someone adding this functionality wouldn't be surprised to see a test fail due to a NotImplementedError
not being raised anymore, and be fine changing the test.
Anyway, happy to cede to you here. I believe this should be good to go.
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.
Fair enough. 👍
Adds support for
np.reshape
to dispatch toCOO.reshape
properly.