Skip to content
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 warning on too dense. #213

Merged
merged 3 commits into from Dec 5, 2018

Conversation

hameerabbasi
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Dec 5, 2018

Codecov Report

Merging #213 into master will decrease coverage by 0.25%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #213      +/-   ##
==========================================
- Coverage   97.67%   97.41%   -0.26%     
==========================================
  Files          11       11              
  Lines        1505     1510       +5     
==========================================
+ Hits         1470     1471       +1     
- Misses         35       39       +4
Impacted Files Coverage Δ
sparse/coo/core.py 97.21% <100%> (+0.03%) ⬆️
sparse/utils.py 100% <100%> (ø) ⬆️
sparse/sparse_array.py 96.77% <100%> (ø) ⬆️
sparse/slicing.py 99.2% <100%> (ø) ⬆️
sparse/coo/common.py 97.95% <100%> (ø) ⬆️
sparse/compatibility.py 50% <0%> (-33.34%) ⬇️

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 1e653b1...7a82966. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 5, 2018

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #213      +/-   ##
==========================================
+ Coverage   97.67%   97.68%   +<.01%     
==========================================
  Files          11       11              
  Lines        1505     1510       +5     
==========================================
+ Hits         1470     1475       +5     
  Misses         35       35
Impacted Files Coverage Δ
sparse/coo/core.py 97.21% <100%> (+0.03%) ⬆️
sparse/coo/common.py 97.95% <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 1e653b1...7a82966. Read the comment docs.

@hameerabbasi hameerabbasi merged commit 325d11d into pydata:master Dec 5, 2018
@hameerabbasi hameerabbasi deleted the too-dense-warning branch December 5, 2018 15:04
@hameerabbasi hameerabbasi changed the title Add warning on too dense and fix collections.abc warnings. Add warning on too dense. Dec 5, 2018
@@ -234,6 +236,12 @@ def __init__(self, coords, data=None, shape=None, has_duplicates=True,
self.coords.shape[0],
self.coords.shape))

from .. import _AUTO_WARN_ON_TOO_DENSE
if _AUTO_WARN_ON_TOO_DENSE and self.nbytes >= self.size * self.data.itemsize:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What ratio does this correspond to for float arrays?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends on the number of dimensions. The overall formula for COO.nbytes is data.nbytes + coords.nbytes where data.nbytes = self.nnz * data.itemsize and coords.nbytes = self.nnz * self.ndim * 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants