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

Merged
merged 1 commit into from Sep 19, 2018

Conversation

Projects
None yet
2 participants
@jcrist
Collaborator

jcrist commented Sep 19, 2018

Add sparse.full and sparse.full_like, matching the numpy api.

@codecov

This comment has been minimized.

codecov bot commented Sep 19, 2018

Codecov Report

Merging #189 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
+ Coverage   97.52%   97.52%   +<.01%     
==========================================
  Files          11       11              
  Lines        1375     1376       +1     
==========================================
+ Hits         1341     1342       +1     
  Misses         34       34
Impacted Files Coverage Δ
sparse/coo/__init__.py 100% <ø> (ø) ⬆️
sparse/coo/common.py 97.7% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cba310...6bc44c6. Read the comment docs.

4 similar comments
@codecov

This comment has been minimized.

codecov bot commented Sep 19, 2018

Codecov Report

Merging #189 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
+ Coverage   97.52%   97.52%   +<.01%     
==========================================
  Files          11       11              
  Lines        1375     1376       +1     
==========================================
+ Hits         1341     1342       +1     
  Misses         34       34
Impacted Files Coverage Δ
sparse/coo/__init__.py 100% <ø> (ø) ⬆️
sparse/coo/common.py 97.7% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cba310...6bc44c6. Read the comment docs.

@codecov

This comment has been minimized.

codecov bot commented Sep 19, 2018

Codecov Report

Merging #189 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
+ Coverage   97.52%   97.52%   +<.01%     
==========================================
  Files          11       11              
  Lines        1375     1376       +1     
==========================================
+ Hits         1341     1342       +1     
  Misses         34       34
Impacted Files Coverage Δ
sparse/coo/__init__.py 100% <ø> (ø) ⬆️
sparse/coo/common.py 97.7% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cba310...6bc44c6. Read the comment docs.

@codecov

This comment has been minimized.

codecov bot commented Sep 19, 2018

Codecov Report

Merging #189 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
+ Coverage   97.52%   97.52%   +<.01%     
==========================================
  Files          11       11              
  Lines        1375     1376       +1     
==========================================
+ Hits         1341     1342       +1     
  Misses         34       34
Impacted Files Coverage Δ
sparse/coo/__init__.py 100% <ø> (ø) ⬆️
sparse/coo/common.py 97.7% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cba310...6bc44c6. Read the comment docs.

@codecov

This comment has been minimized.

codecov bot commented Sep 19, 2018

Codecov Report

Merging #189 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
+ Coverage   97.52%   97.52%   +<.01%     
==========================================
  Files          11       11              
  Lines        1375     1376       +1     
==========================================
+ Hits         1341     1342       +1     
  Misses         34       34
Impacted Files Coverage Δ
sparse/coo/__init__.py 100% <ø> (ø) ⬆️
sparse/coo/common.py 97.7% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cba310...6bc44c6. Read the comment docs.

@hameerabbasi

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))

This comment has been minimized.

@hameerabbasi

hameerabbasi Sep 19, 2018

Collaborator

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'])

This comment has been minimized.

@hameerabbasi

hameerabbasi Sep 19, 2018

Collaborator

Thanks for the parameterisation.

@hameerabbasi hameerabbasi merged commit 7abe667 into pydata:master Sep 19, 2018

5 checks passed

LGTM analysis: Python No alert changes
Details
ci/circleci Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 97.52%)
Details
codecov/project 97.52% (+<.01%) compared to 0cba310
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment