Skip to content

tp_compile() gives no guidance when a method name has been renamed across tpplc versions #24

Description

@maribraga

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions