futureverse / futureverse/BiocParallel.FutureParam

bplapply() et al. returns RngFutureError:s rather than signals them

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Makefile
Stars
7
Forks
4
PR merge metrics
No merged PRs in 30d

Description

```r
library(BiocParallel.FutureParam)
register(FutureParam())
options(future.rng.onMisuse = "error")
y <- bplapply(1:2, rnorm)
```

```r
> str(y)
List of 2
$ :List of 2
..$ message: chr "UNRELIABLE VALUE: Future ('') unexpectedly generated random numbers without specifying argument 'seed'. T"| __truncated__
..$ call : NULL
..- attr(*, "class")= chr [1:6] "RngFutureError" "FutureError" "error" "RngFutureCondition" ...
..- attr(*, "future")=Classes 'SequentialFuture', 'UniprocessFuture', 'Future', 'environment'
$ :List of 2
..$ message: chr "UNRELIABLE VALUE: Future ('') unexpectedly generated random numbers without specifying argument 'seed'. T"| __truncated__
..$ call : NULL
..- attr(*, "class")= chr [1:6] "RngFutureError" "FutureError" "error" "RngFutureCondition" ...
..- attr(*, "future")=Classes 'SequentialFuture', 'UniprocessFuture', 'Future', 'environment'
```

The expected behavior should be:

```r
y <- bplapply(1:2, rnorm)
Error: UNRELIABLE VALUE: Future ('') unexpectedly generated random numbers without specifying argument 'seed'. There is a risk that those random numbers are not statistically sound and the overall results might be invalid. To fix this, specify 'seed=TRUE'. This ensures that proper, parallel-safe random numbers are produced via the L'Ecuyer-CMRG method. To disable this check, use 'seed=NULL', or set option 'future.rng.onMisuse' to "ignore".
```

Similarly, with RngFutureWarning:s, we would expect:

```r
library(BiocParallel.FutureParam)
register(FutureParam())
options(future.rng.onMisuse = "warning") # default
y <- bplapply(1:2, rnorm)
Warning: UNRELIABLE VALUE: Future ('') unexpectedly generated random numbers without specifying argument 'seed'. There is a risk that those random numbers are not statistically sound and the overall results might be invalid. To fix this, specify 'seed=TRUE'. This ensures that proper, parallel-safe random numbers are produced via the L'Ecuyer-CMRG method. To disable this check, use 'seed=NULL', or set option 'future.rng.onMisuse' to "ignore".
```

but right now those warnings are muffled and never signaled.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.