Match attribute groups by whole name, not by word, when looking up valid terms
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with .validAttributes() in R/physiologies.R and the multistate Attribute_value check in tests/testthat/test-importBugphyzz.R; then review inst/scripts/stop_on_unmapped.R and taxPPro's filterDataDiscrete() so the checks and export filter agree. Check whether any shape rows in the sheets or sources use endospore, branched, or cell chain. Done when group matching uses exact names across all four locations, tests confirm shape and halophily exclude unrelated terms, and the export still handles current source rows.
索引モデルが issue の本文から書いたものです。
説明
The valid terms for a physiology are looked up in inst/extdata/attributes.tsv by searching for the physiology name as a whole word in attribute_group (\b<name>\b). A physiology whose name is a whole word inside another group name therefore also gets that group's terms.
Two cases exist now:
shapealso accepts three terms that belong only tospore shape:endospore,branched,cell chain.halophilyalso accepts the terms ofhalophily class(halophilic,halotolerant,non-halophilic), added in #298.
Neither does harm today. halophily is a range attribute, so it is never checked against the vocabulary, and no shape source uses those three terms. The risk is a later discrete physiology whose wrong values pass the vocabulary check unnoticed.
Proposed fix
Match the whole group name: split attribute_group on ; and test for equality, in place of the regex.
Where the match is made
- bugphyzz,
.validAttributes()inR/physiologies.R. - bugphyzz,
tests/testthat/test-importBugphyzz.R, theAttribute_valuecheck for multistate attributes (grepl(unique(x$Attribute), attribute_group), with no word boundary at all). - bugphyzzExports,
stop_on_unmapped()ininst/scripts/stop_on_unmapped.R. - taxPPro,
filterDataDiscrete(), which decides the rows the export keeps.
The four should change together, so that the check in bugphyzz and the filter in the export keep agreeing. A test that .validAttributes("halophily") excludes the class terms and that .validAttributes("shape") excludes endospore would pin it.
Check before changing
With an exact match, shape loses the three terms above. Confirm that no shape row in the sheets or sources uses them, otherwise the export would stop on unmapped values. On the current attributes.tsv these two physiologies are the only ones whose valid terms change.
Raised in the review of #298.
Written with Claude Code.
- 主要言語
- R
- スター
- 6
- フォーク
- 6
- 平均マージ
- 3時間 17分
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
waldronlab/bugphyzz のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
waldronlab/bugphyzz#301 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
waldronlab/bugphyzz#281 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 77/100
waldronlab/bugphyzz#300 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
waldronlab/bugphyzz#296 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
waldronlab/bugphyzz#295 ·
メンテナーはふだん 1 日以内に返信
waldronlab/bugphyzz の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
r-lib/tree-sitter-r#209 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 67/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 79/100
cran-task-views/CausalInference#52 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
paul-buerkner/brms#1971 ·
メンテナーはふだん 4 日以内に返信