mirror of
https://github.com/msberends/AMR.git
synced 2026-06-29 18:56:19 +02:00
(v3.0.1.9080) fix(as.mo): resolve abbreviated genus when species has subspecies (#288 follow-up) (#301)
When a genus+species abbreviation like "P. ovale" was used, the previous bypass (Issue #288) checked sum(sp_exact) == 1, which failed if the species also had subspecies sharing the epithet (ovale curtisi, ovale wallikeri). The fix extends the bypass to fire whenever all exact species matches belong to one genus, collapsing to the species-rank record (subspecies == "") for genus+species queries and preserving the chosen row for explicit subspecies queries. Also extends the data-invariant test to cover all taxonomic rank columns from domain to subspecies, not just the terminal three. Claude-Session: https://claude.ai/code/session_01M4fqQYQYJ3drdudkDYNqAY Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -142,3 +142,9 @@ test_that("test-data.R", {
|
||||
# x <- check_non_ascii() %>%
|
||||
# filter(file %unlike% "^(data-raw|docs|git_)")
|
||||
})
|
||||
|
||||
test_that("taxonomic name columns contain no NA (empty string is used instead)", {
|
||||
for (col in c("domain", "kingdom", "phylum", "class", "order", "family", "genus", "species", "subspecies")) {
|
||||
expect_false(anyNA(microorganisms[[col]]), info = col)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user