Stop run_psa dropping the first parameter column

未关闭
#174 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@feralaes 已经在做这个了。

开始于 2026年11月13日。

  • #237 来自 @feralaes —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
r
领域
data

调研方向

Start with make_psa_obj(parameters = psa_samp[, -1]) at R/run_psa.R:121 and the FUN validity guard near R/run_psa.R:47, and check how gen_psa_samp() builds the nsamp index column. The issue asks for the leading column to be dropped only when it is that index column, and for the guard to raise 'FUN is not well defined' via a tryCatch success flag. Done means new cases in tests/testthat/test_run_psa.R pass for a hand-built psa_samp and a misdefined FUN, and the audit repro is re-run on the branch.

由索引模型根据 Issue 内容生成。

描述

bug

Goal

run_psa calls make_psa_obj(parameters = psa_samp[, -1]) unconditionally, so a hand-built psa_samp silently loses its first real parameter from $parameters and $parnames even though that parameter still drives FUN and the computed outcomes. Separately, the FUN-validity guard in the same file is dead code — is.na(sum(is.na(x))) is always FALSE, so the intended friendly error never fires.

Scope

  • At R/run_psa.R:121, drop the leading column only when it is the nsamp index column that gen_psa_samp() prepends
  • At R/run_psa.R:47, replace the inert guard with a tryCatch success flag so FUN is not well defined is actually raised
  • Add regression tests in tests/testthat/test_run_psa.R for a hand-built psa_samp and for a misdefined FUN
  • Re-verify the audit repro on-branch before applying the proposed diff — this fix was reasoned from root cause, not re-run to green

Version: #172

主要语言
R
星标
43
派生
14
平均合并
4 小时 44 分钟
30 天内合并 PR
15

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DARTH-git/dampack 的其他 Issue

查看 DARTH-git/dampack 的全部 Issue

相似的 Issue

更多 R Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。