Skip to contents

Fetches the models contained in the module.

Usage

MB_fetch_mdl(state)

Arguments

state

MB state from MB_fetch_state()

Value

list containing the following elements

  • isgood: Return status of the function.

  • hasmdl: Boolean indicator if the module has any models

  • msgs: Messages to be passed back to the user.

  • mdl: List with models. Each list element has the name of the R-object for that dataset. Each element has the following structure:

    • label: Text label for the model (e.g. one-compartment model).

    • MOD_TYPE: Type of module.

    • id: Module ID.

    • rx_obj: The rxode2 object.

    • rx_obj_name: The rxode2 object name that holds the model.

    • ts_obj List with elements system and details

    • ts_obj_name: The object name that holds the model time scale information.

    • fcn_def: Text to define the model

    • MDLMETA: Notes about the model.

    • code: Code to generate the model.

    • checksum: Module checksum.

    • MDLchecksum: Model checksum.

Examples

# We need a module state:
sess_res = MB_test_mksession(session=list(), full_session=FALSE)
#> → MB: including file
#> → MB:   source: file.path(system.file(package="onbrand"), "templates", "report.docx")
#> → MB:   dest:   file.path("config","report.docx")
#> → MB: including file
#> → MB:   source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
#> → MB:   dest:   file.path("config","report.pptx")
#> → MB: including file
#> → MB:   source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
#> → MB:   dest:   file.path("config","report.yaml")
#> ! MB: User-defined model: /Users/jmh/projects/ruminate/github/ruminate/docs/reference/user_model.R not found (skipping)
#> ! MB: User-defined model: /Users/jmh/projects/ruminate/github/ruminate/docs/reference/user_model.ctl not found (skipping)
#> → MB: module checksum updated:24933f86b657b9503f22440e8c4d3cac
#> → MB: State initialized
#> ! MB: User-defined model: /Users/jmh/projects/ruminate/github/ruminate/docs/reference/user_model.R not found (skipping)
#> ! MB: User-defined model: /Users/jmh/projects/ruminate/github/ruminate/docs/reference/user_model.ctl not found (skipping)
#>  
#>  
#>  parameter labels from comments are typically ignored in non-interactive mode
#>  Need to run with the source intact to parse comments
#> → MB: model checksum updated: 98407146cbcfb0e5392b7bf47aeb1d09
#> → MB: module checksum updated:a317b4031c8ca91b0c52f2a06412fe69
state = sess_res$state

mdls = MB_fetch_mdl(state)

names(mdls)
#> [1] "hasmdl"     "isgood"     "ts_details" "msgs"       "mdl"