-
Notifications
You must be signed in to change notification settings - Fork 2
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
Dev #25
Conversation
This file contains 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
This commit overhauls the implementation and interface of `add_parent_interval()` and `merge_episodes()`: - The `merge_episodes()` generic has had it's signature tweaked to widen how it can be used. This has been done with the addition of a default method that consequently means the following are equivalent: with(dat, merge_episodes(id, start, end)) reframe(dat, merge_episodes(id, start, end)) merge_episodes(dat, "id", "start", "end") `add_parent_interval()` has been updated in a similar fashion. - Breaking change: `merge_episodes` and `add_parent_interval()` now require column names to be explicitly stated for the data frame methods. I.e. Where, in the previous release, merge_episodes(dat) would have defaults "id", "start" and "end" for the `id`, `start` and `end` arguments this would now be written as merge_episodes(dat, "id", "start", "end"). - Input checking and subsequent error signalling has been improved. - C code for .calculate_parent() has been made more robust. - Tests have been updated accordingly but are still rather lacking (hoping to address this in future commits).
- Use cli for error messaging. - In `merge_episodes()` we not catch from calling add_parent_interval() and chain together for a more useful output. - General tweaks to messages for clarity.
TimTaylor
requested review from
Lextuga007
and removed request for
Lextuga007
September 24, 2024 14:36
@Lextuga007 - this is the sort of thing I've been mulling over for the refactor. Marking as draft for the time being to get your thoughts. |
I had only partially implemented this (for some reason thought it was finished). It adds too much complexity so best to leave to the user to generate a uid as needed.
Lextuga007
requested changes
Sep 25, 2024
@Lextuga007 - I'm going to close this for the moment but keep working on the same dev branch with a slightly revised implementation that utilises tidyselect/non-standard evaluation (per our slack musings). Will do another PR (probably next week now though). |
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.
This PR overhauls the implementation and interface of
add_parent_interval()
andmerge_episodes()
:merge_episodes()
generic has had it's signature tweaked to widen how it can be used. This has been done with the addition of a default method that consequently means the following are equivalent:add_parent_interval()
has been updated in a similar fashion.For bothEDIT: This wasn't fully implemented and think it is best left to the user to ensure in hindsight. Have removed partial implementation.merge_episodes()
andadd_parent_interval()
, theid
argument can now be of length greater than one. In essence this is akin to constructing unique identifiers across multiple variables (I'm unsure if this is useful or not at the moment).BREAKING CHANGE:
merge_episodes
andadd_parent_interval()
now require column names to be explicitly stated for the data frame methods. I.e. Where, in the previous release,merge_episodes(dat)
would have defaults "id", "start" and "end" for theid
,start
andend
arguments, this would now be written asmerge_episodes(dat, "id", start", "end")
.Input checking and subsequent error signalling has been improved.
In
merge_episodes()
we now catch errors from calling add_parent_interval() and chain together for a more useful output.Return to using the cli package for error signalling/messaging.
C code for .calculate_parent() has been made more robust.
BREAKING CHANGE: For both
merge_episodes()
andadd_parent_interval()
, users can now control the output column names. These arguments have been given slightly different defaults to what was set automatically in the previous version (hence the breaking change warning).Tests have been updated accordingly but are still rather lacking (hoping to address this in future commits in this PR).EDIT: Tests now updated.