retrieve_models#

pharmpy.tools.retrieve_models(source, names=None)[source]#

Retrieve models after a tool run

Any models created and run by the tool can be retrieved.

Parameters:
  • source (str, Path, Context) – Source where to find models. Can be a path (as str or Path), or a Context

  • names (list) – List of names of the models to retrieve or None for all

Returns:

list – List of retrieved model objects

Examples

>>> from pharmpy.tools import retrieve_models
>>> tooldir_path = 'path/to/tool/directory'
>>> models = retrieve_models(tooldir_path, names=['run1'])