-
Notifications
You must be signed in to change notification settings - Fork 8
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
refactor: simplify ungrouped epix_slide #517
base: dev
Are you sure you want to change the base?
Conversation
Sorry, behind on PR reviews. This sounds nice for thinking about things, but scary for maintenance (code duplication & having to update multiple places). I would prefer if we maybe tagged this or, if group agrees, removed the grouping features, so we only have to update 1 epix_slide per update. |
FWIW, when it comes to updating code in two or three places, I'm not that against it on principle, as long as the code comments point to similar code. But I'd also be happy to consider removing the grouped features. |
Probably better to build shared functions and then call those twice (e.g. |
2b63c52
to
8202c0e
Compare
# We want a slide on ungrouped archives to output something | ||
# ungrouped, rather than retaining the trivial (0-variable) | ||
# grouping applied above. So we `ungroup()`. However, the current | ||
# `dplyr` implementation automatically ignores/drops trivial | ||
# groupings, so this is just a no-op for now. | ||
ungroup() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: (if we don't merge this PR) this comment and ungroup()
don't make sense now, since we stopped grouping the epix_slide
output a while ago.
# `dplyr` implementation automatically ignores/drops trivial | ||
# groupings, so this is just a no-op for now. | ||
ungroup() | ||
### START Copy pasta from grouped_epi_archive ### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idea: also cross-ref in epix_slide.grouped_epi_archive if not already, to remind we need to update here? Though it's easy to miss such comments in such a long function.
Sorry, I've let this PR get out of sync with slide updates, so this copy-pasta would need updated as well, rather than along the way. I was hoping we'd decide on whether to remove grouping capabilities first, but that got punted. You feel strongly that the alternative code here is worth the copy-pasta?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll see, maybe I'll make a wrapper like david suggests or I'll add a comment back in the grouped version, but first we'll need to rebase. I probably won't get to this PR until the end of next week, since I'm focusing on docs this week and will be on PTO Mon - Wed next week.
Checklist
Please:
PR).
brookslogan, nmdefries.
DESCRIPTION
. Always incrementthe patch version number (the third number), unless you are making a
release PR from dev to main, in which case increment the minor version
number (the second number).
(backwards-incompatible changes to the documented interface) are noted.
Collect the changes under the next release number (e.g. if you are on
1.7.2, then write your changes under the 1.8 heading).
process.
Change explanations for reviewer
Mostly just copied the existing
epix_slide
code, but removed the group_by concerns. The function is simpler and a bit more readable now.Magic GitHub syntax to mark associated Issue(s) as resolved when this is merged into the default branch