Skip to content

Commit 09420a9

Browse files
authored
Fix test warnings and update output messages
1 parent f033f91 commit 09420a9

1 file changed

Lines changed: 29 additions & 29 deletions

File tree

inst/tests/froll.Rraw

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ test(6000.0671, frollmean(c(1:2,NA,4:10), 4), c(rep(NA_real_, 6), 5.5, 6.5, 7.5,
310310
"frollmeanFast: non-finite values are present in input, skip non-finite unaware attempt and run with extra care for NFs straighaway",
311311
"frollfun: processing fun MEAN algo fast took.*",
312312
"frollfunR: processing.*took.*"
313-
)) #7021
313+
))
314314
test(6000.0672, frollmean(c(1:2,NA,4:10), 4, has.nf=FALSE), c(rep(NA_real_, 6), 5.5, 6.5, 7.5, 8.5), output=c(
315315
"frollfunR: allocating memory for results 1x1",
316316
"frollfunR: .*sequentially.*single rolling computation.*",
@@ -319,7 +319,7 @@ test(6000.0672, frollmean(c(1:2,NA,4:10), 4, has.nf=FALSE), c(rep(NA_real_, 6),
319319
"frollmeanFast: non-finite values are present in input, skip non-finite unaware attempt and run with extra care for NFs straighaway",
320320
"frollfun: processing fun MEAN algo fast took.*",
321321
"frollfunR: processing.*took.*"
322-
), warning="has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning") #7021
322+
), warning="has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning")
323323
test(6000.0673, frollmean(c(1:2,NA,4:10), 2, has.nf=FALSE), c(NA, 1.5, NA, NA, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5), output=c(
324324
"frollfunR: allocating memory for results 1x1",
325325
"frollfunR: .*sequentially.*single rolling computation.*",
@@ -328,7 +328,7 @@ test(6000.0673, frollmean(c(1:2,NA,4:10), 2, has.nf=FALSE), c(NA, 1.5, NA, NA, 4
328328
"frollmeanFast: non-finite values are present in input, re-running with extra care for NFs",
329329
"frollfun: processing fun MEAN algo fast took.*",
330330
"frollfunR: processing.*took.*"
331-
), warning="has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning") #7021
331+
), warning="has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning")
332332
test(6000.0674, frollmean(c(1:2,NA,4:10), 4, align="center"), c(rep(NA_real_, 4), 5.5, 6.5, 7.5, 8.5, NA, NA), output=c(
333333
"frollfunR: allocating memory for results 1x1",
334334
"frollfunR: .*sequentially.*single rolling computation.*",
@@ -337,7 +337,7 @@ test(6000.0674, frollmean(c(1:2,NA,4:10), 4, align="center"), c(rep(NA_real_, 4)
337337
"frollfun: align 0, shift answer by -2",
338338
"frollfun: processing fun MEAN algo fast took.*",
339339
"frollfunR: processing.*took.*"
340-
)) #7021
340+
))
341341
options(datatable.verbose=FALSE)
342342

343343
#### fill constant
@@ -438,7 +438,7 @@ test(6000.1196, frollmean(c(1:5,NA), 1:6, algo="exact", na.rm=TRUE, adaptive=TRU
438438
"frolladaptivemeanExact: non-finite values are present in input, re-running with extra care for NFs",
439439
"frolladaptivefun: processing fun MEAN algo exact took.*",
440440
"frollfunR: processing.*took.*"
441-
)) #7021
441+
))
442442
#### exact na.rm=TRUE verbose=TRUE
443443
test(6000.1197, frollmean(c(1:5,NA), 2, algo="exact", na.rm=TRUE), output=c(
444444
"frollfunR: allocating memory for results 1x1",
@@ -676,7 +676,7 @@ test(6000.171, frollmean(x, n), output=c(
676676
"frollfunR: 1:",
677677
"frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
678678
"frollfun: processing fun MEAN algo fast took.*",
679-
"frollfunR: processing.*took.*")) #7021
679+
"frollfunR: processing.*took.*"))
680680
test(6000.172, frollmean(list(x, x+1), n), output=c(
681681
"frollfunR: allocating memory for results 2x1",
682682
"frollfunR: .*in parallel.*",
@@ -686,7 +686,7 @@ test(6000.172, frollmean(list(x, x+1), n), output=c(
686686
"frollfunR: 2:",
687687
"frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
688688
"frollfun: processing fun MEAN algo fast took.*",
689-
"frollfunR: processing.*took.*")) #7021
689+
"frollfunR: processing.*took.*"))
690690
test(6000.173, frollmean(x, c(n, n+1)), output=c(
691691
"frollfunR: allocating memory for results 1x2",
692692
"frollfunR: .*in parallel.*",
@@ -696,7 +696,7 @@ test(6000.173, frollmean(x, c(n, n+1)), output=c(
696696
"frollfunR: 2:",
697697
"frollmeanFast: running for input length 10, window 4, hasnf 0, narm 0",
698698
"frollfun: processing fun MEAN algo fast took.*",
699-
"frollfunR: processing.*took.*")) #7021
699+
"frollfunR: processing.*took.*"))
700700
test(6000.174, frollmean(list(x, x+1), c(n, n+1)), output=c(
701701
"frollfunR: allocating memory for results 2x2",
702702
"frollfunR: .*in parallel.*",
@@ -712,45 +712,45 @@ test(6000.174, frollmean(list(x, x+1), c(n, n+1)), output=c(
712712
"frollfunR: 4:",
713713
"frollmeanFast: running for input length 10, window 4, hasnf 0, narm 0",
714714
"frollfun: processing fun MEAN algo fast took.*",
715-
"frollfunR: processing.*took.*")) #7021
715+
"frollfunR: processing.*took.*"))
716716
test(6000.175, frollmean(x, n, algo="exact"), output=c(
717717
"frollfunR: allocating memory for results 1x1",
718718
"frollfunR: .*algo='exact' is already parallelised.*",
719719
"frollfunR: 1:",
720720
"frollmeanExact: running in parallel for input length 10, window 3, hasnf 0, narm 0",
721721
"frollfun: processing fun MEAN algo exact took.*",
722-
"frollfunR: processing.*took.*")) #7021
722+
"frollfunR: processing.*took.*"))
723723
test(6000.176, frollmean(x, n, align="center"), output=c(
724724
"frollfunR: allocating memory for results 1x1",
725725
"frollfunR: .*sequentially.*single rolling computation.*",
726726
"frollfunR: 1:",
727727
"frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
728728
"frollfun: align 0, shift answer by -1",
729729
"frollfun: processing fun MEAN algo fast took.*",
730-
"frollfunR: processing.*took.*")) #7021
730+
"frollfunR: processing.*took.*"))
731731
test(6000.177, frollmean(x, n, align="left"), output=c(
732732
"frollfunR: allocating memory for results 1x1",
733733
"frollfunR: .*sequentially.*single rolling computation.*",
734734
"frollfunR: 1:",
735735
"frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
736736
"frollfun: align -1, shift answer by -2",
737737
"frollfun: processing fun MEAN algo fast took.*",
738-
"frollfunR: processing.*took.*")) #7021
738+
"frollfunR: processing.*took.*"))
739739
nn = c(1:4,2:3,1:4)
740740
test(6000.178, frollmean(x, nn, adaptive=TRUE), output=c(
741741
"frollfunR: allocating memory for results 1x1",
742742
"frollfunR: .*sequentially because adaptive.*",
743743
"frollfunR: 1:",
744744
"frolladaptivemeanFast: running for input length 10, hasnf 0, narm 0",
745745
"frolladaptivefun: processing fun MEAN algo fast took.*",
746-
"frollfunR: processing.*took.*")) #7021
746+
"frollfunR: processing.*took.*"))
747747
test(6000.179, frollmean(x, nn, algo="exact", adaptive=TRUE), output=c(
748748
"frollfunR: allocating memory for results 1x1",
749749
"frollfunR: .*algo='exact' is already parallelised.*",
750750
"frollfunR: 1:",
751751
"frolladaptivemeanExact: running in parallel for input length 10, hasnf 0, narm 0",
752752
"frolladaptivefun: processing fun MEAN algo exact took.*",
753-
"frollfunR: processing.*took.*")) #7021
753+
"frollfunR: processing.*took.*"))
754754

755755
x[8] = NA
756756
test(6000.180, frollmean(x, n), output=c(
@@ -760,31 +760,31 @@ test(6000.180, frollmean(x, n), output=c(
760760
"frollmeanFast: running for input length 10, window 3, hasnf 0, narm 0",
761761
"frollmeanFast: non-finite values are present in input, re-running with extra care for NFs",
762762
"frollfun: processing fun MEAN algo fast took.*",
763-
"frollfunR: processing.*took.*")) #7021
763+
"frollfunR: processing.*took.*"))
764764
test(6000.181, frollmean(x, n, algo="exact"), output=c(
765765
"frollfunR: allocating memory for results 1x1",
766766
"frollfunR: .*algo='exact' is already parallelised.*",
767767
"frollfunR: 1:",
768768
"frollmeanExact: running in parallel for input length 10, window 3, hasnf 0, narm 0",
769769
"frollmeanExact: non-finite values are present in input, na.rm=FALSE and algo='exact' propagates NFs properply, no need to re-run",
770770
"frollfun: processing fun MEAN algo exact took.*",
771-
"frollfunR: processing.*took.*")) #7021
771+
"frollfunR: processing.*took.*"))
772772
test(6000.182, frollmean(x, nn, adaptive=TRUE), output=c(
773773
"frollfunR: allocating memory for results 1x1",
774774
"frollfunR: .*sequentially because adaptive.*",
775775
"frollfunR: 1:",
776776
"frolladaptivemeanFast: running for input length 10, hasnf 0, narm 0",
777777
"frolladaptivemeanFast: non-finite values are present in input, re-running with extra care for NFs",
778778
"frolladaptivefun: processing fun MEAN algo fast took.*",
779-
"frollfunR: processing.*took.*")) #7021
779+
"frollfunR: processing.*took.*"))
780780
test(6000.183, frollmean(x, nn, algo="exact", adaptive=TRUE), output=c(
781781
"frollfunR: allocating memory for results 1x1",
782782
"frollfunR: .*algo='exact' is already parallelised.*",
783783
"frollfunR: 1:",
784784
"frolladaptivemeanExact: running in parallel for input length 10, hasnf 0, narm 0",
785785
"frolladaptivemeanExact: non-finite values are present in input, na.rm=FALSE and algo='exact' propagates NFs properply, no need to re-run",
786786
"frolladaptivefun: processing fun MEAN algo exact took.*",
787-
"frollfunR: processing.*took.*")) #7021
787+
"frollfunR: processing.*took.*"))
788788

789789
d = as.data.table(list(1:10/2, 10:1/4))
790790
test(6000.184, frollmean(d[,1], 3, algo="exact"), output=c(
@@ -794,7 +794,7 @@ test(6000.184, frollmean(d[,1], 3, algo="exact"), output=c(
794794
"frollmeanExact: running in parallel for input length 10, window 3, hasnf 0, narm 0",
795795
"frollfun: processing fun MEAN algo exact took.*",
796796
"frollfunR: processing.*took.*"
797-
)) #7021
797+
))
798798
test(6000.185, frollmean(d, 3:4, algo="exact"), output=c(
799799
"frollfunR: allocating memory for results 2x2",
800800
"frollfunR: .*sequentially.*algo='exact'.*already parallelised.*",
@@ -811,7 +811,7 @@ test(6000.185, frollmean(d, 3:4, algo="exact"), output=c(
811811
"frollmeanExact: running in parallel for input length 10, window 4, hasnf 0, narm 0",
812812
"frollfun: processing fun MEAN algo exact took.*",
813813
"frollfunR: processing.*took.*"
814-
)) #7021
814+
))
815815
options(datatable.verbose=FALSE)
816816

817817
## test warnings
@@ -861,9 +861,9 @@ options(datatable.verbose=FALSE)
861861

862862
## frollmax adaptive
863863
options(datatable.verbose=TRUE) ## adaptive frollmax no fast algo
864-
test(6000.3, frollmax(1:4, c(2,2,2,2), adaptive=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
865-
test(6000.3001, frollmax(1:4, c(2,2,2,2), algo="fast", adaptive=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
866-
test(6000.3002, frollmax(1:4, c(2,2,2,2), algo="exact", adaptive=TRUE), notOutput="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
864+
test(6000.3, frollmax(1:4, c(2,2,2,2), adaptive=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact")
865+
test(6000.3001, frollmax(1:4, c(2,2,2,2), algo="fast", adaptive=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact")
866+
test(6000.3002, frollmax(1:4, c(2,2,2,2), algo="exact", adaptive=TRUE), notOutput="frolladaptivefun: algo fast not implemented, fall back to exact")
867867
options(datatable.verbose=FALSE)
868868
n = c(3,2,2,4,2,1,4,8)
869869
x = c(7,2,3,6,3,2,6,6) # no NA
@@ -1022,9 +1022,9 @@ test(6000.564, frollapply(FUN=mean, 1:3, list(c(0,-1,1)), adaptive=TRUE), error=
10221022

10231023
## frollmin adaptive
10241024
options(datatable.verbose=TRUE) ## adaptive frollmin no fast algo
1025-
test(6000.6, frollmin(1:4, c(2,2,2,2), adaptive=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
1026-
test(6000.6001, frollmin(1:4, c(2,2,2,2), algo="fast", adaptive=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
1027-
test(6000.6002, frollmin(1:4, c(2,2,2,2), algo="exact", adaptive=TRUE), notOutput="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
1025+
test(6000.6, frollmin(1:4, c(2,2,2,2), adaptive=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact")
1026+
test(6000.6001, frollmin(1:4, c(2,2,2,2), algo="fast", adaptive=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact")
1027+
test(6000.6002, frollmin(1:4, c(2,2,2,2), algo="exact", adaptive=TRUE), notOutput="frolladaptivefun: algo fast not implemented, fall back to exact")
10281028
options(datatable.verbose=FALSE)
10291029
n = c(3,2,2,4,2,1,4,8)
10301030
x = c(7,2,3,6,3,2,6,6) # no NA
@@ -1200,7 +1200,7 @@ test(6000.931, frollprod(1:3, 2), c(NA, 2, 6), output="frollprodFast: running fo
12001200
test(6000.932, frollprod(1:3, 2, align="left"), c(2, 6, NA), output="frollfun: align")
12011201
test(6000.933, frollprod(c(1,2,NA), 2), c(NA, 2, NA), output="non-finite values are present in input, re-running with extra care for NFs")
12021202
test(6000.934, frollprod(c(NA,2,3), 2), c(NA, NA, 6), output="non-finite values are present in input, skip non-finite inaware attempt and run with extra care for NFs straighaway")
1203-
test(6000.935, frollprod(1:3, c(2,2,2), adaptive=TRUE), c(NA, 2, 6), output="algo fast not implemented, fall back to exact") #7021
1203+
test(6000.935, frollprod(1:3, c(2,2,2), adaptive=TRUE), c(NA, 2, 6), output="algo fast not implemented, fall back to exact")
12041204
test(6000.936, frollprod(c(NA,2,3), c(2,2,2), adaptive=TRUE), c(NA, NA, 6), output="non-finite values are present in input, na.rm=FALSE and algo='exact' propagates NFs properply, no need to re-run")
12051205
options(datatable.verbose=FALSE)
12061206
# floating point overflow
@@ -1433,7 +1433,7 @@ test(6001.715, frollvar(1:3, 0, algo="exact"), c(NA_real_,NA_real_,NA_real_), op
14331433
test(6001.716, frollvar(c(1:2,NA), 0, algo="exact"), c(NA_real_,NA_real_,NA_real_))
14341434
test(6001.717, frollvar(c(1:2,NA), 0, algo="exact", na.rm=TRUE), c(NA_real_,NA_real_,NA_real_))
14351435
test(6001.718, frollvar(c(1:2,NA), 2), c(NA,0.5,NA), options=c("datatable.verbose"=TRUE), output="redirecting to frollvarExact")
1436-
test(6001.721, frollvar(adaptive=TRUE, 1:3, c(2,0,2)), c(NA,NA,0.5), options=c("datatable.verbose"=TRUE), output="algo fast not implemented, fall back to exact") #7021
1436+
test(6001.721, frollvar(adaptive=TRUE, 1:3, c(2,0,2)), c(NA,NA,0.5), options=c("datatable.verbose"=TRUE), output="algo fast not implemented, fall back to exact")
14371437
test(6001.722, frollvar(adaptive=TRUE, 1:3, c(2,0,2), fill=99), c(99,NA,0.5))
14381438
test(6001.723, frollvar(adaptive=TRUE, c(1:2,NA), c(2,0,2)), c(NA_real_,NA_real_,NA_real_))
14391439
test(6001.724, frollvar(adaptive=TRUE, c(1:2,NA), c(2,0,2), na.rm=TRUE), c(NA_real_,NA_real_,NA_real_))
@@ -1492,7 +1492,7 @@ test(6001.8194, frollsd(c(NA,2:3), 2, has.nf=FALSE), c(NA,NA,sqrt(0.5)), warning
14921492
test(6001.8195, frollsd(c(NA,2:3), 2), c(NA,NA,sqrt(0.5)), options=c("datatable.verbose"=TRUE), output="skip non-finite inaware attempt and run with extra care")
14931493
test(6001.8196, frollsd(c(NA,2:3), 2, has.nf=FALSE, algo="exact"), c(NA,NA,sqrt(0.5)), warning="used but non-finite values are present in input")
14941494
test(6001.8197, frollsd(c(NA,2:3), 2, algo="exact", na.rm=TRUE), c(NA,NA,sqrt(0.5)), options=c("datatable.verbose"=TRUE), output="re-running with extra care for NF")
1495-
test(6001.8201, frollsd(adaptive=TRUE, 1:3, c(2,2,2)), c(NA,sqrt(0.5),sqrt(0.5)), options=c("datatable.verbose"=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact") #7021
1495+
test(6001.8201, frollsd(adaptive=TRUE, 1:3, c(2,2,2)), c(NA,sqrt(0.5),sqrt(0.5)), options=c("datatable.verbose"=TRUE), output="frolladaptivefun: algo fast not implemented, fall back to exact")
14961496
test(6001.8202, frollsd(adaptive=TRUE, 1:3, c(2,2,2)), c(NA,sqrt(0.5),sqrt(0.5)), options=c("datatable.verbose"=TRUE), output="frolladaptivesdExact: calling sqrt(frolladaptivevarExact(...))")
14971497
test(6001.821, frollsd(adaptive=TRUE, 1:3, c(2,0,2)), c(NA,NA,sqrt(0.5)))
14981498
test(6001.822, frollsd(adaptive=TRUE, 1:3, c(2,0,2), fill=99), c(99,NA,sqrt(0.5)))

0 commit comments

Comments
 (0)