futureverse / futureverse/BiocParallel.FutureParam

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

Aperta
#5 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Makefile
Stelle
7
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

```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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo l'esempio con bplapply(), FutureParam() e future.rng.onMisuse impostato su "error" o "warning". Traccia il modo in cui vengono gestiti RngFutureError e RngFutureWarning, quindi verifica che gli errori vengano segnalati, gli avvisi emessi e i messaggi attesi esistenti preservati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
r
Ambito
distributed-systems
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.