Skip to content

Commit

Permalink
Merge branch 'master' into dogroupsverbose
Browse files Browse the repository at this point in the history
  • Loading branch information
joshhwuu authored Aug 1, 2024
2 parents fc0c1e7 + 2349536 commit d375e4a
Show file tree
Hide file tree
Showing 50 changed files with 2,229 additions and 1,308 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
^\.devcontainer$
^\.graphics$
^\.github$
^\.zed$

^\.gitlab-ci\.yml$

Expand Down Expand Up @@ -45,3 +46,6 @@
^lib$
^library$
^devwd$

# only the inst/po compressed files are needed, not raw .pot/.po
^po$
40 changes: 38 additions & 2 deletions .ci/atime/tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,42 @@ test.list <- atime::atime_test_list(
data.table:::setDT(L)
},
Slow = "c4a2085e35689a108d67dacb2f8261e4964d7e12", # Parent of the first commit in the PR that fixes the issue (https://github.com/Rdatatable/data.table/commit/7cc4da4c1c8e568f655ab5167922dcdb75953801)
Fast = "1872f473b20fdcddc5c1b35d79fe9229cd9a1d15") # Last commit in the PR that fixes the issue (https://github.com/Rdatatable/data.table/pull/5427/commits)
)
Fast = "1872f473b20fdcddc5c1b35d79fe9229cd9a1d15"), # Last commit in the PR that fixes the issue (https://github.com/Rdatatable/data.table/pull/5427/commits)

# Issue reported in: https://github.com/Rdatatable/data.table/issues/4200
# To be fixed in: https://github.com/Rdatatable/data.table/pull/4558
"DT[by] fixed in #4558" = atime::atime_test(
N = 10^seq(1, 20),
setup = {
d <- data.table(
id3 = sample(c(seq.int(N*0.9), sample( N*0.9, N*0.1, TRUE))),
v1 = sample(5L, N, TRUE),
v2 = sample(5L, N, TRUE)
)
},
expr = {
expr=data.table:::`[.data.table`(d, , max(v1) - min(v2), by = id3)
},
Before = "7a9eaf62ede487625200981018d8692be8c6f134", # Parent of the first commit (https://github.com/Rdatatable/data.table/commit/515de90a6068911a148e54343a3503043b8bb87c) in the PR (https://github.com/Rdatatable/data.table/pull/4164/commits) that introduced the regression
Regression = "c152ced0e5799acee1589910c69c1a2c6586b95d", # Parent of the first commit (https://github.com/Rdatatable/data.table/commit/15f0598b9828d3af2eb8ddc9b38e0356f42afe4f) in the PR (https://github.com/Rdatatable/data.table/pull/4558/commits) that fixes the regression
Fixed = "f750448a2efcd258b3aba57136ee6a95ce56b302"), # Second commit of the PR (https://github.com/Rdatatable/data.table/pull/4558/commits) that fixes the regression

# Issue with sorting again when already sorted: https://github.com/Rdatatable/data.table/issues/4498
# Fixed in: https://github.com/Rdatatable/data.table/pull/4501
"DT[,.SD] improved in #4501" = atime::atime_test(
N = 10^seq(1, 10, by=0.5),
setup = {
set.seed(1)
L = as.data.table(as.character(rnorm(N, 1, 0.5)))
setkey(L, V1)
},
## New DT can safely retain key.
expr = {
data.table:::`[.data.table`(L, , .SD)
},
Fast = "353dc7a6b66563b61e44b2fa0d7b73a0f97ca461", # Close-to-last merge commit in the PR (https://github.com/Rdatatable/data.table/pull/4501/commits) that fixes the issue
Slow = "3ca83738d70d5597d9e168077f3768e32569c790", # Circa 2024 master parent of close-to-last merge commit (https://github.com/Rdatatable/data.table/commit/353dc7a6b66563b61e44b2fa0d7b73a0f97ca461) in the PR (https://github.com/Rdatatable/data.table/pull/4501/commits) that fixes the issue
Slower = "cacdc92df71b777369a217b6c902c687cf35a70d"), # Circa 2020 parent of the first commit (https://github.com/Rdatatable/data.table/commit/74636333d7da965a11dad04c322c752a409db098) in the PR (https://github.com/Rdatatable/data.table/pull/4501/commits) that fixes the issue

NULL)
# nolint end: undesirable_operator_linter.
2 changes: 1 addition & 1 deletion .dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ source(".dev/cc.R")
Developer helper script providing `cc` function. If one starts R session in `data.table` project root directory `.dev/cc.R` file should be automatically sourced (due to local `.Rprofile` file) making `cc()` (and `dd()`) function available straightaway.

```r
cc(test=FALSE, clean=FALSE, debug=FALSE, omp=!debug, cc_dir, path=Sys.getenv("PROJ_PATH"), CC="gcc")
cc(test=FALSE, clean=FALSE, debug=FALSE, omp=!debug, path=Sys.getenv("PROJ_PATH", unset=normalizePath(".")), CC="gcc", quiet=FALSE)
```

Use `cc()` to re-compile all C sources and attach all `data.table` R functions (including non-exported ones).
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/R-CMD-check-occasional.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
schedule:
- cron: '17 13 17 * *' # 17th of month at 13:17 UTC
- cron: '17 13 18 * *' # 18th of month at 13:17 UTC

# A more complete suite of checks to run monthly; each PR/merge need not pass all these, but they should pass before CRAN release
name: R-CMD-check-occasional
Expand Down Expand Up @@ -83,11 +83,15 @@ jobs:
run: brew install gdal proj

- name: Install remotes
env:
R_LIBS_USER: /home/runner/work/r-lib
run: install.packages("remotes")
shell: Rscript {0}

- name: Install system dependencies
if: runner.os == 'Linux'
env:
R_LIBS_USER: /home/runner/work/r-lib
run: |
while read -r cmd
do
Expand All @@ -103,6 +107,7 @@ jobs:
R_LIBS_USER: /home/runner/work/r-lib
run: |
options(crayon.enabled = TRUE)
install.packages("remotes") # different R_LIBS_USER now...
remotes::install_deps(dependencies=TRUE, force=TRUE)
# we define this in data.table namespace, but it appears to be exec
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ config.log
.Rproj.user
data.table.Rproj

# zed editor
.zed

# produced vignettes
vignettes/*.html
vignettes/*.pdf
Expand Down
26 changes: 16 additions & 10 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,16 @@ test-lin-rel:
<<: *test-lin
image: registry.gitlab.com/jangorecki/dockerfiles/r-data.table
variables:
_R_CHECK_COMPILATION_FLAGS_KNOWN_: "-Wvla"
_R_CHECK_CRAN_INCOMING_: "FALSE"
_R_CHECK_CRAN_INCOMING_REMOTE_: "FALSE"
_R_CHECK_FORCE_SUGGESTS_: "TRUE"
_R_CHECK_TESTS_NLINES_: "0"
OPENBLAS_MAIN_FREE: "1"
script:
- *install-deps
- echo 'CFLAGS=-g -O3 -flto=auto -fno-common -fopenmp -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' > ~/.R/Makevars
- echo 'CXXFLAGS=-g -O3 -flto=auto -fno-common -fopenmp -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' >> ~/.R/Makevars
- echo 'CFLAGS=-g -O3 -flto=auto -fno-common -fopenmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' > ~/.R/Makevars
- echo 'CXXFLAGS=-g -O3 -flto=auto -fno-common -fopenmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' >> ~/.R/Makevars
- R CMD check $(ls -1t data.table_*.tar.gz | head -n 1)
- (! grep "warning:" data.table.Rcheck/00install.out)

Expand All @@ -131,9 +132,11 @@ test-lin-rel:
test-lin-rel-vanilla:
<<: *test-lin
image: registry.gitlab.com/jangorecki/dockerfiles/r-base-gcc
variables:
_R_CHECK_COMPILATION_FLAGS_KNOWN_: "-Wvla"
script:
- echo 'CFLAGS=-g -O0 -fno-openmp -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' > ~/.R/Makevars
- echo 'CXXFLAGS=-g -O0 -fno-openmp -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' >> ~/.R/Makevars
- echo 'CFLAGS=-g -O0 -fno-openmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' > ~/.R/Makevars
- echo 'CXXFLAGS=-g -O0 -fno-openmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' >> ~/.R/Makevars
- R CMD check --no-manual --ignore-vignettes $(ls -1t data.table_*.tar.gz | head -n 1)

## R-release on Linux
Expand All @@ -143,14 +146,15 @@ test-lin-rel-cran:
<<: *test-lin
image: registry.gitlab.com/jangorecki/dockerfiles/r-base
variables:
_R_CHECK_COMPILATION_FLAGS_KNOWN_: "-Wvla"
_R_CHECK_CRAN_INCOMING_: "TRUE" ## stricter --as-cran checks should run in dev pipelines continuously (not sure what they are though)
_R_CHECK_CRAN_INCOMING_REMOTE_: "FALSE" ## Other than no URL checking (takes many minutes) or 'Days since last update 0' NOTEs needed, #3284
_R_CHECK_CRAN_INCOMING_TARBALL_THRESHOLD_: "7500000" ## bytes
_R_CHECK_PKG_SIZES_THRESHOLD_: "7" ## MB 'checking installed package size' NOTE
script:
- *install-deps
- echo 'CFLAGS=-g -O2 -fopenmp -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' > ~/.R/Makevars
- echo 'CXXFLAGS=-g -O2 -fopenmp -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' >> ~/.R/Makevars
- echo 'CFLAGS=-g -O2 -fopenmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' > ~/.R/Makevars
- echo 'CXXFLAGS=-g -O2 -fopenmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' >> ~/.R/Makevars
- R CMD check --as-cran $(ls -1t data.table_*.tar.gz | head -n 1)
- >-
Rscript -e 'l=tail(readLines("data.table.Rcheck/00check.log"), 1L); if (!identical(l, "Status: OK")) stop("Last line of ", shQuote("00check.log"), " is not ", shQuote("Status: OK"), " but ", shQuote(l)) else q("no")'
Expand All @@ -163,13 +167,14 @@ test-lin-dev-gcc-strict-cran:
<<: *test-lin
image: registry.gitlab.com/jangorecki/dockerfiles/r-devel-gcc-strict
variables:
_R_CHECK_COMPILATION_FLAGS_KNOWN_: "-Wvla"
_R_CHECK_CRAN_INCOMING_: "TRUE"
_R_CHECK_CRAN_INCOMING_REMOTE_: "FALSE"
_R_S3_METHOD_LOOKUP_BASEENV_AFTER_GLOBALENV_: "FALSE" ## detects S3 method lookup found on search path #4777
_R_S3_METHOD_LOOKUP_REPORT_SEARCH_PATH_USES_: "TRUE"
script:
- echo 'CFLAGS=-g -O2 -flto=auto -fno-common -fopenmp -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' > ~/.R/Makevars
- echo 'CXXFLAGS=-g -O2 -flto=auto -fno-common -fopenmp -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' >> ~/.R/Makevars
- echo 'CFLAGS=-g -O2 -flto=auto -fno-common -fopenmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' > ~/.R/Makevars
- echo 'CXXFLAGS=-g -O2 -flto=auto -fno-common -fopenmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' >> ~/.R/Makevars
- *install-deps
- R CMD check --as-cran $(ls -1t data.table_*.tar.gz | head -n 1)
- (! grep "warning:" data.table.Rcheck/00install.out)
Expand All @@ -184,13 +189,14 @@ test-lin-dev-clang-cran:
<<: *test-lin
image: registry.gitlab.com/jangorecki/dockerfiles/r-devel-clang
variables:
_R_CHECK_COMPILATION_FLAGS_KNOWN_: "-Wvla"
_R_CHECK_CRAN_INCOMING_: "TRUE"
_R_CHECK_CRAN_INCOMING_REMOTE_: "FALSE"
_R_S3_METHOD_LOOKUP_BASEENV_AFTER_GLOBALENV_: "FALSE"
_R_S3_METHOD_LOOKUP_REPORT_SEARCH_PATH_USES_: "TRUE"
script:
- echo 'CFLAGS=-g -O2 -fno-common -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' > ~/.R/Makevars
- echo 'CXXFLAGS=-g -O2 -fno-common -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' >> ~/.R/Makevars
- echo 'CFLAGS=-g -O2 -fno-common -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' > ~/.R/Makevars
- echo 'CXXFLAGS=-g -O2 -fno-common -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' >> ~/.R/Makevars
- *install-deps
- R CMD check --as-cran $(ls -1t data.table_*.tar.gz | head -n 1)
- (! grep "warning:" data.table.Rcheck/00install.out)
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Authors@R: c(
person("Jan","Gorecki", role="aut"),
person("Michael","Chirico", role="aut", comment = c(ORCID="0000-0003-0787-087X")),
person("Toby","Hocking", role="aut", comment = c(ORCID="0000-0002-3146-0865")),
person("Benjamin","Schwendinger",role="aut"),
person("Benjamin","Schwendinger",role="aut", comment = c(ORCID="0000-0003-3315-8114")),
person("Pasha","Stetsenko", role="ctb"),
person("Tom","Short", role="ctb"),
person("Steve","Lianoglou", role="ctb"),
Expand Down
3 changes: 1 addition & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export(substitute2)
#export(DT) # mtcars |> DT(i,j,by) #4872 #5472

S3method("[", data.table)
export("[.data.table") # so that functional DT() finds it; PR#5176
S3method("[<-", data.table)
# S3method("[[", data.table)
# S3method("[[<-", data.table)
Expand Down Expand Up @@ -202,5 +201,5 @@ S3method(format_col, expression)
export(format_list_item)
S3method(format_list_item, default)

export(fdroplevels)
export(fdroplevels, setdroplevels)
S3method(droplevels, data.table)
Loading

0 comments on commit d375e4a

Please sign in to comment.