Skip to content
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

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

Open
HenrikBengtsson opened this issue Dec 16, 2020 · 0 comments
Labels
Milestone

Comments

@HenrikBengtsson
Copy link
Collaborator

HenrikBengtsson commented Dec 16, 2020

library(BiocParallel.FutureParam)
register(FutureParam())
options(future.rng.onMisuse = "error")
y <- bplapply(1:2, rnorm)
> str(y)
List of 2
 $ :List of 2
  ..$ message: chr "UNRELIABLE VALUE: Future ('<none>') 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' <environment: 0x56148257c1b0> 
 $ :List of 2
  ..$ message: chr "UNRELIABLE VALUE: Future ('<none>') 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' <environment: 0x56148279f320> 

The expected behavior should be:

y <- bplapply(1:2, rnorm)
Error: UNRELIABLE VALUE: Future ('<none>') 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:

library(BiocParallel.FutureParam)
register(FutureParam())
options(future.rng.onMisuse = "warning")  # default
y <- bplapply(1:2, rnorm)
Warning: UNRELIABLE VALUE: Future ('<none>') 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.

@HenrikBengtsson HenrikBengtsson added this to the Next release milestone Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant