`future` unable to export libraries of list encapsulated functions
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- r
- Ambito
- distributed-systems
Direzione di ricerca
Esegui il riproduttore R fornito con plan(multisession, workers = 2), concentrandoti su future::future(wrapper(1)) e sulla funzione contenuta nella lista. Traccia il modo in cui future rileva i globals e i pacchetti per questa chiamata annidata; il lavoro è completato quando l'esempio risolve lubridate's days() senza l'errore di funzione mancante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
If a function is wrapped in a list then future seems to be unable to detect the libraries used by that function:
library(lubridate)
library(future)
my_a_fun <- function(x) {
zz <- days(3)
x
}
callme <- function(fun) {
obj <- list(funny = fun)
wrapper <- function(x) {
obj$funny(x)
}
future::future(wrapper(1))
}
plan(multisession, workers = 2)
value(callme(my_a_fun))
Error in days(3) : could not find function "days"
Expected behavior
That it would be able to recognise that the lubridate library is required
Session information
Please share your session information after the error has occurred so that we also see which packages and versions are involved;
> sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: x86_64-apple-darwin23.4.0
Running under: macOS Sonoma 14.6.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /usr/local/Cellar/r/4.4.1/lib/R/lib/libRlapack.dylib; LAPACK version 3.12.0
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: Europe/London
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lubridate_1.9.3 future_1.34.0
loaded via a namespace (and not attached):
[1] compiler_4.4.1 parallelly_1.38.0 generics_0.1.3 parallel_4.4.1 tools_4.4.1 rstudioapi_0.16.0 listenv_0.9.1 codetools_0.2-20
[9] digest_0.6.37 globals_0.16.3 timechange_0.3.0
> future::futureSessionInfo()
*** Package versions
future 1.34.0, parallelly 1.38.0, parallel 4.4.1, globals 0.16.3, listenv 0.9.1
*** Allocations
availableCores():
system
12
availableWorkers():
$system
[1] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
*** Settings
- future.plan=<not set>
- future.fork.multithreading.enable=<not set>
- future.globals.maxSize=<not set>
- future.globals.onReference=<not set>
- future.resolve.recursive=<not set>
- future.rng.onMisuse=<not set>
- future.wait.timeout=<not set>
- future.wait.interval=<not set>
- future.wait.alpha=<not set>
- future.startup.script=<not set>
*** Backends
Number of workers: 2
List of future strategies:
1. multisession:
- args: function (..., workers = 2, envir = parent.frame())
- tweaked: TRUE
- call: plan(multisession, workers = 2)
*** Basic tests
Main R session details:
pid r sysname release version nodename machine
1 65511 4.4.1 Darwin 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64 host001 x86_64
login user effective_user
1 user001 user001 user001
Worker R session details:
worker pid r sysname release version nodename
1 1 65631 4.4.1 Darwin 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64 host001
2 2 65632 4.4.1 Darwin 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64 host001
machine login user effective_user
1 x86_64 user001 user001 user001
2 x86_64 user001 user001 user001
Number of unique worker PIDs: 2 (as expected)
- Lingua principale
- R
- Stelle
- 1k
- Fork
- 93
- Merge medio
- 2g 4h
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di futureverse/future
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
futureverse/future#852 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 35/100
futureverse/future#849 ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
futureverse/future#833 ·
-
feature/resources RNG
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
futureverse/future#832 ·
-
RNG
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
futureverse/future#831 · 1 commento ·
Tutte le issue di futureverse/future
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
nf-core/provenancereport#75 ·
-
Typo in Exercise 5.22?Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
garner-code/PsyR#80 ·