Fixed .shallow to consistently retain keys and indices.#2337
Merged
mattdowle merged 10 commits intoRdatatable:masterfrom Sep 11, 2017
Merged
Fixed .shallow to consistently retain keys and indices.#2337mattdowle merged 10 commits intoRdatatable:masterfrom
mattdowle merged 10 commits intoRdatatable:masterfrom
Conversation
Contributor
Author
|
Gets a problem on foverlaps test in travis that I don't get locally. Will need to investigate. |
Codecov Report
@@ Coverage Diff @@
## master #2337 +/- ##
==========================================
+ Coverage 91.09% 91.14% +0.05%
==========================================
Files 61 61
Lines 11785 11804 +19
==========================================
+ Hits 10735 10759 +24
+ Misses 1050 1045 -5
Continue to review full report at Codecov.
|
Contributor
Author
|
Initially, my local tests didn't include fOverlaps since genomicRanges was not installed. Now, everything should be fixed. |
mattdowle
added a commit
that referenced
this pull request
Sep 11, 2017
… to logic changes only (concerns shallow and keys)
mattdowle
added a commit
that referenced
this pull request
Sep 11, 2017
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.
Closes #2336.
Keys and indices are retained correctly by shallow if
retain.key = TRUEandcols != NULL.The largest possible part of an index is retained.
If the original index was on x1, x2, x3, and `cols = c("x1", "x2"),
the shallow copy gets the same index for c("x1", "x2") (if there was a native index on x1 and x2, this is kept)
Tests have been added.
A benchmark (code at end of this post) shows that there is no negative speed impact:
The improved key retainment makes it possible to clean
setattrcalls infoverlaps.Rwhile still passing all tests.Code for benchmark