Stop run_psa dropping the first parameter column

Đang mở
#174 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@feralaes đang làm issue này rồi.

Từ ngày 13/11/2026.

  • #237 của @feralaes — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
r
Lĩnh vực
data

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
R
Star
43
Fork
14
Merge trung bình
4 giờ 44 phút
Pull request đã merge (30 ngày)
15

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DARTH-git/dampack

Tất cả issue của DARTH-git/dampack

Issue tương tự

Thêm issue về R

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.