WISH: Add support for p(condition = <error>|<interrupt>)
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
(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")
})
- 主要言語
- R
- スター
- 299
- フォーク
- 11
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
futureverse/progressr のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
futureverse/progressr#197 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
futureverse/progressr#195 ·
-
question
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
futureverse/progressr#155 · コメント 5 件 ·
-
Custom progress handler enhancement help wanted
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
futureverse/progressr#143 · コメント 6 件 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
futureverse/progressr#142 · コメント 3 件 ·
futureverse/progressr の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
HelenaLC/spatialdataR#284 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 71/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Hackathon: Tier 1
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
pharmaverse/logrx#309 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信