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

Added decreasing parameter to sort_unique() to address #950. #958

Merged
merged 7 commits into from Mar 23, 2019

Conversation

@coatless
Copy link
Contributor

commented Mar 20, 2019

No description provided.

@eddelbuettel

This comment has been minimized.

Copy link
Collaborator

commented on be02cdf Mar 20, 2019

That is likely something else. We have years of experience spending 15 minutes here with half each in build and test.

Maybe something else is going on.

I also have another / different fix in another repo.

@eddelbuettel

This comment has been minimized.

Copy link
Member

commented Mar 21, 2019

I see a test failure:

1 Test Suite : 
Rcpp Unit Tests - 611 test functions, 0 errors, 1 failure
FAILURE in test.sort_unique: Error in checkEquals(sort(unique(x), decreasing = TRUE, na.last = TRUE),  : 
  'is.NA' value mismatch: 1 in current 1 in target
unique / character / with NA / decreasing sort

This fixes it:

modified   inst/unitTests/runit.sugar.R
@@ -689,6 +689,7 @@ if (.runThisTest) {
 
     test.sort_unique <- function() {
 
+        set.seed(123)
         x <- sample(LETTERS[1:5], 10, TRUE)
         checkEquals(
             sort(unique(x), decreasing = TRUE),
@@ -704,7 +705,7 @@ if (.runThisTest) {
 
         x <- c(x, NA, NA)
         checkEquals(
-            sort(unique(x), decreasing = TRUE, na.last = TRUE),
+            sort(unique(x), decreasing = TRUE, na.last = FALSE),
             runit_sort_unique_ch(x, decreasing = TRUE),
             "unique / character / with NA / decreasing sort"
         )
@coatless

This comment has been minimized.

Copy link
Contributor Author

commented Mar 21, 2019

Thanks @eddelbuettel for catching that.

coatless added some commits Mar 21, 2019

Use `na.last = FALSE` to disable changing orders.
Note: `unique()`'s unit test use `na.last = TRUE` because sorting was done at the R level instead of the C++ level.
@eddelbuettel

This comment has been minimized.

Copy link
Member

commented Mar 21, 2019

What I don't understand is why it manifested itself the way it did camouflaging as a timeout -- that may be an issue with the Docker setup.

@coatless coatless force-pushed the coatless:issue950-sort branch from 1786b19 to 64e2bde Mar 21, 2019

@eddelbuettel eddelbuettel merged commit 9c981a3 into RcppCore:master Mar 23, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.