[query/ggplot] add support for MatrixTables - #12293
Merged
Merged
Conversation
tpoterba
suggested changes
Oct 8, 2022
tpoterba
left a comment
Contributor
There was a problem hiding this comment.
awesome! a couple test comments
| expected = [(0,0),(0,1),(0,2),(1,1),(1,2),(1,3),(2,2),(2,3),(2,4)] | ||
| for idx, (x, y) in enumerate(zip(data.x, data.y)): | ||
| assert(expected[idx][0] == x) | ||
| assert(expected[idx][1] == y) |
Contributor
There was a problem hiding this comment.
could we add a test that we get the right output for non-entry-indexed fields? mt.row_idx and mt.row_idx * 2 for instance (I want to make sure we get 3 points, not 9)?
Also, a sneaky way this testing pattern can be violated is if the lengths of expected isn't the same as data.x or data.y. Let's add an assertion that the lengths of all three agree.
iris-garden
force-pushed
the
query/ggplot/matrix-tables
branch
from
October 11, 2022 14:00
ff54240 to
21f0d29
Compare
tpoterba
approved these changes
Oct 11, 2022
iris-garden
force-pushed
the
query/ggplot/matrix-tables
branch
from
October 25, 2022 18:12
21f0d29 to
d7fe153
Compare
CHANGELOG: Added support for `hail.MatrixTable`s to `hail.ggplot`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently,
ggplotexpects aTableto be passed in as its data, and errors if passed aMatrixTable. With this change, the following code:Which produces a
MatrixTablethat looks like this:Can be plugged into
ggplotlike so:To produce this plot:
This is accomplished using
Expr._to_tableto transform theMatrixTablesuch that the fields used to generate the plot can be straightforwardly selected from it.