Skip to content

Medium: 7 error messages lack actual vs expected values #108

Description

@shinaoka

AGENTS.md で「Include actual versus expected values in the message」と定められていますが、7 箇所で具体的な値を含まないエラーメッセージが使われています。

違反箇所

SimpleTT.jl (6 箇所) — 全て error() を使っているが ArgumentError/DimensionMismatch が適切

Line 現在のメッセージ 問題
40 error("length(idx_a) != length(idx_b)") DimensionMismatch にすべき、実際の長さを含める
41 error("idx_a contains duplicate elements") 重複要素を表示すべき
42 error("idx_b contains duplicate elements") 同上
43 error("idx_a contains elements out of range") 範囲外の要素と有効範囲を表示すべき
44 error("idx_b contains elements out of range") 同上
83 error("Tensor trains must share the identical index at n=$(n)!") 実際の不一致次元を含める

treetn.jl (1 箇所)

Line 現在のメッセージ 問題
366 error("norm(a - b) is not finite") norm(a-b) の実際の値を含める

修正方針

  • SimpleTT.jl のバリデーションエラーを適切な例外型 (ArgumentError, DimensionMismatch) に変更
  • すべてのメッセージに実際の値と期待値を追加

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions