Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

WISH: Add support for p(condition = <error>|<interrupt>)

オープン
#199 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
r
領域
api

調査の方向性

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 の本文から書いたものです。

説明

feature request

(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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

futureverse/progressr のほかの issue

futureverse/progressr の issue をすべて見る

似ている issue

R の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。