Skip to content

Commit 4279ef0

Browse files
Merge pull request #641 from StuartWheater/v6.3.5-dev
Update to Opal perf profile and addition of 'on.exit' for warn option
2 parents a609cb3 + 70b467b commit 4279ef0

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

R/ds.table.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,12 @@ if(num.table.dims==1)
15391539

15401540
}#END second dim=1 loop
15411541

1542+
#################################################
1543+
# Setup on.exit() to restore options 'warn' value
1544+
#################################################
1545+
1546+
old_warn_option <- base::getOption("warn")
1547+
on.exit(base::options(warn = old_warn_option), add = TRUE)
15421548

15431549
################################
15441550
#NOW UNDERTAKE CHISQUARED TESTS#

R/ds.table2D.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@ ds.table2D <- function(x=NULL, y=NULL, type='both', warningMessage=TRUE, datasou
112112
stop("Function argument 'type' has to be either 'combine', 'split' or 'both'")
113113
}
114114

115+
#################################################
116+
# Setup on.exit() to restore options 'warn' value
117+
#################################################
118+
119+
old_warn_option <- base::getOption("warn")
120+
on.exit(base::options(warn = old_warn_option), add = TRUE)
121+
115122
# the input variable might be given as column table (i.e. D$x)
116123
# or just as a vector not attached to a table (i.e. x)
117124
# we have to make sure the function deals with each case

R/glmChecks.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ glmChecks <- function(formula, data, offset, weights, datasources){
5252
varIdentifier <- append(varIdentifier, "weights")
5353
}
5454

55+
#################################################
56+
# Setup on.exit() to restore options 'warn' value
57+
#################################################
58+
59+
old_warn_option <- base::getOption("warn")
60+
on.exit(base::options(warn = old_warn_option), add = TRUE)
61+
62+
5563
# check that each variable is defined and not empty and each study. Stop the process if any check fails
5664
stdnames <- names(datasources)
5765
for(i in 1:length(elts)){

tests/testthat/perf_files/default_perf_profile.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"ds.asNumeric::perf:0","2.185","0.5","2"
77
"ds.assign::perf::0","5.490","0.5","2"
88
"ds.class::perf::combine:0","4.760","0.5","2"
9-
"ds.colnames::perf:0","4.159","0.5","2"
9+
"ds.colnames::perf:0","9.079","0.5","2"
1010
"ds.exists::perf::combine:0","11.09","0.5","2"
1111
"ds.length::perf::combine:0","9.479","0.5","2"
1212
"ds.mean::perf::combine:0","9.650","0.5","2"
1313
"ds.mean::perf::split:0","11.26","0.5","2"
14-
"void::perf::void::0","46250.0","0.5","2"
14+
"void::perf::void::0","46250.0","0.5","2"

tests/testthat/perf_files/opal_azure-pipeline.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"ds.asNumeric::perf:0","2.185","0.5","2"
77
"ds.assign::perf::0","5.490","0.5","2"
88
"ds.class::perf::combine:0","4.760","0.5","2"
9-
"ds.colnames::perf:0","4.159","0.5","2"
9+
"ds.colnames::perf:0","9.079","0.5","2"
1010
"ds.exists::perf::combine:0","11.09","0.5","2"
1111
"ds.length::perf::combine:0","9.479","0.5","2"
1212
"ds.mean::perf::combine:0","9.650","0.5","2"

0 commit comments

Comments
 (0)