Skip to content

Raise error when initialising with unaligned indices#51

Merged
kayibal merged 2 commits intomasterfrom
fix/#49
Sep 4, 2018
Merged

Raise error when initialising with unaligned indices#51
kayibal merged 2 commits intomasterfrom
fix/#49

Conversation

@kayibal
Copy link
Copy Markdown

@kayibal kayibal commented Sep 3, 2018

No description provided.

Copy link
Copy Markdown

@michcio1234 michcio1234 left a comment

Choose a reason for hiding this comment

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

You shall not pass!

elif len(index) != N and data.size:
raise ValueError('Shape of passed values is {},'
'indices imply {}'
.format(data.shape, (data.shape[0], len(index))))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Firstly: should be .format(data.shape, (len(index), data.shape[1])) (similar error is below).

Secondly: if columns was also passed, then this error message will be slightly misleading (it would say that indices imply actual number of columns in data instead of number of columns passed). Same error is below.

I think this error message could be simpler and mention only one dimension. No need to solve this in smarter way.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is ananlogous to pandas error message.... I'll try to come up with something

@kayibal
Copy link
Copy Markdown
Author

kayibal commented Sep 3, 2018

@michcio1234 update!

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 3, 2018

Codecov Report

Merging #51 into master will increase coverage by 0.01%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
+ Coverage   88.16%   88.17%   +0.01%     
==========================================
  Files           7        7              
  Lines        1174     1184      +10     
==========================================
+ Hits         1035     1044       +9     
- Misses        139      140       +1
Impacted Files Coverage Δ
sparsity/sparse_frame.py 87.47% <90%> (+0.05%) ⬆️

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 ce1ac3a...05b1587. Read the comment docs.

@kayibal kayibal merged commit 4c09026 into master Sep 4, 2018
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.

2 participants