eduaguilera/whep

footprint_balance: compare_footprint_methods conflates NA-valued footprints with zero

開放

#212 建立於 2026年7月22日

 (1 則留言) (0 個反應) (0 位負責人)R (3 個分叉)auto 404
area:footprintbuggood first issuehelp wantedmechanicalno-data-neededpriority:low

倉庫指標

星標
 (1 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

What

compare_footprint_methods() (R/footprint_balance.R:104-121) uses sum(value) with no na.rm, so a cell containing an NA sums to NA; the subsequent tidyr::replace_na(value_a, 0) — intended to fill cells absent from one method — silently rewrites that NA to 0.

Why it matters

A genuine-but-NA footprint is reported as "zero footprint", fabricating a spurious abs_diff equal to the other method's full value.

Suggested fix / check

Distinguish "absent from this method" from "present but NA" before replacing with 0.


From deep static audit (2026-07-22), parallel subsystem review pass. Deduplicated against then-open issues. Not verified by running unless stated.

貢獻者指南