Environment
- treepplr 0.14.0
- tpplc 0.4
Issue
Older code/docs/vignettes (and existing analysis scaffolds we were working from) use method names like "mcmc-lightweight" and "is-lw". Neither exists in tpplc 0.4 — the current names are "mcmc" ("MCMC using the lightweight approach", per tpplc --help) and "is" ("Importance sampling using likelihood weights").
tp_compile(model_path, method = "mcmc-lightweight", iterations = 10L)
#> Error in compilation(m$path, options_to_string(full_options)) :
#> Compilation failed
The only way to discover the actual problem is to run tpplc --help directly and diff the method list by hand — tp_compile()'s error gives no hint that method specifically is the issue, let alone what the valid values are.
Suggested fix
- Validate
method against the known set of inference methods (is, smc-apf, smc-bpf, mcmc, mcmc-naive, mcmc-trace, mcmc-graph, pmcmc-pimh, per current tpplc --help) before compiling, and raise a clear R error listing valid options if it doesn't match.
- Surface the underlying
tpplc command's actual stderr on compile failure by default (or via a verbose = TRUE argument) rather than the generic "Compilation failed", so the real reason (e.g. an unrecognized flag/value) is visible without having to reach into treepplr:::compilation() internals.
Environment
Issue
Older code/docs/vignettes (and existing analysis scaffolds we were working from) use method names like
"mcmc-lightweight"and"is-lw". Neither exists intpplc 0.4— the current names are"mcmc"("MCMC using the lightweight approach", pertpplc --help) and"is"("Importance sampling using likelihood weights").The only way to discover the actual problem is to run
tpplc --helpdirectly and diff the method list by hand —tp_compile()'s error gives no hint thatmethodspecifically is the issue, let alone what the valid values are.Suggested fix
methodagainst the known set of inference methods (is,smc-apf,smc-bpf,mcmc,mcmc-naive,mcmc-trace,mcmc-graph,pmcmc-pimh, per currenttpplc --help) before compiling, and raise a clear R error listing valid options if it doesn't match.tpplccommand's actual stderr on compile failure by default (or via averbose = TRUEargument) rather than the generic"Compilation failed", so the real reason (e.g. an unrecognized flag/value) is visible without having to reach intotreepplr:::compilation()internals.