BatchtoolsParam handles reduce.in.order differently from others
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 65/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- r
- Lĩnh vực
- distributed-systems
Hướng nghiên cứu
Start at R/BatchtoolsParam-class.R around line 465 and trace the bpiterate handling for BatchtoolsParam when reduce.in.order=TRUE. Reproduce the supplied BatchtoolsParam example, compare it with SerialParam, MulticoreParam, and SnowParam, and verify that the same call works without REDUCE or INIT.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Most BPPARAM objects handle the reduce.in.order argument of bpiterate without requiring REDUCE and INIT arguments. However, BatchtoolsParam objects cannot handle this case, which means that some uses of bpiterate can work with some valid BPPARAM arguments but fail with others. This is highly unintuitive. Reprex below:
library(BiocParallel)
library(assertthat)
library(batchtools)
expected_result <- lapply(1:10, sqrt)
assert_that(identical(expected_result, bpiterate(bpiterateAlong(1:10), sqrt, reduce.in.order=TRUE, BPPARAM = SerialParam())))
#> [1] TRUE
assert_that(identical(expected_result, bpiterate(bpiterateAlong(1:10), sqrt, reduce.in.order=TRUE, BPPARAM = MulticoreParam(2))))
#> [1] TRUE
assert_that(identical(expected_result, bpiterate(bpiterateAlong(1:10), sqrt, reduce.in.order=TRUE, BPPARAM = SnowParam(2))))
#> [1] TRUE
## This one fails
assert_that(identical(expected_result, bpiterate(bpiterateAlong(1:10), sqrt, reduce.in.order=TRUE, BPPARAM = BatchtoolsParam(2, cluster = "multicore"))))
#> Error in `.local()`:
#> ! REDUCE must be provided when 'reduce.in.order = TRUE'
## Needs additional arguments to work, although these specific
## arguments may not work in every case
assert_that(identical(expected_result, bpiterate(bpiterateAlong(1:10), sqrt, reduce.in.order=TRUE, BPPARAM = BatchtoolsParam(2, cluster = "multicore"), init = list(), REDUCE = c))) #
#> Submitting 10 jobs in 2 chunks using cluster functions 'Multicore' ...
#> [1] TRUE
Created on 2026-05-28 with reprex v2.1.1
BatchtoolsParam seems to be the odd one out here. Is it possible to bring BatchtoolsParam in line with the other param classes here?
Session info:
> sessionInfo()
R version 4.5.3 (2026-03-11)
Platform: aarch64-apple-darwin24.6.0
Running under: macOS Sequoia 15.7.4
Matrix products: default
BLAS: /opt/homebrew/Cellar/openblas/0.3.32/lib/libopenblasp-r0.3.32.dylib
LAPACK: /opt/homebrew/Cellar/r/4.5.3/lib/R/lib/libRlapack.dylib; LAPACK version 3.12.1
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: America/New_York
tzcode source: internal
attached base packages:
[1] graphics grDevices utils datasets stats methods base
other attached packages:
[1] batchtools_0.9.18 assertthat_0.2.1 BiocParallel_1.44.0 tidyr_1.3.2 future_1.68.0 devtools_2.4.6 usethis_3.2.1 openxlsx_4.2.8.1 magrittr_2.0.5 dplyr_1.2.1 rex_1.2.1 glue_1.8.1 stringr_1.6.0 ggplot2_4.0.1 colorout_1.3-2
loaded via a namespace (and not attached):
[1] gtable_0.3.6 xfun_0.57 remotes_2.5.0 processx_3.8.6 callr_3.7.6 vctrs_0.7.3 tools_4.5.3 pak_0.9.1 ps_1.9.1 generics_0.1.4 base64url_1.4 parallel_4.5.3 tibble_3.3.1 pkgconfig_2.0.3 data.table_1.18.4 checkmate_2.3.4
[17] RColorBrewer_1.1-3 S7_0.2.2 lifecycle_1.0.5 compiler_4.5.3 farver_2.1.2 progress_1.2.3 codetools_0.2-20 htmltools_0.5.9 snow_0.4-4 yaml_2.3.12 pillar_1.11.1 crayon_1.5.3 ellipsis_0.3.2 cachem_1.1.0 sessioninfo_1.2.3 parallelly_1.45.1
[33] brew_1.0-10 tidyselect_1.2.1 zip_2.3.3 digest_0.6.39 stringi_1.8.7 purrr_1.2.2 listenv_0.10.0 fastmap_1.2.0 grid_4.5.3 cli_3.6.6 dichromat_2.0-0.1 pkgbuild_1.4.8 clipr_0.8.0 withr_3.0.2 prettyunits_1.2.0 scales_1.4.0
[49] backports_1.5.1 rappdirs_0.3.4 rmarkdown_2.31 globals_0.18.0 otel_0.2.0 hms_1.1.4 evaluate_1.0.5 memoise_2.0.1 knitr_1.51 rlang_1.2.0 Rcpp_1.1.1-1.1 reprex_2.1.1 pkgload_1.4.1 rstudioapi_0.17.1 R6_2.6.1 fs_2.1.0
As you can see, I'm not running this test on the latest R/Bioconductor versions, but looking in the code I see that the error message is still there: https://github.com/Bioconductor/BiocParallel/blob/devel/R/BatchtoolsParam-class.R#L465
- Ngôn ngữ chính
- R
- Star
- 69
- Fork
- 32
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Bioconductor/BiocParallel
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 50/100
Bioconductor/BiocParallel#285 ·
-
Bioconductor/BiocParallel#284 · 2 bình luận · 1 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Bioconductor/BiocParallel#283 · 2 bình luận ·
-
DoparParam: Captured stdout is relayed to stdout for some foreach adapters and stderr for others Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Bioconductor/BiocParallel#277 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Bioconductor/BiocParallel#276 ·
Tất cả issue của Bioconductor/BiocParallel
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
easystats/performance#950 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
briandconnelly/airnow#9 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Copy cohorts to keep old cohorts Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
OHDSI/CohortConstructor#774 ·