window transform: difference, ratio, first and last drop the trailing outputs of each series
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, node.js
調査の方向性
src/transforms/window.js を読み、reduceDifference、reduceRatio、reduceFirst、reduceLast を調べて、strict モードと non-strict モードでのループ境界を例に記載された動作と比較してください。両モードの末尾の出力に対するテストを追加または更新し、関連する window transform のテストを実行してください。strict が false の場合の末尾の切り詰められたウィンドウも含め、これらの reducer が期待される全長の出力を生成すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The difference, ratio, first and last window reducers stop their loops early: with strict: true the last full window is missing, and with strict: false the last k - 1 - s truncated windows are missing. Other reducers such as mean fill these positions.
import * as Plot from "@observablehq/plot";
const run = (w, data) => {
const o = Plot.windowY(w, {x: "i", y: "v"});
o.transform(data, [Uint32Array.from(data, (_, i) => i)]);
return Array.from(o.y.transform());
};
const d = [2, 4, 8, 16].map((v, i) => ({i, v}));
console.log(run({k: 2, reduce: "difference", strict: true, anchor: "end"}, d));
console.log(run({k: 2, reduce: "ratio", strict: true, anchor: "end"}, d));
console.log(run({k: 1, reduce: "last", strict: true}, d));
console.log(run({k: 3, reduce: "first", anchor: "start"}, d));
console.log(run({k: 3, reduce: "difference", anchor: "start"}, d));
console.log(run({k: 3, reduce: "mean", anchor: "start"}, d));
node t.mjs
Actual:
[ undefined, 2, 4, undefined ]
[ undefined, 2, 2, undefined ]
[ 2, 4, 8, undefined ]
[ 2, 4, undefined, undefined ]
[ 6, 12, undefined, undefined ]
[ 4.666666666666667, 9.333333333333334, 12, 16 ]
Expected:
[ undefined, 2, 4, 8 ]
[ undefined, 2, 2, 2 ]
[ 2, 4, 8, 16 ]
[ 2, 4, 8, 16 ]
[ 6, 12, 8, 0 ]
[ 4.666666666666667, 9.333333333333334, 12, 16 ]
In a chart, Plot.lineY(data, Plot.windowY({k: 7, reduce: "difference"}, ...)) stops short of the right edge.
Tested with @observablehq/plot 0.6.19 and main 2245188, Node.js v26.13.0.
In src/transforms/window.js, reduceDifference, reduceRatio, reduceFirst and reduceLast use n = I.length - k in the strict branch (should be I.length - k + 1) and n = I.length - k + s + 1 in the non-strict branch (should be I.length - s, with the window clipped to I.length).
Credit: https://ucsbplse.github.io/
- 主要言語
- HTML
- スター
- 5.4k
- フォーク
- 251
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
observablehq/plot のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
observablehq/plot#2471 ·
-
[Types] Wrong recursion in Mark’s _tip_ option再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
observablehq/plot#2459 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
observablehq/plot#2453 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
observablehq/plot#2447 · コメント 2 件 ·
-
Channel documentation with a section describing z再び着手できるかも @LeonxLJX が 67 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
observablehq/plot#1533 · コメント 3 件 · リアクション 1 件 ·
observablehq/plot の issue をすべて見る
似ている issue
-
partial() returns wrong values (silently) when train is a matrix and pred.var has two variablesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
bgreenwell/pdp#140 · コメント 1 件 · リアクション 1 件 ·
-
bin: stop can round 1 ulp below extent[1], so the maximum value is binned as +Infinity and droppedオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
Numeric tick formatter gives repeated labels in scientific notation and with bounds: 'data'対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug data order-flow studies
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
userFRM/egui-charts#2530 ·
メンテナーはふだん 1 日以内に返信
-
Analysis Functions bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
AllenInstitute/MIES#2856 ·
メンテナーはふだん 1 日以内に返信