The first code example in the README does not work
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- r
調査の方向性
まず、リポジトリのREADMEにある導入例と、future.futureverse.org上の対応するページを見つけます。例で slow_fcn と X がどのように使われているかを確認し、逐次実行と並列実行の比較を維持したまま、最初のスニペットを実行可能にします。future、futurize、purrr、foreach の各セクションを含め、表示されている例全体をクリーンな R セッションで検証します。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
The future package's README in the GitHub repository and on https://future.futureverse.org/ contains an introductory code example that does not work.
The example does not work and results in an error because it calls a function named slow_fcn and a variable named X that do not exist.
I am new to the future package and am trying to learn about the it without any prior knowledge. I would like to share my perspective and experience that the first example presented not working is a hurdle to trying to learn about the package, as it prevents me from trying out the example and learning about what it is trying to demonstrate. I initially wondered if I had all of the required packages and package versions installed or if there was something implicit not included in the code example that I was supposed to know to set up first.
Here is the first code snippet on the README:
library(future)
plan(multisession)
## Sequential evaluation of an R expression
y <- slow_fcn(X[1])
## Parallel evaluation of an R expression
f <- future(slow_fcn(X[1]))
y <- value(f)
library(futurize)
## Sequential and parallel base R apply
y <- lapply(X, slow_fcn)
y <- lapply(X, slow_fcn) |> futurize()
## Sequential and parallel purrr map
library(purrr)
y <- X |> map(slow_fcn)
y <- X |> map(slow_fcn) |> futurize()
## Sequential and parallel foreach calls
library(foreach)
y <- foreach(x = X) %do% slow_fcn(x)
y <- foreach(x = X) %do% slow_fcn(x) |> futurize()
And here is the resulting error when it is run:
Expected behavior
I think the first code example presented to newcomers would serve as a better introduction and learning resource if the code worked and demonstrated/explained the usage of the future package compared to the sequential equivalents that it includes.
- 主要言語
- R
- スター
- 1k
- フォーク
- 92
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
futureverse/future のほかの issue
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
futureverse/future#837 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
futureverse/future#836 · コメント 2 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
futureverse/future#833 ·
-
feature/resources RNG
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
futureverse/future#832 ·
-
RNG
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
futureverse/future#831 · コメント 1 件 ·
futureverse/future の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 3 日以内に返信
-
Elevation orderオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
inbo/erl-butterflies-2025#19 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
The-Strategy-Unit/nhp_output_reports#116 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信