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 full and full_like #189
Conversation
Codecov Report
@@ Coverage Diff @@
## master #189 +/- ##
==========================================
+ Coverage 97.52% 97.52% +<.01%
==========================================
Files 11 11
Lines 1375 1376 +1
==========================================
+ Hits 1341 1342 +1
Misses 34 34
Continue to review full report at Codecov.
|
4 similar comments
Codecov Report
@@ Coverage Diff @@
## master #189 +/- ##
==========================================
+ Coverage 97.52% 97.52% +<.01%
==========================================
Files 11 11
Lines 1375 1376 +1
==========================================
+ Hits 1341 1342 +1
Misses 34 34
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #189 +/- ##
==========================================
+ Coverage 97.52% 97.52% +<.01%
==========================================
Files 11 11
Lines 1375 1376 +1
==========================================
+ Hits 1341 1342 +1
Misses 34 34
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #189 +/- ##
==========================================
+ Coverage 97.52% 97.52% +<.01%
==========================================
Files 11 11
Lines 1375 1376 +1
==========================================
+ Hits 1341 1342 +1
Misses 34 34
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #189 +/- ##
==========================================
+ Coverage 97.52% 97.52% +<.01%
==========================================
Files 11 11
Lines 1375 1376 +1
==========================================
+ Hits 1341 1342 +1
Misses 34 34
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.
Once again, thanks, @jcrist. I've added you to collaborators, though it's nice to have someone review your code to make sure it's okay.
coords = np.empty((len(shape), 0), dtype=np.intp) | ||
return COO(coords, data=data, shape=shape, has_duplicates=False, | ||
sorted=True) | ||
return full(shape, 0, np.dtype(dtype)) |
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.
Thanks for the cleanup, here and below!
assert_eq(sparse.zeros(5), np.zeros(5)) | ||
assert_eq(sparse.zeros((5, 4)), np.zeros((5, 4))) | ||
assert_eq(sparse.zeros((5, 4), dtype='i4'), np.zeros((5, 4), dtype='i4')) | ||
@pytest.mark.parametrize('funcname', ['ones', 'zeros']) |
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.
Thanks for the parameterisation.
Add
sparse.full
andsparse.full_like
, matching the numpy api.