WISH: Add support for p(condition = <error>|<interrupt>)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
The payload names no source files. Start from the two examples: the tryCatch version and the version where progressr reports the error, and check how a progressor call currently handles a condition. The proposed change is that calling p(condition = e) from an error handler leaves the progress bar open with the message. The maintainer has not chosen a design yet, so agree on the API with them before writing code. Done means the first example keeps the bar visible after the caught error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
(This came out of Discussion #196)
When there are errors, we can either handle them manually, e.g.
with_progress({
p <- progressor(10)
tryCatch({
for (kk in seq_along(p)) {
Sys.sleep(0.1)
if (kk == 3) stop("boom")
p()
}
}, error = function(e) {
message("Caught an error")
})
})
#> Caught an error
or let progressr take care of it for us, e.g.
with_progress({
p <- progressor(10)
for (kk in seq_along(p)) {
Sys.sleep(0.1)
if (kk == 3) stop("boom")
p()
}
})
#> ■■■■■■■ 20% | ETA: 1s
#> Progress interrupted by simpleError condition: boom
#> Error in withVisible(expr) : boom
What's missing, is that in the first case, we have no way to tell the progressr framework that we detected an error and we wish to the progress reporter to not close the progress bar, i.e. we want to leave something like:
#> ■■■■■■■ 20% | ETA: 1s
#> Caught an error
Idea
One idea could be to add support for signalling condition as in:
p <- progressor(10)
tryCatch({
for (kk in seq_along(p)) {
if (kk == 3) stop("boom")
p()
}
}, error = function(e) {
p(condition = e) # tell the progressor about the error we just caught
message("Caught an error")
})
- Ngôn ngữ chính
- R
- Star
- 299
- Fork
- 11
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 futureverse/progressr
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
futureverse/progressr#197 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
futureverse/progressr#195 ·
-
question
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
futureverse/progressr#155 · 5 bình luận ·
-
Custom progress handler enhancement help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 22/100
futureverse/progressr#143 · 6 bình luận · 1 reaction ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
futureverse/progressr#142 · 3 bình luận ·
Tất cả issue của futureverse/progressr
Issue tương tự
-
gdsa opencode: keep-alive cleanup trap fails with 'keepalive_pid: unbound variable'Có thể đã có người làm @darribas đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
sportsdataverse/sportyR#76 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
check_models ncv explanationĐang mởConsistency :green_apple: :apple: Docs :books:
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
easystats/performance#987 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
HelenaLC/spatialdataR#284 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 71/100