Nicer output for tp_run() - #31
Open
foersterst wants to merge 7 commits into
Open
Conversation
…s. Update to the function's documentation.
…ut JSON file(s). Includes updated documentation.
… we might need this column for post-processing.
…n of all functions involved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tp_run()used to return a list built directly from the output JSON viajsonlite. That list was long and hard to read, and it always needed atp_parse…()call afterward to become usable. This PR changes that. Now,tp_run()returns a tidy data frame produced bytp_parse_smc()ortp_parse_mcmc(), called internally for any model those two functions support (models that return trees still need dedicated parsers, which we haven't built yet).tp_run()picks the right parser automatically, based on the inference method and model passed totp_compile(). It reads that information from the sampler and decides which parser to call. For models without a parser yet, it returns the path to the output JSON along with a message instead.The PR also updates the documentation for all functions involved.
NB: I accidentally created the branch
tidy-outputfrom my branchvignettesrather thanmain, so it inherited the commits under consideration in #30.TreePPL Release Notes
Added
tp_run()prints a summary with some runtime information and output directories/files. We can add more to this summary later if needed.tp_run()when using MCMC.widetotp_parse_smc()andtp_parse_mcmc()to let users decide whether the resulting data frame is in wide (standard in other software) or long (good for plotting) format. Default =TRUE.importFrom("methods", "new")toNAMESPACEto suppress one of the warnings duringR CMD check.Changed
tp_run()from a list object to a (humanly readable) tidy data frame.tp_parse_smc()andtp_parse_mcmc()from alistobject to a charactervectorcontaining the path to the JSON output file(s). Before, the parsers only worked on the list previously returned bytp_run(), creating a strict dependency betweentp_run()and the parser functions and vice-versa. Now the parser functions can also be used by anyone who ran a TreePPL analysis from the terminal and wants to do the post-processing in R withtreepplr.tp_run()changed, I redesigned its tests, keeping the same logic as the old ones.tp_run()now returns data frames in wide format by default.tp_mcmc_convergence()andtp_smc_convergence()accept data frames in either long or wide format.Deprecated
Removed
Fixed
Security