Newly defined S3 generics and methods not passed using plan(multisession)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- r
调研方向
未指定源文件或测试。首先使用 plan(multisession) 和 foreach %dopar% 运行所提供的 R 重现,然后跟踪涉及的 future 后端路径;完成的标准是示例在 multisession 下的两次迭代中都返回 4,就像顺序执行和使用 multicore 时一样。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
A clear and concise description of what the bug is.
Newly defined S3 generics and methods do not work with plan(multisession).
Reproduce example
A reproducible example using R code.
library(doFuture)
registerDoFuture()
plan(multisession)
new_s3_obj <- list(value = 2)
class(new_s3_obj) <- "new_s3"
new_method <- function(x) {
UseMethod("new_method", x)
}
new_method.new_s3 <- function(obj) {
obj$value^2
}
foreach(i = 1:2) %dopar% {
new_method(new_s3_obj)
}
Expected behavior
A clear and concise description of what you expected to happen.
Changing the %dopar% to %do% (sequential), or using plan(multicore) results in the below as expected:
[[1]]
[1] 4
[[2]]
[1] 4
Session information
Please share your session information after the error has occurred so that we also see which packages and versions are involved, e.g.
> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Big Sur 11.4
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] doFuture_0.12.0 future_1.21.0 foreach_1.5.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 pillar_1.6.1 compiler_4.1.0 iterators_1.0.13 tools_4.1.0
[6] digest_0.6.27 tsibble_1.0.1 lubridate_1.7.10 lifecycle_1.0.0 tibble_3.1.2
[11] gtable_0.3.0 anytime_0.3.9 pkgconfig_2.0.3 rlang_0.4.11 DBI_1.1.1
[16] cli_3.0.0 rstudioapi_0.13 parallel_4.1.0 dplyr_1.0.7 globals_0.14.0
[21] generics_0.1.0 vctrs_0.3.8 grid_4.1.0 tidyselect_1.1.1 glue_1.4.2
[26] listenv_0.8.0 R6_2.5.0 parallelly_1.26.1 fansi_0.5.0 distributional_0.2.2
[31] ggplot2_3.3.5 purrr_0.3.4 farver_2.1.0 tidyr_1.1.3 magrittr_2.0.1
[36] scales_1.1.1 codetools_0.2-18 ellipsis_0.3.2 fabletools_0.3.1 assertthat_0.2.1
[41] colorspace_2.0-2 utf8_1.2.1 munsell_0.5.0 crayon_1.4.1
- 主要语言
- R
- 星标
- 1k
- 派生
- 93
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
futureverse/future 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
futureverse/future#852 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 35/100
futureverse/future#849 ·
-
bug
难度 4/5 3-5 天 新手友好度 48/100
futureverse/future#833 ·
-
feature/resources RNG
难度 5/5 一周以上 新手友好度 35/100
futureverse/future#832 ·
-
RNG
难度 5/5 一周以上 新手友好度 38/100
futureverse/future#831 · 1 条评论 ·
查看 futureverse/future 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 88/100
nf-core/provenancereport#75 ·
-
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 1/5 1 小时以内 新手友好度 72/100
garner-code/PsyR#80 ·