Stop run_psa dropping the first parameter column

Aperta
#174 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@feralaes ci sta già lavorando.

Dal 13/11/2026.

  • #237 di @feralaes — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
r
Ambito
data

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
R
Stelle
43
Fork
14
Merge medio
4h 44m
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DARTH-git/dampack

Tutte le issue di DARTH-git/dampack

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.