LocalDirectoryContext#

class pharmpy.workflows.LocalDirectoryContext(name, ref=None, common_options=None)[source]#

Bases: Context

Context in a local directory

Parameters:
  • name (str) – Name of the context

  • ref (str) – Path to directory. Will be created if it does not exist.

Attributes Summary

Methods Summary

create_subcontext(name)

Create a new subcontext of this context

exists(name[, ref])

get_parent_context()

Get the parent context of this context

get_subcontext(name)

Get one of the subcontexts of this context

list_all_names()

Retrieve a list of all model names in the context

list_all_subcontexts()

Retrieve a list of the names of all subcontexts in the context

retrieve_annotation(name)

Retrieve an annotation for a model

retrieve_common_options()

retrieve_key(name)

Retrive the key corresponding to a model name

retrieve_log([level])

Retrieve the entire log all - the entire log current - only the current Context level lower - current and sub levels

retrieve_metadata()

Read tool metadata

retrieve_name(key)

retrieve_results()

Retrieve tool results

store_annotation(name, annotation)

Store an annotation string (description) for a model

store_key(name, key)

Associate a key with a model name

store_message(severity, ctxpath, date, message)

store_metadata(metadata)

Store tool metadata

store_results(res)

Store tool results

Attributes Documentation

context_path#

Methods Documentation

create_subcontext(name)[source]#

Create a new subcontext of this context

static exists(name, ref=None)[source]#
get_parent_context()[source]#

Get the parent context of this context

get_subcontext(name)[source]#

Get one of the subcontexts of this context

list_all_names()[source]#

Retrieve a list of all model names in the context

list_all_subcontexts()[source]#

Retrieve a list of the names of all subcontexts in the context

retrieve_annotation(name)[source]#

Retrieve an annotation for a model

retrieve_common_options()[source]#
retrieve_key(name)[source]#

Retrive the key corresponding to a model name

This key can be used to lookup the model in the model database

retrieve_log(level='all')[source]#

Retrieve the entire log all - the entire log current - only the current Context level lower - current and sub levels

retrieve_metadata()[source]#

Read tool metadata

retrieve_name(key)[source]#
retrieve_results()[source]#

Retrieve tool results

Returns:

Results – Tool results object

store_annotation(name, annotation)[source]#

Store an annotation string (description) for a model

store_key(name, key)[source]#

Associate a key with a model name

store_message(severity, ctxpath, date, message)[source]#
store_metadata(metadata)[source]#

Store tool metadata

Parameters:

metadata (dict) – Tool metadata dictionary

store_results(res)[source]#

Store tool results

Parameters:

res (Results) – Tool results object