-
Notifications
You must be signed in to change notification settings - Fork 1k
Get other.Rraw running again in r-devel #7833
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
Open
MichaelChirico
wants to merge
8
commits into
master
Choose a base branch
from
other-attach-order
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+22
−16
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ef57676
use attach.required=FALSE to solve "ggplot not found" error
MichaelChirico 2800a16
Fix ggplot2 tests after further implementation updates
MichaelChirico 5d4d62a
Fix cedta() handling of example()
MichaelChirico 28a5070
dont use native lambda (yet)
MichaelChirico 58ce9c4
attach.required not yet available in 3.5.0
MichaelChirico 495720f
use explicit integer to avoid long double requirement
MichaelChirico 0379354
tryCatch(), not try(), for ignoring warning
MichaelChirico 20963c5
cat(), not warning(), to avoid CI failure
MichaelChirico File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| pkgs = c("DBI", "RSQLite", "bit64", "caret", "dplyr", "gdata", "ggplot2", "hexbin", "knitr", "nanotime", "nlme", "parallel", "plyr", "R.utils", "sf", "vctrs", "xts", "yaml", "zoo") | ||
| pkgs = c("DBI", "RSQLite", "bit64", "ggplot2", "caret", "dplyr", "gdata", "hexbin", "knitr", "nanotime", "nlme", "parallel", "plyr", "R.utils", "sf", "vctrs", "zoo", "xts", "yaml") | ||
| # First expression of this file must be as above: .gitlab-ci.yml uses parse(,n=1L) to read one expression from this file and installs pkgs. | ||
| # So that these dependencies of other.Rraw are maintained in a single place. | ||
| # TEST_DATA_TABLE_WITH_OTHER_PACKAGES is off by default so this other.Rraw doesn't run on CRAN. It is run by GLCI, locally in dev, and by | ||
| # users running test.data.table("other.Rraw"). | ||
| # zoo needs to be before xts for #5101 otherwise xts's dependency zoo gets attached at position 2 if xts is loaded first | ||
| # TODO(R>=3.6.0): use attach.required=FALSE to let us keep pkgs= in alphabetical order (https://stat.ethz.ch/pipermail/r-devel/2026-July/084630.html) | ||
|
|
||
| # Optional Suggest-ed package tests moved from tests.Rraw to here in #5516. Retaining their comments: | ||
| # "xts", # we have xts methods in R/xts.R | ||
|
|
@@ -27,7 +27,7 @@ INT = data.table:::INT | |
| if (anyDuplicated(pkgs)) stop("Packages defined to be loaded for integration tests in 'inst/tests/other.Rraw' contains duplicates.") | ||
|
|
||
| f = function(pkg) suppressWarnings(suppressMessages(isTRUE( | ||
| library(pkg, character.only=TRUE, logical.return=TRUE, warn.conflicts=FALSE, pos="package:base") # attach at the end for #5101 | ||
| library(pkg, character.only=TRUE, logical.return=TRUE, warn.conflicts=FALSE, pos="package:base") # attach at the end for #5101 | ||
| ))) | ||
| loaded = sapply(pkgs, f) | ||
| if (!all(loaded)) { | ||
|
|
@@ -56,13 +56,12 @@ if (all(c("package:reshape", "package:reshape2") %in% search())) { | |
|
|
||
| if (loaded[["ggplot2"]]) { | ||
| DT = data.table( a=1:5, b=11:50, d=c("A","B","C","D"), f=1:5, grp=1:5 ) | ||
| test(1.1, names(print(ggplot(DT,aes(b,f))+geom_point()))[c(1,3)], c("data","scales")) # update as described in #3047 | ||
| test(1.2, DT[,print(ggplot(.SD,aes(b,f))+geom_point()),by=list(grp%%2L)],data.table(grp=integer())) # %%2 to reduce time needed for ggplot2 to plot | ||
| print_without_error = function(x) !inherits(tryCatch(print(x), error=identity), "error") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need this here? Previously we/you have used the |
||
| test(1.1, print_without_error(ggplot(DT, aes(b,f)) + geom_point())) # update as described in #3047 | ||
| test(1.2, DT[, print_without_error(ggplot(.SD, aes(b,f)) + geom_point()), by=list(grp %% 2L)][, all(V1)]) # %%2 to reduce time needed for ggplot2 to plot | ||
| if (loaded[["hexbin"]]) { | ||
| # Test reported by C Neff on 11 Oct 2011 | ||
| # TODO(r-lib/gtable#94): don't suppressWarnings() here. | ||
| x <- suppressWarnings(print(ggplot(DT) + geom_hex(aes(b, f)) + facet_wrap(~grp))) | ||
| test(1.3, names(x)[c(1L, 3L)], c("data", "scales")) | ||
| test(1.3, print_without_error(ggplot(DT) + geom_hex(aes(b, f)) + facet_wrap(~grp))) | ||
| } | ||
| # Test plotting ITime with ggplot2 which seems to require an as.data.frame method for ITime, #1713 | ||
| datetimes = c("2011 NOV18 09:29:16", "2011 NOV18 10:42:40", "2011 NOV18 23:47:12", | ||
|
|
@@ -74,8 +73,12 @@ if (loaded[["ggplot2"]]) { | |
| # test(1.4, print(DT[,qplot(idate,itime)])$ranges, | ||
| # message="Don't know how to automatically pick scale for object of type ITime. Defaulting to continuous") | ||
|
|
||
| test(1.5, print(DT[,qplot(idate,as.POSIXct(itime,tzone=""))])$ranges, print(qplot(idate,as.POSIXct(itime,tzone=""),data=DT))$ranges) | ||
| try(graphics.off(),silent=TRUE) | ||
| # qplot() soon to be deleted, unclear how to adapt the test meaningfully after that... | ||
| invisible(tryCatch(qplot(), condition=function(.) NULL)) # force deprecation warning | ||
| test(1.5, all.equal( | ||
| print(DT[, qplot(idate, as.POSIXct(itime, tzone=""))]), | ||
| print(qplot(idate, as.POSIXct(itime, tzone=""), data=DT)))) | ||
| try(graphics.off(), silent=TRUE) | ||
| } | ||
|
|
||
| if (loaded[["plyr"]]) { | ||
|
|
@@ -166,10 +169,11 @@ if (loaded[["nlme"]]) { | |
|
|
||
| if (loaded[["bit64"]]) { | ||
| # these don't pass UBSAN/USAN because of the overflow, so just here in other.Rraw | ||
| test(9.1, as.character((as.integer64(2^62)-1)*2+1), "9223372036854775807") | ||
| test(9.2, as.character((as.integer64(2^62)-1)*2+2), NA_character_, warning="integer64 overflow") | ||
| test(9.3, as.character(-(as.integer64(2^62)-1)*2-1), "-9223372036854775807") | ||
| test(9.4, as.character(-(as.integer64(2^62)-1)*2-2), NA_character_, warning="integer64.*flow") | ||
| # Use 'L' to avoid integer64-double math when 'long double' is unavailable. | ||
| test(9.1, as.character((as.integer64(2^62)-1L)*2L+1L), "9223372036854775807") | ||
| test(9.2, as.character((as.integer64(2^62)-1L)*2L+2L), NA_character_, warning="integer64 overflow") | ||
| test(9.3, as.character(-(as.integer64(2^62)-1L)*2L-1L), "-9223372036854775807") | ||
| test(9.4, as.character(-(as.integer64(2^62)-1L)*2L-2L), NA_character_, warning="integer64.*flow") | ||
| } | ||
|
|
||
| if (loaded[["gdata"]]) { | ||
|
|
@@ -197,7 +201,9 @@ if (loaded[["knitr"]]) { | |
| if (loaded[["parallel"]]) { | ||
| #1745 and #1727 | ||
| if (.Platform$OS.type=="windows") { | ||
| warning("This test of auto fallback to single threaded mode when data.table is used from package parallel, does not run on Windows because 'mc.cores'>1 is not supported on Windows; i.e., parallel package isn't parallel on Windows, IIUC. Whereas data.table is parallel built-in on Windows for some functions (fwrite/fread/fsort and expanding) using OpenMP.") | ||
| cat( | ||
| strwrap("This test of auto fallback to single threaded mode when data.table is used from package parallel, does not run on Windows because 'mc.cores'>1 is not supported on Windows; i.e., parallel package isn't parallel on Windows, IIUC. Whereas data.table is parallel built-in on Windows for some functions (fwrite/fread/fsort and expanding) using OpenMP.\n"), | ||
| sep="\n") | ||
| } else { | ||
| setDTthreads(2) | ||
| if (getDTthreads()!=2) { | ||
|
|
||
Oops, something went wrong.
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.
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.
Could we maybe add a comment above why we enforce this ordering? seems out of the blue without reading later comment