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: iterate over sorted rows for rendering #202

Merged
merged 4 commits into from
Feb 22, 2024
Merged

fix: iterate over sorted rows for rendering #202

merged 4 commits into from
Feb 22, 2024

Conversation

machow
Copy link
Collaborator

@machow machow commented Feb 16, 2024

This PR addresses #201, by ensuring we iterate over rows sorted by grouping when rendering.

TODO (Rich said he'll take from here):

  • add a test

Fixes: #201

@github-actions github-actions bot temporarily deployed to pr-202 February 16, 2024 19:21 Destroyed
@machow machow assigned machow and unassigned rich-iannone Feb 21, 2024
@machow
Copy link
Collaborator Author

machow commented Feb 21, 2024

I can pick this one back up! (changed the assignee)

@github-actions github-actions bot temporarily deployed to pr-202 February 21, 2024 16:18 Destroyed
@machow
Copy link
Collaborator Author

machow commented Feb 21, 2024

There is an extra entry in group B in our test. From pairing w/ Rich it sounds like maybe an off by 1 error

image

edit: actually (still pairing) it looks like this method...

GT._group_rows.indices_map()

@machow
Copy link
Collaborator Author

machow commented Feb 21, 2024

Okay, I've gotten the snapshot to produce the correct output. I'm not sure how .indices_map() works in the original R program, but I tweaked it to return 1 entry per row, so we can iterate over it directly when rendering. In general, I think it'd be useful for us to trace / sequence diagram when things get reordered. The internal logic is clear, but it seems a bit tricky to know when/where all reorderings have happened!

@github-actions github-actions bot temporarily deployed to pr-202 February 21, 2024 22:35 Destroyed
@rich-iannone
Copy link
Member

Okay, I've gotten the snapshot to produce the correct output. I'm not sure how .indices_map() works in the original R program, but I tweaked it to return 1 entry per row, so we can iterate over it directly when rendering. In general, I think it'd be useful for us to trace / sequence diagram when things get reordered. The internal logic is clear, but it seems a bit tricky to know when/where all reorderings have happened!

It is tricky. Was that way in the R implementation as well. But I found peace there after lots of patches and extensive testing (it became a solved problem). Definitely would be good for us to diagram/explain the internals a bit!

Copy link
Member

@rich-iannone rich-iannone left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@machow machow merged commit 9e12d27 into main Feb 22, 2024
7 checks passed
@rich-iannone rich-iannone deleted the fix-render-order branch February 22, 2024 03:33
@jrycw
Copy link
Contributor

jrycw commented Feb 22, 2024

Nice work!

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.

Issue of reordering
3 participants