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

Fix inconsistency between row and column behavior of MatrixTable #262

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Nov 18, 2021

Fixes #261. Because MatrixTable subtypes AbstractColumns, it
inherits certain behavior like length; but when it needs to fulfill
the "rows" interface, it needs length to be defined in terms of the #
of rows instead of the # of columns. We fix this inconsistency here by
defining another type that mirrors MatrixTable but is used in the rows
case.

Fixes #261. Because `MatrixTable` subtypes `AbstractColumns`, it
inherits certain behavior like `length`; but when it needs to fulfill
the "rows" interface, it needs `length` to be defined in terms of the #
of rows instead of the # of columns. We fix this inconsistency here by
defining another type that mirrors `MatrixTable` but is used in the rows
case.
@codecov
Copy link

codecov bot commented Nov 18, 2021

Codecov Report

Merging #262 (c3e3b70) into main (08d09ea) will increase coverage by 0.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #262      +/-   ##
==========================================
+ Coverage   94.72%   94.89%   +0.17%     
==========================================
  Files           7        7              
  Lines         663      666       +3     
==========================================
+ Hits          628      632       +4     
+ Misses         35       34       -1     
Impacted Files Coverage Δ
src/matrix.jl 100.00% <100.00%> (ø)
src/fallbacks.jl 98.60% <0.00%> (+0.69%) ⬆️

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 08d09ea...c3e3b70. Read the comment docs.

@bkamins
Copy link
Member

bkamins commented Nov 18, 2021

I understand one needs to call rows on MatrixTable to get a row iterator - right?

@quinnj
Copy link
Member Author

quinnj commented Nov 18, 2021

Correct; that was always the official API, but if you happened to just iterate MatrixTable, you would get rows. That's the change in behavior with this PR.

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.

BoundsError on last(::MatrixTable)
2 participants